使用者工具

網站工具


freebsd:world_kernel

這是本文件的舊版!


FreeBSD 6.2 RELEASE

做世界 BuildWorld

編譯環境的設定檔

Download World Source Code

系統所需的程式原始碼,存放在 /usr/src/ 中。

# sysinstall
Configure -> Distributions -> src -> All

Upgrade Source Code

更新原始檔。

# cd /usr/src
# make update

Build World

編譯所有檔案。

make -j2 buildworld

刻核心 BuildKernel

修改核心設定檔

MYKERNEL 可以改成自己想要的核心名字。

# cd /usr/src/sys/i386/conf
# cp GENERIC MYKERNEL

將用不到的東西 mark 掉。先參考 /var/run/dmesg.boot 中,看看會用到哪些硬體,記得編進去。尤其是與硬碟相關的設備(ATA/SATA/SCSI/NAS等等),避免找不到硬碟無法開機。

# vi MYKERNEL

Build Kernel

-j2 代表同時有兩個程式在執行,對於雙核心或多核心系統可減少編譯時間,四個核心可以用 -j5。

# cd /usr/src
# make -j2 buildkernel KERNCONF=MYKERNEL

安裝核心 Install Kernel

# make installkernel KERNCONF=MYKERNEL

將編譯過程中使用的檔案刪除:

# rm -rf /usr/obj/usr/src/sys/MYKERNEL

安裝世界 Install World

# make installworld

Mergemaster

把 /usr/src/etc 的東西跟 /etc 的東西更新。

# mergemaster

新世界

# sync;sync;sync;reboot

最後,祈禱沒出問題。 XD

問題處理

找不到硬碟

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>

通常是有 SATA/RAID 卡等忘了編進去,在開機選單時(右方有 ASCII 的 FreeBSD字樣),按 ESC 進入 prompt,根據使用到的驅動,輸入

load da
load mpt

等字。掛載完成後輸入

boot

開機,即可順利掛載硬碟。

版本升級

EX: 從 FreeBSD 6.3 RELEASE 升級至 FreeBSD 7.2 RELEASE

查詢 /etc/make.conf 中的 SUPFILE 設定指向哪個檔案:

SUPFILE=        /usr/share/examples/cvsup/standard-supfile

至該檔案查詢:

  *default release=cvs tag=RELENG_6_3

改成

  *default release=cvs tag=RELENG_7_2

然後重新

make update
make buildworld
make buildkernel
make installkernel
make installworld
mergemaster

等等… 其中,mergemaster 需要仔細看。

freebsd/world_kernel.1245489445.txt.gz · 上一次變更: 2009/06/20 17:17 由 wenpei