FreeBSD5.4笔记记录一——ports及源码和内核更新

    技术2022-05-11  100

    一、ports及源码更新

    先安装cvsup:

    #pkg_add -r cvsup-without-gui

    然后拷贝相关配置文件:

    #cd /usr/share/examples/cvsup/

    #cp ports-supfile /root/

    #cp stable-supfile /root/

    #cp standard-supfile /root/

    #cd /root/

     

    更新ports:

    #vi ports-supfile

    作如下改动:default host=cvsup.FreeBSDchina.org

    然后:x!保存退出。

    Alt+F2切换到另一终端(如果不切换到另一终端直接执行下列命令可能返回错误提示),root登陆:

    #cvsup -L2 ports-supfile

     

    更新源码:

    #cd /root/

    #vi stable-supfile

    作如下修改:default host=cvsup3.FreeBSDchina.org

    然后:x!保存退出。

    Alt+F3切换到另一终端(如果不切换到另一终端直接执行下列命令可能返回错误提示),root登陆:

    #cvsup -L2 stable-supfile

     

    二、自行定制内核

    先复制源码中的默认内核文件到/root/目录,并改名GENERIC为kernel,然后修改kernel文件,然后用ln命令作一个软链接到源码目录下。再编译安装重启即可。

    #cd /sys/i386/conf/

    #cp GENERIC /root/kernel

    #cd /root/

    #vi kernel

    定制更改后,保存退出。

    #ln -s kernel /sys/i386/conf/kernel

    编译内核:

    #make buildkernel KERCONF=kernel

    编译完成后,安装新内核:

    #make installkernel KERCONF=kernel

    安装新内核后,重启:

    #reboot

    查看内核版本:

    #uname -a

    现在我的FB是5.5stable版本了。

     

    三、关于源码更新的一点补充

    cvsup各更新文件说明

    路径: /usr/share/examples/cvsup/ cvs-supfile        //更新Main source tree and ports collection doc-supfile        //更新Document gnats-supfile    //更新FreeBSD bug database ports-supfile      //更新Ports collection stable-supfile     //更新Main source tree (稳定版本) standard-supfile //更新Main source tree (标准版本) www-supfile        //更新FreeBSD 官方網頁  更新系统源码(通过standard-supfile)编辑 supfile

      Code:

    [Copy to clipboard]  

    ee /usr/cvsup/standard-supfile

    有两个地方要改:

      Code:

    [Copy to clipboard]  

    *default host=cvsup3.cn.freebsd.org *default release=cvs tag=RELENG_5_2_1_RELEASE

    注意:原文件中的 cvs tag 是一个点,一定要改了它(偶就曾因为忘记改这行,结果更新到了6.*,暴汗~~~~),特别是用current分支的朋友,并且一定要改对,可以去这个网页查 cvs tag: http://www.freebsd.org/cgi/cvsweb.cgi/src/定制内核这个没什么可说的了,N多教程可以看有一点要说明,如果你没有更新过系统源码,用以下代码编辑安装新内核   Code:[Copy to clipboard]  

    /usr/sbin/config 你的内核文件名cd ../complie/你的内核文件名make dependmake make install

    如果更新过系统源码:   Code:[Copy to clipboard]  

    cd /usr/srcmake buildkernel KERNCONF= 你的内核文件名make installkernel KERNCONF=你的内核文件名


    最新回复(0)