SYSLINUX=$IMGPATH/usr/bin/syslinux if [ -z $SITE ] ; then LOCATIONAREA=`basename $DEFAULT` else LOCATIONAREA=`basename $SITE` fi echo "LOCATIONAREA is $LOCATIONAREA" echo "SITE is $SITE" echo "SITEDIR is $SITEDIR" 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 } if [ -z SITEDIR ] ; then mkdir -p $TOPDESTPATH/images/$LOCATIONAREA else mkdir -p $TOPDESTPATH/$SITEDIR/$SITE/images/ fi 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 if [ -z $SITE ] ; then cp $TOPDESTPATH/$DEFAULT/build/isolinux/* $MBD_BOOTTREE/ else cp $TOPDESTPATH/$SITEDIR/$SITE/build/isolinux/* $MBD_BOOTTREE/ fi else echo "No isolinux binaries. Skipping isolinux creation" fi # clean up time -- being very explicit about what's linked if [ -f $TOPDESTPATH/$ISOPATHAREA/isolinux/vmlinuz -a -f $TOPDESTPATH/$ISOPATHAREA/isolinux/initrd.img ] ;then echo "Cleaning up images" # links for the pxeboot bits rm -f $TOPDESTPATH/$PATHAREA/pxeboot/* ln $TOPDESTPATH/$ISOPATHAREA/isolinux/vmlinuz $TOPDESTPATH/$PATHAREA/pxeboot/vmlinuz ln $TOPDESTPATH/$ISOPATHAREA/isolinux/initrd.img $TOPDESTPATH/$PATHAREA/pxeboot/initrd.img # links for the autoboot bits rm -f $TOPDESTPATH/$ISOPATHAREA/dosutils/autoboot/* mkdir -p $TOPDESTPATH/$ISOPATHAREA/dosutils/autoboot/ ln $TOPDESTPATH/$ISOPATHAREA/isolinux/vmlinuz $TOPDESTPATH/$ISOPATHAREA/dosutils/autoboot/vmlinuz ln $TOPDESTPATH/$ISOPATHAREA/isolinux/initrd.img $TOPDESTPATH/$ISOPATHAREA/dosutils/autoboot/initrd.img fi # now make a boot iso mkdir -p $TOPDESTPATH/$PATHAREA/isopath cp -rl $TOPDESTPATH/$ISOPATHAREA/isolinux $TOPDESTPATH/$PATHAREA/isopath echo "making boot.iso in $TOPDESTPATH/$PATHAREA " mkisofs -o $TOPDESTPATH/$PATHAREA/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T $TOPDESTPATH/$PATHAREA/isopath rm -rf $TOPDESTPATH/$PATHAREA/isopath cat > $TOPDESTPATH/$PATHAREA/pxeboot/README <