這裏顯示兩個版本的差異處。
| Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
|
freebsd:world_kernel [2007/08/07 21:03] wenpei |
freebsd:world_kernel [2010/01/10 11:16] (目前版本) wenpei |
||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | FreeBSD 6.2 RELEASE | ||
| - | ====== 做世界 BuildWorld ====== | ||
| - | ===== 編譯環境的設定檔 ===== | ||
| - | 複製 make 的設定檔(若檔案已經存在就不需要)。 | ||
| - | # cp /usr/share/examples/etc/make.conf /etc/ | ||
| - | 修改 make.conf,新增 MASTER_SITE_BACKUP。 | + | FreeBSD 6.2 RELEASE 至 FreeBSD 7.2 RELEASE 等。 |
| + | |||
| + | ====== 版本升級 ====== | ||
| + | EX: 從 FreeBSD 6.3 RELEASE 升級至 FreeBSD 7.2 RELEASE | ||
| + | |||
| + | 查詢 /etc/make.conf 中的 SUPFILE 設定指向哪個檔案: | ||
| + | SUPFILE= /usr/share/examples/cvsup/standard-supfile | ||
| + | |||
| + | 至該檔案查詢: | ||
| <code> | <code> | ||
| - | # CVSup update flags. Edit SUPFILE settings to reflect whichever distribution | + | *default release=cvs tag=RELENG_6_3 |
| - | # file(s) you use on your site (see /usr/share/examples/cvsup/README for more | + | </code> |
| - | # information on CVSup and these files). To use, do "make update" in /usr/src. | + | |
| - | # | + | |
| - | SUP_UPDATE=yes | + | |
| - | # | + | |
| - | SUP= /usr/local/bin/csup | + | |
| - | SUPFLAGS= -g -L 2 | + | |
| - | SUPHOST= cvsup.tw.FreeBSD.org | + | |
| - | SUPFILE= /usr/share/examples/cvsup/standard-supfile | + | |
| - | PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile | + | |
| - | DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile | + | |
| - | X11BASE=${LOCALBASE} | + | |
| - | MASTER_SITE_BACKUP?= \ | + | 改成 |
| - | ftp://freebsd.csie.ncu.edu.tw/distfiles/${DIST_SUBDIR}/ \ | + | <code> |
| - | ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR}/ | + | *default release=cvs tag=RELENG_7_2 |
| - | MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP} | + | </code> |
| + | 或 8.0: | ||
| + | <code> | ||
| + | *default release=cvs tag=RELENG_8_0 | ||
| </code> | </code> | ||
| + | |||
| + | 然後重新 | ||
| + | make update | ||
| + | make buildworld | ||
| + | make buildkernel | ||
| + | make installkernel | ||
| + | make installworld | ||
| + | mergemaster | ||
| + | 等等... 其中,mergemaster 需要仔細看。 | ||
| + | |||
| + | ====== 做世界 BuildWorld ====== | ||
| + | ===== 編譯環境的設定檔 ===== | ||
| + | 參考: https://wiki.sars.tw/doku.php?id=freebsd:basic#make.conf | ||
| ===== Download World Source Code ===== | ===== Download World Source Code ===== | ||
| 行 50: | 行 58: | ||
| # cp GENERIC MYKERNEL | # cp GENERIC MYKERNEL | ||
| - | 將用不到的東西 mark 掉。 | + | 將用不到的東西 mark 掉。先參考 /var/run/dmesg.boot 中,看看會用到哪些硬體,記得編進去。尤其是與硬碟相關的設備(ATA/SATA/SCSI/NAS等等),避免找不到硬碟無法開機。 |
| # vi MYKERNEL | # vi MYKERNEL | ||
| 行 66: | 行 74: | ||
| ====== 安裝世界 Install World ====== | ====== 安裝世界 Install World ====== | ||
| # make installworld | # make installworld | ||
| - | |||
| ====== Mergemaster ====== | ====== Mergemaster ====== | ||
| 把 /usr/src/etc 的東西跟 /etc 的東西更新。 | 把 /usr/src/etc 的東西跟 /etc 的東西更新。 | ||
| - | # mergemaster | + | # mergemaster [-U] [-i] |
| + | |||
| + | -U 代表自動更新沒有被修改過的設定檔,在 FreeBSD 6.4 版本之後才可使用 | ||
| + | |||
| + | -i 代表自動安裝不存在的新檔案。 | ||
| + | |||
| + | 如果在舊版沒有 -U 可以用,通常只需要看一下差異,然後按 i 安裝新的設定值就可以了,除了 crontab、group、passwd、master.passwd、named.conf 等檔案一定會不同,不能直接安裝新版本,此時就要用 m 進入 merge 模式,然後看是要保留左邊舊版還是安裝右邊新版的檔案,如果要保留就輸入 l (小寫的 L),要用新版本就輸入 r。 | ||
| ====== 新世界 ====== | ====== 新世界 ====== | ||
| 行 75: | 行 88: | ||
| 最後,祈禱沒出問題。 XD | 最後,祈禱沒出問題。 XD | ||
| + | |||
| + | ====== 問題處理 ====== | ||
| + | ===== 7.x 升級 8.0 的問題 ===== | ||
| + | 安裝完 8.0,要 mergemaster 的時候,可能會出現問題: | ||
| + | <code> | ||
| + | install -o root -g wheel -m 644 atrun cron ftpd imap kde login other passwd pop3 rsh sshd su system telnetd xdm /var/tmp/temproot/etc/pam.d | ||
| + | /var/tmp/temproot/etc/pam.d/ftp -> /var/tmp/temproot/etc/pam.d/ftpd | ||
| + | Bad system call (core dumped) | ||
| + | *** Error code 140 | ||
| + | |||
| + | Stop in /usr/src/etc/pam.d. | ||
| + | *** Error code 1 | ||
| + | |||
| + | Stop in /usr/src/etc. | ||
| + | *** Error code 1 | ||
| + | |||
| + | Stop in /usr/src. | ||
| + | *** Error code 1 | ||
| + | |||
| + | Stop in /usr/src. | ||
| + | |||
| + | *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to | ||
| + | the temproot environment | ||
| + | </code> | ||
| + | |||
| + | 是因為 /bin/ln 的檔案已經安裝成新版了,但是在舊版的環境無法執行,參考作法: | ||
| + | - 備份新版的 /bin/ln -- cp /bin/ln /root/ln_8.0 | ||
| + | - 從別台 7.x 的機器把舊版的 ln 透過 scp、http、ftp 等方式複製回來 -- scp xxxx@xxx.xxx.xx:/bin/ln /root/ln_7.x | ||
| + | - 暫時蓋過 -- cp /root/ln_7.x /bin/ln | ||
| + | - 重新 mergemaster 完成 | ||
| + | - 將新版的蓋回來 -- cp /root/ln_8.0 /bin/ln | ||
| + | - 重開機 | ||
| + | |||
| + | ===== 找不到硬碟 ===== | ||
| + | <code> | ||
| + | Manual root filesystem specification: | ||
| + | <fstype>:<device> Mount <device> using filesystem<fstype> | ||
| + | eg. ufs:da0sla | ||
| + | ? list valid disk boot devices | ||
| + | <empty line> Abort manual input | ||
| + | |||
| + | mountroot> | ||
| + | </code> | ||
| + | |||
| + | 通常是有 SATA/RAID 卡等忘了編進去,在開機選單時(右方有 ASCII 的 FreeBSD字樣),按 ESC 進入 prompt,根據使用到的驅動,輸入 | ||
| + | load da | ||
| + | load mpt | ||
| + | 等字。掛載完成後輸入 | ||
| + | boot | ||
| + | 開機,即可順利掛載硬碟。 | ||
| + | |||
| + | ===== "/usr/src/lib/libc/stdlib/Makefile.inc", line 19: Need an operator ===== | ||
| + | 編譯途中如果遇到下列錯誤: | ||
| + | <code> | ||
| + | ===> lib/libc (cleandir) | ||
| + | "/usr/src/lib/libc/stdlib/Makefile.inc", line 19: Need an operator | ||
| + | make: fatal errors encountered -- cannot continue | ||
| + | *** Error code 1 | ||
| + | </code> | ||
| + | 可能是之前重編後沒有將舊版的編譯檔案刪除,執行 | ||
| + | make clean; rm -rf /usr/obj | ||
| + | 後重新編譯應該就可以了。 | ||