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 echo "BOOTDISKDIR is $$BOOTDISKDIR" # ls $BOOTDISKDIR/syslinux-splash.png # pngtopnm $BOOTDISKDIR/syslinux-splash.png | ppmtolss16 \#000000=0 \#cdcfd5=7 \#c90000=2 \#ffffff=15 \#5b6c93=9 > $BOOTDISKDIR/splash.lss cp /mnt/src/90rolling/i386/misc/src/anaconda-9.0/scripts/fermiscripts/splash.lss $BOOTDISKDIR/ cp /mnt/src/90rolling/i386/misc/src/anaconda-9.0/scripts/fermiscripts/syslinux.cfg $MBD_BOOTTREE/ rm -f $MBD_BOOTTREE/syslinux-splash.png cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss if [ -d $BOOTDISKDIR/$BOOTLANG ]; then # fb console and kon don't get along... if [ "$BOOTLANG" = "ja_JP" ]; then sed -e "s/ vga=[0-9]*//g" < $MBD_BOOTTREE/syslinux.cfg > $MBD_BOOTTREE/syslinux.cf2 mv -f $MBD_BOOTTREE/syslinux.cf2 $MBD_BOOTTREE/syslinux.cfg fi 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 <<EOF The files in this directory are raw disk images. Some are boot disks for booting the Red Hat Linux installation program. Others are driver disks to support loading the installation program from less common hardware. Follow the instructions in the Red Hat Linux Installation Guide, Chapter 1, section "Making Installation Diskettes" to create the disks. The drivers.img driver disk image has been split into several disks because of the increasing size of the supported modules. The following boot image: bootdisk.img - primary boot image for all install methods is to be used for all install methods. A secondary driver disk will be required for most install types other than IDE CDROM and HD based installs. The following driver disks are available: EOF # LATEUSBMODS go in the second stage. # FIXME: bleah, have to include sd_mod, sr_mod for usb-storage USBMODS="usb-ohci usb-uhci hid keybdev usb-storage sd_mod sr_mod" # usb-storage goes on both so we can reload it. *sigh* LATEUSBMODS="mousedev usb-storage" IDEMODS="" SCSIMODS="sd_mod sr_mod st" FSMODS="msdos vfat ext3 reiserfs jfs" SECSTAGE="agpgart raid0 raid1 raid5 lvm-mod $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS st parport_pc parport" BTERMMODULES="vga16fb" COMMONMODULES="vfat nfs $USBMODS $BTERMMODULES" LOCALMODULES="$COMMONMODULES aic7xxx megaraid ncr53c8xx sym53c8xx $IDEMODS $SCSIMODS" NETWORKMODULES="$COMMONMODULES 3c59x e100 tulip 8139too" # sis900 e100 hp100 natsemi pcnet32" PCMCIAMAINMODULES="$COMMONMODULES nfs $IDEMODS $SCSIMODS" # images we only want on the CD (usually for space reasons) ISOLINUXMODULES="ehci-hcd ieee1394 ohci1394 sbp2" # XXX hack hack PCMCIAMODULES_EXCLUDED=" apa1480_cb airo airo_cs aironet4500_core aironet4500_proc hermes iflash2+_mtd iflash2_mtd memory_cb memory_cs parport_cs parport_pc parport serial_cs serial_cb sram_mtd aironet4500_cs orinoco_cs orinoco orinoco_old_cs wavelan wavelan_cs wvlan_cs " PCMCIAMODULES_EXCLUDED_SED="sed" for m in $PCMCIAMODULES_EXCLUDED do PCMCIAMODULES_EXCLUDED_SED="$PCMCIAMODULES_EXCLUDED_SED -e 's/$m//g'" done PCMCIAMODULES=`echo $PCMCIAMODULES | eval "$PCMCIAMODULES_EXCLUDED_SED"` # need to make sure the base modules are included PCMCIAMODULES="$PCMCIAMODULES yenta_socket i82365 tcic pcmcia_core ds" echo "Building $TOPDESTPATH/images/pxeboot/initrd.img" makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \ --pcmcia \ --initrdsize 4750 \ --loaderbin loader \ --modules "$COMMONMODULES" echo "Building initrd-everything.img" makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \ --pcmcia \ --initrdsize 7000 \ --loaderbin loader \ --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net" [ $? = 0 ] || exit 1 echo "Building bootdisk.img" makebootdisk --kernelto $TOPDESTPATH/images/pxeboot/vmlinuz \ --bootdisksize 1440 \ --imagename $BOOTDIR/bootdisk.img \ --initrd $TOPDESTPATH/images/pxeboot/initrd.img [ $? = 0 ] || exit 1 rm -f $TOPDESTPATH/images/pxeboot/initrd.img echo "Building drvblock.img" makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "=scsi" # JKFIXME: was exit 1 [ $? = 0 ] || echo "ERROR: failed to write drvblock" echo "Building drvnet.img" makedriverdisk --padsize 1440 "Supplemental Network Drivers" "drvnet" "=net" [ $? = 0 ] || echo "ERROR: failed to write drvnet" echo "Building pcmciadd.img" makedriverdisk --padsize 1440 "PCMCIA Driver Diskette" "pcmciadd" "$PCMCIAMODULES" [ $? = 0 ] || echo "ERROR: failed to write pcmciadd" if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then echo "Building isolinux directory" MBD_BOOTTREE=$TOPDESTPATH/isolinux MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd-everything.img mkdir $MBD_BOOTTREE 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 echo "now copying isolinux.cfg in" cp /mnt/src/90rolling/i386/misc/src/anaconda-9.0/scripts/fermiscripts/isolinux.cfg $MBD_BOOTTREE/ cat $MBD_BOOTTREE/isolinux.cfg else echo "No isolinux binaries. Skipping isolinux creation" fi echo "Building main moduleball" makemainmodules "=scsi =net $SECSTAGE" [ $? = 0 ] || exit 1 echo "Building netstg.img" makeinstimage "netstg" "=scsi $SECSTAGE" [ $? = 0 ] || exit 1 echo "Building hdstg.img" makeinstimage "hdstg" "=net $SECSTAGE" [ $? = 0 ] || exit 1 echo "Building stage2.img" makemainimage "stage2" "cramfs" [ $? = 0 ] || exit 1 # 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 -T $TOPDESTPATH/images/isopath rm -rf $TOPDESTPATH/images/isopath cat > $TOPDESTPATH/images/pxeboot/README <<EOF The files in this directory are useful for booting a machine via PXE. The following files are available: vmlinuz - the BOOT kernel used for the installer initrd.img - an initrd with support for all install methods and drivers supported for installation of Red Hat Linux EOF