1 SYSLINUX=$IMGPATH/usr/bin/syslinux-nomtools
3 if [ ! -f $SYSLINUX ]; then
4 echo "Warning: nomtools syslinux doesn't exist"
5 SYSLINUX=$IMGPATH/usr/bin/syslinux
6 if [ ! -f $SYSLINUX ]; then
7 echo "$SYSLINUX doesn't exist"
13 dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=/$MBD_TMPIMAGE 2>/dev/null
14 mkdosfs -r 32 -C $MBD_TMPIMAGE $BOOTDISKSIZE >/dev/null
15 $SYSLINUX $MBD_TMPIMAGE
16 mount -o loop -t msdos $MBD_TMPIMAGE $MBD_BOOTTREE
21 # prepare a directory with the kernel, initrd, and various message files
22 # used to populate a boot image
24 (cd $BOOTDISKDIR; find . ! -name "*.msg" -maxdepth 1 ! -type d | cpio --quiet -p $MBD_BOOTTREE)
26 cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img
27 cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz
29 pngtopnm $BOOTDISKDIR/syslinux-splash.png | ppmtolss16 \#000000=0 \#cdcfd5=7 \#c90000=2 \#ffffff=15 \#5b6c93=9 > $BOOTDISKDIR/splash.lss
31 echo $0: Failed to create splash.lss
34 cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss
35 rm -f $MBD_BOOTTREE/syslinux-splash.png
36 rm -f $MBD_BOOTTREE/memtest*
37 for file in $BOOTDISKDIR/*.msg; do
38 filename=`basename $file`
39 sed -e "s/@VERSION@/$VERSION/g" $file > $MBD_BOOTTREE/$filename
42 echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE.
44 rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE
49 mkdir -p $TOPDESTPATH/images
50 cat > $TOPDESTPATH/images/README <<EOF
51 This directory contains image files that can be used to create media
52 capable of starting the $PRODUCT installation process.
54 The boot.iso file is an ISO 9660 image of a bootable CD-ROM. It is useful
55 in cases where the CD-ROM installation method is not desired, but the
56 CD-ROM's boot speed would be an advantage.
58 To use this image file, burn the file onto CD-R (or CD-RW) media as you
61 The diskboot.img file is a VFAT filesystem image that can be written to a
62 USB pendrive or other bootable media larger than a floppy. Note that
63 booting via USB is dependent on your BIOS supporting this. It should
64 be written to the device using dd.
67 # LATEUSBMODS go in the second stage.
68 # FIXME: bleah, have to include sd_mod, sr_mod for usb-storage
69 USBMODS="usbcore ohci-hcd uhci-hcd hid usb-storage sd_mod sr_mod"
70 # usb-storage goes on both so we can reload it. *sigh*
71 LATEUSBMODS="usb-storage"
72 IDEMODS="cdrom ide-cd"
73 SCSIMODS="cdrom scsi_mod sd_mod sg sr_mod st"
75 FSMODS="fat msdos vfat ext3 reiserfs jfs xfs"
76 LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror"
77 RAIDMODS="md raid0 raid1 raid5 raid6"
78 SECSTAGE="agpgart $RAIDMODS $LVMMODS $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS st parport_pc parport"
80 BTERMMODULES="vga16fb vgastate"
81 COMMONMODULES="fat vfat nfs sunrpc lockd floppy cramfs loop edd $USBMODS $BTERMMODULES"
82 LOCALMODULES="$COMMONMODULES aic7xxx megaraid_mbox sym53c8xx $IDEMODS $SCSIMODS"
83 NETWORKMODULES="$COMMONMODULES 3c59x
85 # sis900 e100 hp100 natsemi pcnet32"
87 PCMCIAMAINMODULES="$COMMONMODULES nfs $IDEMODS $SCSIMODS"
89 # images we only want on the CD (usually for space reasons)
90 ISOLINUXMODULES="usbcore ehci-hcd ieee1394 ohci1394 sbp2"
93 PCMCIAMODULES_EXCLUDED="
106 PCMCIAMODULES_EXCLUDED_SED="sed"
107 for m in $PCMCIAMODULES_EXCLUDED
109 PCMCIAMODULES_EXCLUDED_SED="$PCMCIAMODULES_EXCLUDED_SED -e 's/$m//g'"
111 BOOTPCMCIAMODULES=`echo $PCMCIAMODULES | eval "$PCMCIAMODULES_EXCLUDED_SED"`
113 # need to make sure the base modules are included
114 BOOTPCMCIAMODULES="$BOOTPCMCIAMODULES yenta_socket i82365 tcic pcmcia_core pcmcia"
117 if [ "$KERNELARCH" = "i386" ]; then
118 echo "Building $KERNELARCH $TOPDESTPATH/images/pxeboot/initrd.img"
119 makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
123 --modules "$COMMONMODULES"
125 echo "Building $KERNELARCH bootdisk.img"
126 makebootdisk --kernelto $TOPDESTPATH/images/pxeboot/vmlinuz \
127 --bootdisksize 1440 \
128 --imagename $BOOTDIR/bootdisk.img \
129 --initrd $TOPDESTPATH/images/pxeboot/initrd.img
132 rm -f $TOPDESTPATH/images/pxeboot/initrd.img
136 # FIXME: this is so that we can switch back and forth. if we want both
137 # on the CD, then more needs to be done, esp for things like isolinux.cfg
138 # Right now, last one wins
139 if [ "$KERNELARCH" = "i686" -o "$KERNELARCH" = "i586" -o "$KERNELARCH" = "athlon" ]; then
140 echo "Building $KERNELARCH initrd-everything.img"
141 makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \
145 --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $BOOTPCMCIAMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net"
148 if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
149 echo "Building isolinux directory"
150 MBD_BOOTTREE=$TOPDESTPATH/isolinux
151 MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd-everything.img
152 mkdir $MBD_BOOTTREE 2>/dev/null
153 cp $IMGPATH/usr/lib/syslinux/isolinux.bin $MBD_BOOTTREE/isolinux.bin
157 # isolinux needs the config file to be isolinux.cfg
158 mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg
160 # copy in memtest if present
161 if [ -f $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* ]; then
162 cp $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* $MBD_BOOTTREE/memtest
163 echo -e "label memtest86\n kernel memtest\n append -\n" >> $MBD_BOOTTREE/isolinux.cfg
167 echo "No isolinux binaries. Skipping isolinux creation"
170 # clean up time -- being very explicit about what's linked
171 if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;then
172 echo "Cleaning up images"
173 # links for the pxeboot bits
174 rm -f $TOPDESTPATH/images/pxeboot/*
175 ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz
176 ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/images/pxeboot/initrd.img
178 # links for the autoboot bits
179 if [ -f $TOPDESTPATH/dosutils/loadlin.exe ]; then
180 rm -f $TOPDESTPATH/dosutils/autoboot/*
181 mkdir -p $TOPDESTPATH/dosutils/autoboot/
182 ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/dosutils/autoboot/vmlinuz
183 ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/dosutils/autoboot/initrd.img
187 # now make a boot iso
188 mkdir -p $TOPDESTPATH/images/isopath
189 cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath
190 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
191 rm -rf $TOPDESTPATH/images/isopath
193 # now make a boot pendrive image
194 mkdir -p $TOPDESTPATH/images/fobpath
195 dd if=/dev/zero of=$TOPDESTPATH/images/diskboot.img bs=1M count=8 2>/dev/null
196 mkdosfs $TOPDESTPATH/images/diskboot.img
197 $SYSLINUX $TOPDESTPATH/images/diskboot.img
198 mount -o loop $TOPDESTPATH/images/diskboot.img $TOPDESTPATH/images/fobpath
199 cp -r $TOPDESTPATH/isolinux/* $TOPDESTPATH/images/fobpath/
200 grep -v local $TOPDESTPATH/images/fobpath/isolinux.cfg > $TOPDESTPATH/images/fobpath/syslinux.cfg
201 rm -f $TOPDESTPATH/images/fobpath/isolinux.cfg
202 umount -f $TOPDESTPATH/images/fobpath
203 rmdir $TOPDESTPATH/images/fobpath
205 cat > $TOPDESTPATH/images/pxeboot/README <<EOF
206 The files in this directory are useful for booting a machine via PXE.
208 The following files are available:
209 vmlinuz - the BOOT kernel used for the installer
210 initrd.img - an initrd with support for all install methods and
211 drivers supported for installation of $PRODUCT
217 echo "Building main moduleball"
218 makemainmodules "=scsi =net $SECSTAGE"
221 echo "Building netstg.img"
222 makeinstimage "netstg" "=scsi $SECSTAGE"
224 echo "Building hdstg.img"
225 makeinstimage "hdstg" "=net $SECSTAGE"
227 echo "Building stage2.img"
228 makemainimage "stage2" "cramfs"