summaryrefslogtreecommitdiffstats
path: root/scripts/mk-images.alpha
blob: 7adc5f8fb1395d93a3317d1ffa14855bc3c4ec10 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
NETMODULES="nfs de4x5 tulip depca eepro100 acenic tg3"
SCSIMODULES="sd_mod isp_mod ide-cd aic7xxx"
EXTRASCSI="DAC960 cpqfc BusLogic 3w-xxxx dmx3191d dpt_i2o megaraid ncr53c8xx sym53c8xx qlogicisp qlogicfc qla2x00 qla1280 cciss cpqarray"
EXTRANET="3c509 3c59x 8139too dl2k eepro epic100 ewrk3 hamachi natsemi ne2k-pci ns83820 starfire yellowfin"

SECSTAGE="sd_mod md raid0 raid1 raid5 ext3 $NETMODULES $SCSIMODULES $EXTRASCSI $EXTRANET"

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
#
# Red Hat Linux/Alpha aboot configuration options:
#
#   0 - Boot the Red Hat Linux installer using a 2.4 kernel
#   1 - Boot the Red Hat Linux installer in non graphical mode
#   2 - Boot the Red Hat Linux installer in text only mode on ttyS0
#       for installation control via the serial port
#   3 - Boot in rescue mode
#
0:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0          root=/dev/fd0
1:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0  text    root=/dev/fd0
2:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=ttyS0 text    root=/dev/fd0
3:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0  rescue  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
}

makeBootImages() {
    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 the Red Hat Linux installer using a 2.4 kernel
#   1 - Boot the Red Hat Linux installer with kernel messages sent to ttyS0
#   2 - Boot the Red Hat Linux installer in text only mode
#   3 - Boot the Red Hat Linux installer in text only rescue mode
#
0:/kernels/vmlinux.gz initrd=/images/cdrom.img
1:/kernels/vmlinux.gz initrd=/images/cdrom.img console=ttyS0
2:/kernels/vmlinux.gz initrd=/images/cdrom.img text
3:/kernels/vmlinux.gz initrd=/images/cdrom.img rescue

EOF

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

    makeinitrd --initrdto $TOPDESTPATH/images/cdrom.img \
	--initrdsize 8192 \
	--loaderbin loader \
	--modules "$NETMODULES $SCSIMODULES $EXTRASCSI $EXTRANET"

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


    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

    makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "$SCSIMODULES $EXTRASCSI +scsi"
    makedriverdisk --padsize 1440 "Supplemental Network Device Drivers" "drvnet" "$NETMODULES $EXTRANET  +net"
}

makeSecondStage() {
    makemainmodules "$SECSTAGE"
    makeinstimage "netstg" "$SECSTAGE"
    makeinstimage "hdstg" "$SECSTAGE"
    makemainimage "stage2" "cramfs "
}