20-e2k-boot 1.64 KB
Newer Older
1 2 3 4 5 6
#!/bin/sh

echo "** 20-e2k-boot START"

cd "$WORKDIR"

7 8 9 10
# Rename kernel image, unable to boot kernel from CD/DVD
# if its name does not contain "." (mcst#6856).
mv boot/image{,.0}

11 12 13 14 15 16 17 18 19 20 21 22 23 24
# slightly different logic as there's no boot *menu*:
# ensure the user can install this if possible
[ -f live    ] && default=live
[ -f rescue  ] && default=rescue
[ -f altinst ] && default=install

cat > boot.conf << EOF
# USB Flash note: write the contents including .disk/ onto
# an ext2 formatted drive with "altinst" filesystem label

default=$default
timeout=3
EOF

25 26 27 28 29 30 31 32
for i in live altinst liveinst rescue; do
	if [ "$i" = liveinst ]; then
		[ -f live ] || continue
		[ ! -f altinst ] || continue
		[ -f Metadata/pkg-groups.tar ] || continue
	else
		[ -f "$i" ] || continue
	fi
33

34 35
	case "$i" in
	altinst)
36 37
		label=install
		stage2=
38 39 40 41 42 43 44
	;;
	liveinst)
		label=install
		stage2="stagename=live"
		init="init=/usr/sbin/install2-init"
	;;
	*)
45 46
		label="$i"
		stage2="stagename=$i"
47 48
	;;
	esac
49 50 51 52 53

	cat >> boot.conf << EOF

label=$label
    partition=0
54
    image=/boot/image.0
55
    cmdline=console=ttyS0,115200 console=tty0 hardreset fastboot live automatic=method:cdrom ${stage2:+$stage2 }${init:+$init }${GLOBAL_STAGE2_BOOTARGS:+$GLOBAL_STAGE2_BOOTARGS }${GLOBAL_BOOT_LANG:+lang=$GLOBAL_BOOT_LANG}
56
    initrd=/boot/initrd.img
57 58 59

label=${label}_flash
    partition=0
60
    image=/boot/image.0
61
    cmdline=console=ttyS0,115200 console=tty0 hardreset fastboot live lowmem automatic=method:disk,label:altinst,directory:/ ${stage2:+$stage2 }${init:+$init }${GLOBAL_STAGE2_BOOTARGS:+$GLOBAL_STAGE2_BOOTARGS }${GLOBAL_BOOT_LANG:+lang=$GLOBAL_BOOT_LANG}
62
    initrd=/boot/initrd.img
63 64 65 66 67 68
EOF
done

ls -lh

echo "** 20-e2k-boot END"