blob: f962ec88934a91dfeec7ef7f97165b79b740f229 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# LATEUSBMODS go in the second stage
# FIXME: bleah, have to include sd_mod for usb-storage
USBMODS="uhci-hcd ohci-hcd ehci-hcd hid keybdev usb-storage sd_mod"
LATEUSBMODS="mousedev"
BTERMMODULES="vga16fb"
COMMONMODULES="nfs fat vfat cramfs loop floppy $BTERMMODULES"
FSMODS="msdos vfat ext3 reiserfs jfs xfs"
LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror"
RAIDMODS="md raid0 raid1 raid5 raid6"
SECSTAGE="nfs fat vfat $RAIDMODS $LVMMODS $FSMODS $LATEUSBMODS"
NETMODULES="3c59x acenic bcm5700 e100 e1000 eepro100 hamachi sk98lin starfire sunhme tulip yellowfin tg3"
SCSIMODULES="sd_mod sg sr_mod st scsi_mod DAC960 cciss cpqarray aic7xxx aic7xxx_mod megaraid_mbox qla1280 qla2200 qla2300 sym53c8xx mptscsih mptbase ips"
IDEMODULES="ide-mod ide-probe-mod ide-disk ide-cd sgiioc4"
prepareBootImage() {
dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=$MBD_TMPIMAGE 2>/dev/null
mkdosfs -C $MBD_TMPIMAGE $BOOTDISKSIZE >/dev/null
mount -o loop -t vfat $MBD_TMPIMAGE $MBD_BOOTTREE
mkdir -p $MBD_BOOTTREE/EFI/boot
cp $MBD_FSIMAGE $MBD_BOOTTREE/EFI/boot/initrd.img
cp -a $BOOTDISKDIR/* $MBD_BOOTTREE/EFI/boot/
cp $KERNELROOT/boot/efi/EFI/redhat/vmlinuz-* $MBD_BOOTTREE/EFI/boot/vmlinuz
cp $MBD_BOOTTREE/EFI/boot/elilo.efi $MBD_BOOTTREE/EFI/boot/bootia64.efi
cat > $MBD_BOOTTREE/EFI/boot/elilo.conf << EOF
prompt
timeout=50
relocatable
image=vmlinuz
label=linux
read-only
initrd=initrd.img
EOF
# make a copy in the root of the image
cp $MBD_BOOTTREE/EFI/boot/* $MBD_BOOTTREE/
}
makeBootImages() {
makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \
--imagename boot.img \
--bootdisksize 20480 \
--initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \
--initrdsize 12288 \
--loaderbin loader \
--modules "$COMMONMODULES $USBMODS $NETMODULES $SCSIMODULES $IDEMODULES =scsi =net"'
# now make a boot iso
mkdir -p $TOPDESTPATH/images/isopath
cp -l $TOPDESTPATH/images/boot.img $TOPDESTPATH/images/isopath
mkisofs -quiet -o $TOPDESTPATH/images/boot.iso -b boot.img -no-emul-boot -R -J -V "$PRODUCT" -T $TOPDESTPATH/images/isopath
rm -rf $TOPDESTPATH/images/isopath
# now make a pxe dir with kernel + initrd
mkdir -p $TOPDESTPATH/images/pxeboot
ln $TOPDESTPATH/images/ramdisk.img $TOPDESTPATH/images/pxeboot/initrd.img
ln $TOPDESTPATH/kernels/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz
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 kernel used for the installer
initrd.img - an initrd with support for all install methods and
drivers supported for installation of $PRODUCT
EOF
# clean up
rm -f $TOPDESTPATH/images/ramdisk.img
rm -rf $TOPDESTPATH/kernels
}
makeSecondStage() {
makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODULES =scsi"
makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODULES =net"
makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODULES =scsi =net"
makemainimage "stage2" "cramfs"
}
|