BuildFreeBSDInstallationCDsToDVD
From LeakonWiki
Build FreeBSD Installation CDs To One DVD
本文分别以 Windows 平台和 Linux 平台描述了如何把 FreeBSD 的多张安装 CD 合并为一张 DVD
Windows Platform
Windows 平台
通常需要CD2、CD3的情况是在安装CD1上的package时需要安装CD2上的某些package才会被用到,并且安装期间很容易出现频繁的置换两张CD。
所以得出一个简单的、为了实现方便安装package的、制作单张FreeBSD DVD的方法:
制作平台是Windows + UltraISO => Freebsd 7.0。
其实可以用任何编辑ISO的软件,如果配合一个虚拟光驱来测试镜像,制作起来会更方便些。
步骤:
1、将CD2、CD3中的packages文件夹完整的复制到计算机硬盘的一个临时位置;
2、编辑刚复制到硬盘的packages文件夹中的INDEX文件,CD1和CD2、CD3的是同样的内容,编辑一个就可以了,这个是关键,它记录了一个FreeBSD发行版所有package的光盘位置的信息,安装package判断在CD1还是CD2、CD3就是靠这个文件来判断的;
3、现在我们找一个文本编辑器将他打开,搜索并将"|2"和"|3"替换为"|1",从字面上看就能明白,就是将指向到CD2、CD3的package修改为指向CD1,因为我们只有一张DVD;
4、用UlrtaISO(或其他编辑镜像的软件)打开CD1,将刚才复制到硬盘上的CD2、CD3的packages文件夹追加到CD1中,确保CD1的packages包含了发行版CD1和CD2、CD3所有packages的文件,并且INDEX文件是刚才我们编辑过的文件;
5、忽略CD2、CD3下的cdrom.inf,它已被遗弃;
6、还可以把docs盘的内容也相应的追加过来;
7、保存镜像 -> [测试镜像] -> 刻录光盘 -> 完成。
Linux Platform
Linux 平台
FreeBSD distributions usually have 2 CDs.
I wanted to have both CDs combined into one DVD.
There are several good reasons to do this.
Convenience: It is easier for me to keep track of 1 DVD.
Speed: I get at the most 3-4MB/S from my 52X CDRom drive, but I get as high as 10MB/S from my DVD running at 16X.
Knowledge: I wanted to learn more about the details of the CD and DVD formats.
Spreading the word: By describing how to put FreeBSD on a DVD ,
I promote the image that FreeBSD is a mainstream OS and provide a service back to the BSD community.
I will call the 2 CDs, CD1.iso and CD2.iso.
The entire process will be done through the command line using TAR, mkdir, mdconfig, mount, and growisofs.
If you are not familiar with these commands, read up on them before attempting to make your own DVD.
It will be necessary to perform some of these commands as super-user unless you have set up your current FreeBSD installation to allow regular users to use mdconfig and mount commands.
I won't go into a lot of details on how the commands work.
You will have to visit the man pages and study them yourself. At this time, I am only going to provide a basic step by step description of how I make a FreeBSD DVD from the 2 distribution CDs.
As a regular user, I created directory called Downloads, and a subdirectory called temp and put the 2 distribution CDs I renamed CD1.iso and CD2.iso into temp.
My directory structure looked like this /home/barry/Downloads/temp/.
After logging in to my account, here is what I did. (cd to the directory with CD1.iso and Cd2.iso in it)
> cd Downloads/temp (change to super-user) > su Passwd:
(make certain the iso files are here) wiki.leakon.com# ls *iso CD1.iso CD2.iso
(create a memory disk for CD2.iso and mount it to /mnt) wiki.leakon.com# mdconfig -a -f CD2.iso md0 wiki.leakon.com# mount -t cd9660 /dev/md0 /mnt
(use tar to copy the files, this better than the cp command IMHO) wiki.leakon.com# tar -C /mnt -cf - . |tar -xf - (the previous command takes some time, but is faster than a CDRom drive.)
(ok, unmount CD2.iso and remove the memory disk) wiki.leakon.com# umount /mnt wiki.leakon.com# mdconfig -d -u 0
(create a memory disk for CD2.iso and mount it to /mnt) wiki.leakon.com# mdconfig -a -f CD1.iso md0 wiki.leakon.com# mount -t cd9660 /dev/md0 /mnt
(use tar to copy the files, this better than the cp command IMHO) wiki.leakon.com# tar -C /mnt -cf - . |tar -xf -
(ok, unmount CD2.iso and remove the memory disk) wiki.leakon.com# umount /mnt wiki.leakon.com# mdconfig -d -u 0
(Now it is necessary to check a couple of things.) (it is neccessary that the cdrom.inf file point to the first CD volume.) wiki.leakon.com# cat cdrom.inf CD_VERSION = 6.1-RC1 CD_VOLUME = 1
(change the package references in the packages/INDEX file to point to the first CD.) wiki.leakon.com# cd packages wiki.leakon.com# cat INDEX |sed "s/|2/|1/g" > ix wiki.leakon.com# mv ix INDEX wiki.leakon.com# cd ..
(the temp/rr_moved directory needs to be removed) wiki.leakon.com# rm -r temp/rr_moved wiki.leakon.com# cd ..
(now we should be at /home/barry/Downloads and the /home/barry/Downloads/temp directory should have CD1.iso, CD2.iso and all of the files we need for the DVD) (use growisofs to build and burn the DVD iso.)
wiki.leakon.com# growisofs -Z /dev/cd0 -speed 16 -no-emul-boot -b boot/cdboot -iso-level 3 temp
(make certain you have a blank DVD in your DVD writer, my DVD burner and media can run at 16X so I set my speed to 16, change this to whatever speed your DVD burner and media can support) wiki.leakon.com#
(log out from the super-user account) wiki.leakon.com# exit >
Why did I do it this way ?
I like to use the command line.
Why did I leave the original iso images in the new DVD ?
DVDs and Cds start writing at inside of the disk.
This is the slowest area of the media. By putting the 2 CD images into the directory first, I moved the DVD installation data about 1.2G into the DVD.
The read speeds improve significantly by doing this.
Thats all , if you can not get this to work, try checking a few things before you email me.
Do you have access to the super-user account ?
Is your DVD burner identified as /dev/acd0 ?
Did you create the proper directorys, remember to use your own paths, not mine !
Do you have the tools installed ? You may have to install dvd+rw-tools.
Good Luck !

