安裝完 FreeBSD,接著要更新 kernel 使 FreeBSD 保持在最新版
觀察舊版本資訊
# uname -a
安裝 CVSUP 或 csup
csup 是一支利用 C 語言改寫 CVSup 的程式,效能較 CVSup 快許多
設定 package root
每次登入執行下列指令,或將下列指令加入 ~/.cshrc
setenv PACKAGEROOT ftp://ftp.tw.freebsd.org
安裝 CVSUP
# pkg_add -r cvsup-without-gui
# rehash
安裝 csup
1. ports 安裝
# cd /usr/port/net/csup
# make install clean
2. package 安裝
# pkg_add -r csup
# rehash
3. 若以上兩種階找不到此一路徑 or 檔案,到官方網站下載並解壓縮
# fetch http://mu.org/~mux/csup-snap-20060313.tgz
# tar xzvf csup-snap-20060313.tgz
# cd csup
# make;make install
複製 make.conf
# cp /usr/share/examples/etc/make.conf /etc/
修改 make.conf ,修改的設定會對未來所有 make 指令生效
make.conf 參考設定
SUP_UPDATE= yes
# csup
SUP= /usr/local/bin/csup
SUPFLAGS= -g -Z -L 1
# CVSup
#SUP= /usr/local/bin/cvsup
#SUPFLAGS= -g -L 2
#
# SUPHOST ...... CVSup.......... Server.
# cvsup[1-9].tw.FreeBSD.org
SUPHOST= cvsup.tw.FreeBSD.org
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
PACKAGEROOT= ftp://ftp.tw.freebsd.org
# ..... FreeBSD distfiles mirror ..
MASTER_SITE_BACKUP?= \
ftp://ftp1.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp5.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp9.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
MASTER_SORT_REGEX?= \.tw/ \.tw\. \.edu/ \.edu\.
NO_MODULES= true
WITHOUT_X11= yes
NO_GUI= yes
USA_RESIDENT= NO
更新 source
# cd /usr/src
# make update
build world 編譯所有的原始碼
編譯前請先閱讀 /usr/src/UPDATING 內的說明
# cd /usr/src
# make buildworld
修改適合的 kernel configuration
# cd /usr/src/sys/i386/conf
# cp GENERIC NEWKERNEL
編譯核心
Building and Installing a Custom Kernel
# cd /usr/src
# make buildkernel KERNCONF=NEWKERNEL
安裝新核心
# cd /usr/src
# make installkernel KERNCONF=NEWKERNEL
非遠端安裝時,先 reboot 後進 single user mode 後再執行以下步驟(官方建議)
使用 mergemaster Pre-buildworld mode
# mergemaster -p
安裝 buildworld 編譯產生的新檔案
# make installworld
使用 mergemaster 同步 /etc 和 /usr/src/etc 下的設定檔
注意比對曾經修改過的檔案,尤其是 /etc/master.passwd, /etc/group, /etc/inetd.conf, /etc/hosts
# mergemaster
重開機
# reboot
觀察新版本資訊
# uname -a
No comments:
Post a Comment