summaryrefslogtreecommitdiffstats
path: root/scripts/mk-images.i386
blob: c0e9253f476f006cef92aedf97aea51c50960b65 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
SYSLINUX=$IMGPATH/usr/bin/syslinux

if [ ! -f $SYSLINUX ]; then
    echo "$SYSLINUX doesn't exist"
    exit 1
fi

prepareBootImage() {
        dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=/$MBD_TMPIMAGE 2>/dev/null
	gunzip < $BOOTDISKDIR/template.img.gz |
	    dd of=$MBD_TMPIMAGE conv=notrunc > /dev/null 2> /dev/null
	$SYSLINUX $MBD_TMPIMAGE
	mount -o loop -t msdos $MBD_TMPIMAGE $MBD_BOOTTREE

	(cd $BOOTDISKDIR; find . ! -name "*.msg" -maxdepth 1 ! -type d | cpio --quiet -p $MBD_BOOTTREE)
	
	cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img
	cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz
	if [ -d $BOOTDISKDIR/$BOOTLANG ]; then
	    cp $BOOTDISKDIR/$BOOTLANG/*.msg $MBD_BOOTTREE
	    if [ $? != 0 ]; then
		echo $0: Failed to copy messages from $BOOTDISKDIR/$BOOTLANG to $MBD_BOOTTREE.
		umount $MBD_BOOTTREE
		rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE
		exit 1
	    fi
	else
	    cp $BOOTDISKDIR/*.msg $MBD_BOOTTREE
	    if [ $? != 0 ]; then
		echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE.
		umount $MBD_BOOTTREE
		rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE
		exit 1
	    fi
	fi
}

# LATEUSBMODS go in the second stage
USBMODS="usb-ohci usb-uhci hid keybdev"
LATEUSBMODS="mousedev"

SECSTAGE="vfat raid0 raid1 raid5 $LATEUSBMODS"

COMMONMODULES="vfat $USBMODS agpgart"
LOCALMODULES="$COMMONMODULES AM53C974 BusLogic DAC960 aacraid advansys 
             aic7xxx cpqarray gdth ips initio megaraid ncr53c8xx 
	     qlogicisp"
NETWORKMODULES="$COMMONMODULES 3c509 3c59x 3c90x 8390 ac3200 at1700 de4x5
	       de600 de620 depca dgrs eepro100 eepro hp-plus hp hp100
	       ne ne2k-pci ni52 old_tulip pcnet32 rtl8139 tlan tulip
	       via-rhine 
               nfs vfat"

makeinitrd --initrdto $TOPDESTPATH/dosutils/autoboot/initrd.img \
	   --initrdsize 2100 \
	   --loaderbin loader-local \
	   --modules "$LOCALMODULES"

makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
	   --initrdsize 2100 \
	   --loaderbin loader-network \
	   --modules "$NETWORKMODULES"

# XXX hack hack
PCMCIAMODULES_EXCLUDED="
	apa1480_cb
	iflash2+_mtd
	iflash2_mtd
	memory_cb
	memory_cs
	parport_cs
	parport_pc
	parport
	serial_cs
	serial_cb
	sram_mtd
"
PCMCIAMODULES_EXCLUDED_SED="sed"
for m in $PCMCIAMODULES_EXCLUDED
do
   PCMCIAMODULES_EXCLUDED_SED="$PCMCIAMODULES_EXCLUDED_SED -e 's/$m//g'"
done
PCMCIAMODULES=`echo $PCMCIAMODULES | eval "$PCMCIAMODULES_EXCLUDED_SED"`

makeinitrd --initrdto $TOPDESTPATH/images/initrd-pcmcia.img \
	   --pcmcia \
	   --initrdsize 2100 \
	   --loaderbin loader-pcmcia \
	   --modules "$PCMCIAMODULES nfs vfat"

for I in `find $BOOTDISKDIR -type d`; do
    BOOTLANG=`basename $I`
    BOOTDIR=`basename $I | cut -d'_' -f1`

    if [ $BOOTLANG = "boot" ]; then
	BOOTLANG=""
	BOOTDIR=""
    elif [ $BOOTLANG = "ja_JP" ]; then
	# this is handled below.
	continue
    fi

    makebootdisk --kernelto $TOPDESTPATH/dosutils/autoboot/vmlinuz  \
		 --bootdisksize 1440 \
		 --imagename $BOOTDIR/boot.img \
		 --initrd $TOPDESTPATH/dosutils/autoboot/initrd.img

    makebootdisk --kernelto $TOPDESTPATH/images/pxeboot/vmlinuz  \
		 --bootdisksize 1440 \
		 --imagename $BOOTDIR/bootnet.img \
		 --initrd $TOPDESTPATH/images/pxeboot/initrd.img

    makebootdisk --imagename $BOOTDIR/pcmcia.img \
	         --bootdisksize 1440 \
		 --initrd $TOPDESTPATH/images/initrd-pcmcia.img
done

rm -f $TOPDESTPATH/images/initrd-pcmcia.img

# --- Japanese -- disabled for now.
#  BOOTLANG="ja_JP"
#  BOOTDIR="ja"

#  # hack hack hack - we are *out* of space
#  NETWORKMODULES="$COMMONMODULES 3c509 3c59x 3c90x 8390 ac3200 at1700 de4x5
#  	       de600 de620 depca e1000 eepro100 hp-plus hp hp100
#  	       ne ne2k-pci ni52 old_tulip pcnet32 rtl8139 tlan tulip
#  	       via-rhine 
#                 nfs vfat"

#  makebootdisk --bootdisksize 1440 \
#  	     --imagename ja/boot.img \
#  	     --initrdflags '--japanese
#  			    --initrdsize 2100 \
#  			    --loaderbin loader-local-kon \
#  			    --modules "$LOCALMODULES"'

#  makebootdisk --bootdisksize 1440 \
#  	     --imagename ja/bootnet.img \
#  	     --initrdflags '--japanese
#  			    --initrdsize 2100 \
#  			    --loaderbin loader-network-kon \
#  		 	    --modules "$NETWORKMODULES"'

#  makebootdisk --imagename ja/pcmcia.img \
#  	     --bootdisksize 1440 \
#  	     --initrdflags '--japanese
#  			    --pcmcia \
#  		     	    --initrdsize 2100 \
#  			    --loaderbin loader-pcmcia-kon \
#  			    --modules "$PCMCIAMODULES nfs vfat"'

makedriverdisk "Supplemental Drivers" "drivers" "+scsi +net +cdrom"

makedriverdisk "Parallel port IDE Drivers" "paride" "parport_pc parport pcd paride aten bpck comm dstr epat fit2 fit3 friq frpw kbic ktti on20 on26 epia ppa imm"

makemainmodules "=scsi =net $SECSTAGE"

makeinstimage --size1 3200 --size2 3160 "netstg" "=scsi $SECSTAGE"
makeinstimage --size1 3000 --size2 3160 "hdstg" "=net $SECSTAGE"
makemainimage "stage2"