FreeBSD Customized CD(Make your own release)

1 make buildworld
1.1 請先做cvsup 更新src(記得先裝cvsup-with-gui 等等會用到)

# cd /usr/ports/net/cvsup-without-gui; make install clean

1.2

# cd /usr/src; make buildworld

2 make release
2.1

# cp /usr/share/examples/cvsup/cvs-supfile /etc

2.2

# mkdir /home/ncvs /home/releng

2.3

# vi /etc/cvs-supfile
*default host=cvsup.tw.FreeBSD.org
*default prefix=/home/ncvs

2.4 csup 只能check,所以要裝cvsup

# cvsup /etc/cvs-supfile

2.5

# cd /usr/src/release;

2.6 開始做release

# make release RELEASETAG=RELENG_7_1 PORTSRELEASETAG=HEAD \
BUILDNAME=7.1-RELEASE-p3 CHROOTDIR=/home/releng \
CVSROOT=/home/ncvs NODOC=yes

指令說明:
RELEASETAG:
The CVS tag corresponding to the release that is to be built. If undefined, the release will be built from the HEAD of the CVS tree (a “-CURRENT snapshot”).,
PORTSRELEASETAG:
The CVS tag to use when checking out the ports tree. Usually, the head of the ports tree is used by default. If RELEASETAG specifies a release tag, then the associated release version is used as the default instead.

BUILDNAME:
The name of the release to be built. This is used to set the RELEASE value in sys/conf/newvers.sh, which affects the output of uname(1). If not set, a name with the timestamp and the “-SNAP” suffix will be generated.

CHROOTDIR:
The directory to be used as the chroot(8) environment for the entire release build. This file system should have at least 3.2 gigabytes of free space on the i386 architecture.

CVSROOT:
The location of the FreeBSD CVS repository. This path name is in reference to the real system root, not the root of the chroot(8) directory tree.

NODOC:
If defined, the SGML-based documentation from the FreeBSD Documentation Project will not be built. However, the “doc” distribution will still be created with the minimal documentation set providedin src/share/doc.

2.7 放入你想要額外用的檔案

# cp xxx.tgz /home/ releng/R/cdrom/dvd1/7.1-RELEASE-p3

3 加入install.cfg 至 mfsroot
3.1

# cd /home/releng/R/cdrom/dvd1/boot

3.2

# gunzip /home/releng/R/cdrom/dvd1/boot/mfsroot.gz

3.3

# mdconfig -a -t vnode -f /home/ releng/R/cdrom/dvd1/boot/mfsroot -u 0

3.4

# mount /dev/md0 /mnt

3.5

# cp /usr/src/usr.sbin/sysinstall/install.cfg /mnt

3.6

# vi /mnt/install.cfg (依照每台機器修改)

加入or修改以下資訊

# This is a sample installation configuration file for my test machine,
# crate.cdrom.com.
# It is included here merely as a sort-of-documented example.
#
# $FreeBSD: src/usr.sbin/sysinstall/install.cfg,v 1.12.6.1 2008/11/25 02:59:29 kensmith Exp $
# Turn on extra debugging.
debug=yes

##partition 互動調整硬碟
diskInteractive=yes
diskPartitionEditor

##label互動式調整硬碟
diskInteractive=yes
diskLabelEditor

###############################
# Select which distributions we want. 設定為最小安裝
##dists=base doc manpages info src sbase ssys kernels GENERIC
distSetMinimum

# media 從CD-ROM安裝
mediaSetCDROM

# OK, everything is set.  Do it!
installCommit

#解壓 xxx.tgz
command=touch /tmp/ok
system

指令說明:
command 不能斷行,不然在跑指令的時後會有error
command在安裝時的debug輸出訊息會是這樣
setting variable ‘command=我們打的command的內容’
所以在command 須要用到引號的部份最好都用雙引號

3.7 製作ISO檔

sh /usr/src/release/i386/mkisoimages.sh -b FreeBSD7 /home/7.1-RELEASE-p3.iso
 /home/releng/R/cdrom/dvd1

3.8 參考資料
# man release
# man sysinstall

http://romana.now.ie/writing/customfreebsdiso.html

http://www.sfc.wide.ad.jp/~watari/FreeBSD/boot.html

http://www.bsdunix.ch/public/docu/freebsd_sysinstall.html

這個是寫滿久了….忙一直忘了放上來….

About johnpupu

..........
This entry was posted in 有的沒的 and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word