随着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!

