]>
Commit | Line | Data |
---|---|---|
fe377184 | 1 | SYSLINUX=$IMGPATH/usr/lib/syslinux/syslinux-nomtools |
bd688d0c PZ |
2 | |
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" | |
8 | exit 1 | |
9 | fi | |
10 | fi | |
11 | ||
12 | prepareBootImage() { | |
13 | dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=/$MBD_TMPIMAGE 2>/dev/null | |
fe377184 | 14 | mkdosfs -r 16 -C $MBD_TMPIMAGE $BOOTDISKSIZE >/dev/null |
bd688d0c PZ |
15 | $SYSLINUX $MBD_TMPIMAGE |
16 | mount -o loop -t msdos $MBD_TMPIMAGE $MBD_BOOTTREE | |
17 | ||
18 | prepareBootTree | |
19 | } | |
20 | ||
21 | # prepare a directory with the kernel, initrd, and various message files | |
22 | # used to populate a boot image | |
23 | prepareBootTree() { | |
24 | (cd $BOOTDISKDIR; find . ! -name "*.msg" -maxdepth 1 ! -type d | cpio --quiet -p $MBD_BOOTTREE) | |
25 | ||
26 | cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img | |
27 | cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz | |
28 | ||
fe377184 | 29 | $IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh $BOOTDISKDIR/syslinux-splash.png $BOOTDISKDIR/splash.lss |
bd688d0c PZ |
30 | if [ $? != 0 ]; then |
31 | echo $0: Failed to create splash.lss | |
32 | exit 1 | |
33 | fi | |
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 | |
40 | done | |
41 | if [ $? != 0 ]; then | |
42 | echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE. | |
43 | umount $MBD_BOOTTREE | |
44 | rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE | |
45 | exit 1 | |
46 | fi | |
47 | } | |
48 | ||
fe377184 | 49 | mkdir -p $TOPDESTPATH/images/pxeboot |
bd688d0c PZ |
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. | |
53 | ||
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. | |
57 | ||
58 | To use this image file, burn the file onto CD-R (or CD-RW) media as you | |
59 | normally would. | |
60 | ||
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. | |
65 | EOF | |
66 | ||
bd688d0c | 67 | makeBootImages() { |
fe377184 ER |
68 | if [ "$kerneltag" != "xenU" ]; then |
69 | echo "Building $KERNELARCH initrd.img" | |
bd688d0c | 70 | makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \ |
fe377184 | 71 | --initrdsize 7000 \ |
bd688d0c | 72 | --loaderbin loader \ |
fe377184 | 73 | --modules "$INITRDMODS" |
bd688d0c PZ |
74 | [ $? = 0 ] || exit 1 |
75 | ||
76 | if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then | |
77 | echo "Building isolinux directory" | |
78 | MBD_BOOTTREE=$TOPDESTPATH/isolinux | |
fe377184 | 79 | MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd.img |
bd688d0c PZ |
80 | mkdir $MBD_BOOTTREE 2>/dev/null |
81 | cp $IMGPATH/usr/lib/syslinux/isolinux.bin $MBD_BOOTTREE/isolinux.bin | |
82 | ||
83 | prepareBootTree | |
84 | ||
85 | # isolinux needs the config file to be isolinux.cfg | |
86 | mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg | |
87 | ||
88 | # copy in memtest if present | |
89 | if [ -f $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* ]; then | |
90 | cp $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* $MBD_BOOTTREE/memtest | |
91 | echo -e "label memtest86\n kernel memtest\n append -\n" >> $MBD_BOOTTREE/isolinux.cfg | |
92 | fi | |
bd688d0c PZ |
93 | else |
94 | echo "No isolinux binaries. Skipping isolinux creation" | |
95 | fi | |
96 | ||
97 | # clean up time -- being very explicit about what's linked | |
98 | if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;then | |
99 | echo "Cleaning up images" | |
100 | # links for the pxeboot bits | |
101 | rm -f $TOPDESTPATH/images/pxeboot/* | |
102 | ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz | |
103 | ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/images/pxeboot/initrd.img | |
104 | ||
105 | # links for the autoboot bits | |
106 | if [ -f $TOPDESTPATH/dosutils/loadlin.exe ]; then | |
107 | rm -f $TOPDESTPATH/dosutils/autoboot/* | |
108 | mkdir -p $TOPDESTPATH/dosutils/autoboot/ | |
109 | ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/dosutils/autoboot/vmlinuz | |
110 | ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/dosutils/autoboot/initrd.img | |
111 | fi | |
112 | fi | |
113 | ||
114 | # now make a boot iso | |
115 | mkdir -p $TOPDESTPATH/images/isopath | |
116 | cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath | |
117 | 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 | |
118 | rm -rf $TOPDESTPATH/images/isopath | |
119 | ||
120 | # now make a boot pendrive image | |
121 | mkdir -p $TOPDESTPATH/images/fobpath | |
122 | dd if=/dev/zero of=$TOPDESTPATH/images/diskboot.img bs=1M count=8 2>/dev/null | |
123 | mkdosfs $TOPDESTPATH/images/diskboot.img | |
124 | $SYSLINUX $TOPDESTPATH/images/diskboot.img | |
125 | mount -o loop $TOPDESTPATH/images/diskboot.img $TOPDESTPATH/images/fobpath | |
126 | cp -r $TOPDESTPATH/isolinux/* $TOPDESTPATH/images/fobpath/ | |
127 | grep -v local $TOPDESTPATH/images/fobpath/isolinux.cfg > $TOPDESTPATH/images/fobpath/syslinux.cfg | |
128 | rm -f $TOPDESTPATH/images/fobpath/isolinux.cfg | |
129 | umount -f $TOPDESTPATH/images/fobpath | |
130 | rmdir $TOPDESTPATH/images/fobpath | |
131 | ||
132 | cat > $TOPDESTPATH/images/pxeboot/README <<EOF | |
133 | The files in this directory are useful for booting a machine via PXE. | |
134 | ||
135 | The following files are available: | |
136 | vmlinuz - the BOOT kernel used for the installer | |
137 | initrd.img - an initrd with support for all install methods and | |
138 | drivers supported for installation of $PRODUCT | |
139 | EOF | |
bd688d0c | 140 | |
fe377184 ER |
141 | else # set up the boot stuff for the xen guest kernel |
142 | echo "Building $KERNELARCH guest initrd.img" | |
143 | mkdir -p $TOPDESTPATH/images/xen | |
144 | makeinitrd --initrdto $TOPDESTPATH/images/xen/initrd.img \ | |
145 | --initrdsize 7000 \ | |
146 | --loaderbin loader \ | |
147 | --modules "$INITRDMODS" | |
bd688d0c | 148 | [ $? = 0 ] || exit 1 |
fe377184 ER |
149 | cp $KERNELROOT/boot/vmlinuz-*xenU $TOPDESTPATH/images/xen/vmlinuz |
150 | fi | |
bd688d0c | 151 | } |