隨著OpenBSD4.0的發布,新一輪的嘗鮮、升級、安裝、測試又要開始。對於新手(包括我在內)這第一步便是如何制作安裝盤,網上現成的文章成堆,另外還有高手(一般都謙虛地說自己不是)制作的自動化腳本,極大的方便了制作過程。不過這裡引發了兩個問題,其一:大部分網上的文章,這第一步從OpenBSD站點下在所需文件的方法就有些問題(也許是我人品問題),所以我才寫這個“簡單修正”。其二:人家給你制作了自動化腳本,在第一時間方便了你的安裝,但如果你還是想自己動手從最基礎的部分入手,想更細化規范的學習,相信這第一步還是挺重要,扎實的基礎是日後游刃有余的根本。
制作iso映像系統環境為FreeBSD6.1,所需附加軟件cdrtools,當前版本2.01_5,位於/usr/ports/sysutils/cdrtools。
第一步:建立文件夾(可選),下載所需文件。
#mkdir -p /other/openbsd/4.0
#cd /other/openbsd/4.0
注:other是我系統下的一個分區,你可以按照你的系統環境變通,但剩余容量最好大於500兆,至於建立openbsd文件夾,網上通常寫法類似於mkdir -p openbsd/4.0/i386,我這裡省略了i386是因為後面的wget下載過程中會自動建立。
第二步:制作iso映像。
這步可以安心的使用網上文章的命令來生成iso映像了,但提醒你注意命令行裡的路徑。
#cd /other/openbsd (確保你在正確的路徑)
#mkisofs -vrTJV “OpenBSD40″ -b 4.0/i386/cdrom40.fs -c boot.catalog -o OpenBSD40.iso ./
稍等一會兒,你就會通過自己的操作獲得一張標准的可引導OpenBSD安裝盤,至於刻錄嗎?抱歉-幫不上忙,這個也要你自己動手了,不過-估計不用看教程,是不?:~)
___ ____ ____ ____ / _ \ _ __ ___ _ __ | __ ) ___|| _ \ | | | | '_ \ / _ \ '_ \| _ \___ \| | | || |_| | |_) | __/ | | | |_) |__) | |_| | \___/| .__/ \___|_| |_|____/____/|____/ |_|
How to make an OpenBSD bootable install CD.
Usually when I install OpenBSD I install using a boot floppy and download what I need thru FTP. But if you have to do an install without an internet connection then you have no choice but to use a CD. But the OpenBSD project does not offer downloadable ISO images like most linux distros. This is because they want you to buy their CD's which fund their project. If you use OpenBSD please buy something (shirts/posters/cd's/stickers) from their site to support their project. I buy t-shirts. But since I don't buy CD's I have to make my own. So this is how to make your own bootable OpenBSD CD.
This example was done for the OpenBSD 3.8. Architecture i386.
2. Next we need to make a few directories which will be the file system hierarchy. The top directory will be called "OpenBSD". The next directory down will be the version number of the OpenBSD release (3.8). The next directory down from that will be the architecture type (i386). In the architecture directory is where the install files will be going. Here is a quick example of making the hierarchy in the /tmp directory. Please switch to the root account to perform any steps if necessary.
/tmp> mkdir -p OpenBSD/3.8/i386
/tmp> cd OpenBSD/3.8/i386
/tmp/OpenBSD/3.8/i386>
or
CKSUM
INSTALL.i386
INSTALL.linux
MD5
base38.tgz
bsd
bsd.mp
bsd.rd
cd38.iso
cdboot
cdbr
cdemu38.iso
cdrom38.fs
comp38.tgz
etc38.tgz
floppy38.fs
floppyB38.fs
floppyC38.fs
game38.tgz
index.txt
man38.tgz
misc38.tgz
pxeboot
xbase38.tgz
xetc38.tgz
xfont38.tgz
xserv38.tgz
xshare38.tgz
This list includes all the files in the 3.8 directory.
4. Now we will make the ISO image. We will go back up to the "OpenBSD" directory and execute the "mkisofs" command with some options. We will be using the cdrom38.fs to be our boot image for the CD. If this image has boot problems on your computer then you can try the floppy38.fs as your boot image. Please see the mkisofs man page for what the options are for. Please note that if /tmp/OpenBSD/OpenBSD38.iso exists and you run mkisofs again it will simply append the new image to the old image. Thus making the new image twice as large with illegal directories. Ok execute the following commands:
/tmp/OpenBSD/3.8/i386> cd ../../
/tmp/OpenBSD>mkisofs -vrTJV "OpenBSD38" -b 3.8/i386/cdrom38.fs -c boot.catalog -o OpenBSD38.iso /tmp/OpenBSD/
5. Now you should have a ISO image named "OpenBSD38.iso" in the /tmp/OpenBSD directory. Take this ISO image and burn it to a CD using your favorite burning program. Enjoy!