SYSLINUX=$IMGPATH/usr/lib/syslinux/syslinux-nomtools if [ ! -f $SYSLINUX ]; then echo "Warning: nomtools syslinux doesn't exist" SYSLINUX=$IMGPATH/usr/bin/syslinux if [ ! -f $SYSLINUX ]; then echo "$SYSLINUX doesn't exist" exit 1 fi fi # prepare a directory with the kernel, initrd, and various message files # used to populate a boot image prepareBootTree() { (cd $BOOTDISKDIR; find . -maxdepth 1 ! -name "*.msg" ! -type d | cpio --quiet -p $MBD_BOOTTREE) cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz if [ -n "$NEEDGR" ]; then $IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh $BOOTDISKDIR/syslinux-splash.png $BOOTDISKDIR/splash.lss if [ $? != 0 ]; then echo $0: Failed to create splash.lss exit 1 fi cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss rm -f $MBD_BOOTTREE/syslinux-splash.png fi rm -f $MBD_BOOTTREE/memtest* 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 } mkdir -p $TOPDESTPATH/images/pxeboot cat > $TOPDESTPATH/images/README <> $MBD_BOOTTREE/isolinux.cfg fi else echo "No isolinux binaries. Skipping isolinux creation" fi # symlink the kernel for pxe dir ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz # now make a boot iso mkdir -p $TOPDESTPATH/images/isopath cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath mkisofs -quiet -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 # now make a boot pendrive image mkdir -p $TOPDESTPATH/images/fobpath dd if=/dev/zero of=$TOPDESTPATH/images/diskboot.img bs=1M count=12 2>/dev/null mkdosfs $TOPDESTPATH/images/diskboot.img $SYSLINUX $TOPDESTPATH/images/diskboot.img mount -o loop $TOPDESTPATH/images/diskboot.img $TOPDESTPATH/images/fobpath [ $? = 0 ] || exit 1 cp -r $TOPDESTPATH/isolinux/* $TOPDESTPATH/images/fobpath/ grep -v local $TOPDESTPATH/images/fobpath/isolinux.cfg > $TOPDESTPATH/images/fobpath/syslinux.cfg rm -f $TOPDESTPATH/images/fobpath/isolinux.cfg umount -f $TOPDESTPATH/images/fobpath rmdir $TOPDESTPATH/images/fobpath cat > $TOPDESTPATH/images/pxeboot/README <> $TOPDESTPATH/.treeinfo [images-$BASEARCH] kernel = images/pxeboot/vmlinuz initrd = images/pxeboot/initrd.img boot.iso = images/boot.iso diskboot.img = images/diskboot.img __EOT__ else # set up the boot stuff for the xen guest kernel echo "Building $KERNELARCH guest initrd.img" mkdir -p $TOPDESTPATH/images/xen makeinitrd --initrdto $TOPDESTPATH/images/xen/initrd.img \ --initrdsize 8192 \ --loaderbin loader \ --modules "$INITRDMODS" [ $? = 0 ] || exit 1 cp $KERNELROOT/boot/vmlinuz-*xen* $TOPDESTPATH/images/xen/vmlinuz cat << __EOT__ >> $TOPDESTPATH/.treeinfo [images-xen] kernel = images/xen/vmlinuz initrd = images/xen/initrd.img __EOT__ fi }