SYSLINUX=$IMGPATH/usr/bin/syslinux if [ ! -f $SYSLINUX ]; then echo "$SYSLINUX doesn't exist" exit 1 fi prepareBootImage() { dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=/$MBD_TMPIMAGE 2>/dev/null mkdosfs -r 16 -C $MBD_TMPIMAGE $BOOTDISKSIZE >/dev/null $SYSLINUX $MBD_TMPIMAGE mount -o loop -t msdos $MBD_TMPIMAGE $MBD_BOOTTREE prepareBootTree } # prepare a directory with the kernel, initrd, and various message files # used to populate a boot image prepareBootTree() { (cd $BOOTDISKDIR; find . ! -name "*.msg" -maxdepth 1 ! -type d | cpio --quiet -p $MBD_BOOTTREE) cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz pngtopnm $BOOTDISKDIR/syslinux-splash.png | ppmtolss16 \#000000=0 \#cdcfd5=7 \#c90000=2 \#ffffff=15 \#5b6c93=9 > $BOOTDISKDIR/splash.lss cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss rm -f $MBD_BOOTTREE/syslinux-splash.png if [ -d $BOOTDISKDIR/$BOOTLANG ]; then for file in $BOOTDISKDIR/$BOOTLANG/*.msg; do filename=`basename $file` sed -e "s/@VERSION@/$VERSION/g" $file > $MBD_BOOTTREE/$filename done if [ $? != 0 ]; then echo $0: Failed to copy messages from $BOOTDISKDIR/$BOOTLANG to $MBD_BOOTTREE. umount $MBD_BOOTTREE rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE exit 1 fi else for file in $BOOTDISKDIR/*.msg; do filename=`basename $file` sed -e "s/@VERSION@/$VERSION/g" $file > $MBD_BOOTTREE/$filename done if [ $? != 0 ]; then echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE. umount $MBD_BOOTTREE rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE exit 1 fi fi } mkdir -p $TOPDESTPATH/images cat > $TOPDESTPATH/images/README </dev/null cp $IMGPATH/usr/lib/syslinux/isolinux.bin $MBD_BOOTTREE/isolinux.bin prepareBootTree # isolinux needs the config file to be isolinux.cfg mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg # copy in memtest if present if [ -f $IMGPATH/usr/lib/memtest86/memtest86 ]; then cp $IMGPATH/usr/lib/memtest86/memtest86 $MBD_BOOTTREE/memtest echo -e "label memtest86\n kernel memtest\n append -\n" >> $MBD_BOOTTREE/isolinux.cfg fi else echo "No isolinux binaries. Skipping isolinux creation" fi # clean up time -- being very explicit about what's linked if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;then echo "Cleaning up images" # links for the pxeboot bits rm -f $TOPDESTPATH/images/pxeboot/* ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/images/pxeboot/initrd.img # links for the autoboot bits rm -f $TOPDESTPATH/dosutils/autoboot/* mkdir -p $TOPDESTPATH/dosutils/autoboot/ ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/dosutils/autoboot/vmlinuz ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/dosutils/autoboot/initrd.img fi # now make a boot iso mkdir -p $TOPDESTPATH/images/isopath cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath mkisofs -o $TOPDESTPATH/images/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V "$PRODUCT" -T $TOPDESTPATH/images/isopath rm -rf $TOPDESTPATH/images/isopath cat > $TOPDESTPATH/images/pxeboot/README <