summaryrefslogtreecommitdiffstats
path: root/scripts/mk-images.alpha
blob: eff7457c659f33166b4889bcf7987643406c22e7 (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
80
SECSTAGE="raid0 raid1 raid5"

prepareBootImage() {
        dd if=/dev/zero of=$MBD_TMPIMAGE bs=1k count=$BOOTDISKSIZE 2>/dev/null
        echo y | /sbin/mke2fs -b 1024 -r 0 -O none $MBD_TMPIMAGE  > /dev/null 2>/dev/null
	LODEV=`findloopdevice $MBD_TMPIMAGE`
	e2writeboot $LODEV $BOOTDISKDIR/bootlx
	mount $LODEV -t ext2 $MBD_BOOTTREE
        mkdir -p $MBD_BOOTTREE/etc
	cat > $MBD_BOOTTREE/etc/aboot.conf <<EOF
0:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 root=/dev/fd0
EOF
        cat > $MBD_BOOTTREE/etc/milo.conf <<EOF
image=/vmlinux.gz
        label=linux
        root=/dev/fd0
        append="load_ramdisk=1 prompt_ramdisk=1"
EOF
	zcat $KERNELROOT/boot/vmlinuz-* | gzip -9 > $MBD_BOOTTREE/vmlinux.gz
	umount $LODEV
	losetup -d $LODEV
	mount -o loop -t ext2 $MBD_TMPIMAGE $MBD_BOOTTREE
}

NETMODULES="nfs 3c59x de4x5 depca eepro100 ibmtr old_tulip tulip ne"
SCSIMODULES="aic7xxx DAC960 ide-cd"

mkdir -p $TOPDESTPATH/boot
cp $BOOTDISKDIR/bootlx $TOPDESTPATH/boot

mkdir -p $TOPDESTPATH/etc
cat > $TOPDESTPATH/etc/aboot.cfg <<EOF
#
# Red Hat Linux/Alpha aboot configuration
#
# Options:
#
#   0 - boot into the Red Hat Linux installer
#   1 - boot into the Red Hat Linux installer using a 2.4 kernel
#   2 - boot into the Red Hat Linux installer using a Jensen kernel
#
0:/kernels/vmlinux.gz initrd=/images/ramdisk.img
1:/kernels/vmlinuz.24 initrd=/images/ramdisk.img
2:/kernels/vmlinuz.j initrd=/images/ramdisk.img
EOF

makeinitrd --initrdto $TOPDESTPATH/images/ramdisk.img \
	   --initrdsize 4096 \
	   --padsize 1440 \
	   --loaderbin loader \
	   --modules "$NETMODULES $SCSIMODULES vfat cramfs"

makebootdisk --bootdisksize 1440 --kernelto $TOPDESTPATH/kernels/vmlinux.gz \
	     --imagename generic.img

makemainmodules "$SECSTAGE $SCSIMODULES"
makeinstimage "netstg" "$SECSTAGE $SCSIMODULES"
makeinstimage "hdstg" "$SECSTAGE $NETMODULES"
makemainimage "stage2" "cramfs"

if [ -f $TOPDESTPATH/preview/RPMS/kernel-2.4.0-*.alpha.rpm ]; then
    K24_PKG=$TOPDESTPATH/preview/RPMS/kernel-2.4.0-*.alpha.rpm
    K24_DIR=/tmp/kernel24.dir.$$
    mkdir -p $K24_DIR
    rpm2cpio $K24_PKG | (cd $K24_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
    cp $K24_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.24
    rm -rf $K24_DIR
fi


if [ -f $KERNELPATH/kernel-jensen-*.rpm ]; then
    KJ_PKG=$KERNELPATH/kernel-jensen-*.rpm
    KJ_DIR=/tmp/kernelj.dir.$$
    mkdir -p $KJ_DIR
    rpm2cpio $KJ_PKG | (cd $KJ_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
    cp $KJ_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.j
    rm -rf $KJ_DIR
fi