3 # Module: mkisoimages.sh
4 # Author: Jordan K Hubbard
9 # This script is used by release/Makefile to build the (optional) ISO images
10 # for a FreeBSD release. It is considered architecture dependent since each
11 # platform has a slightly unique way of making bootable CDs. This script
12 # is also allowed to generate any number of images since that is more of
13 # publishing decision than anything else.
17 # mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
19 # Where -b is passed if the ISO image should be made "bootable" by
20 # whatever standards this architecture supports (may be unsupported),
21 # image-label is the ISO image label, image-name is the filename of the
22 # resulting ISO image, base-bits-dir contains the image contents and
23 # extra-bits-dir, if provided, contains additional files to be merged
24 # into base-bits-dir as part of making the image.
28 if [ "x$1" = "x-b" ]; then
36 echo usage: $0 '[-b] label iso-name base-dir [extra-dir]'
40 LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
46 # To create a bootable CD under EFI, the boot image should be an EFI
48 if [ $bootable = yes ]; then
51 dd if=/dev/zero of=$EFIPART count=$EFISZ
52 md=`mdconfig -a -t vnode -f $EFIPART`
53 newfs_msdos -F 12 -S 512 -h 4 -o 0 -s $EFISZ -u 16 $md
54 mount -t msdosfs /dev/$md $MNT
55 mkdir -p $MNT/efi/boot $MNT/boot $MNT/boot/kernel
56 cp -R $BASE/boot/defaults $MNT/boot
57 cp $BASE/boot/kernel/kernel $MNT/boot/kernel
58 if [ -s $BASE/boot/kernel/ispfw.ko ]; then
59 cp $BASE/boot/kernel/ispfw.ko $MNT/boot/kernel
61 cp $BASE/boot/device.hints $MNT/boot
62 cp $BASE/boot/loader.* $MNT/boot
63 if [ -s $BASE/boot/mfsroot.gz ]; then
64 cp $BASE/boot/mfsroot.gz $MNT/boot
66 cp $BASE/boot/color.4th $MNT/boot
67 cp $BASE/boot/support.4th $MNT/boot
68 cp $BASE/boot/check-password.4th $MNT/boot
69 cp $BASE/boot/screen.4th $MNT/boot
70 mv $MNT/boot/loader.efi $MNT/efi/boot/bootia64.efi
71 echo kern.cam.boot_delay=\"3000\" >> $MNT/boot/loader.conf
72 echo vfs.root.mountfrom=\"cd9660:iso9660/$LABEL\" >> $MNT/boot/loader.conf
75 BOOTOPTS="-o bootimage=i386;$EFIPART -o no-emul-boot"
80 publisher="The FreeBSD Project. http://www.FreeBSD.org/"
81 echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $BASE/etc/fstab
82 makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $BASE $*