summaryrefslogtreecommitdiffstats
path: root/scripts/mk-images.sparc64
blob: af993e12e0c787f2719a5ec30e59cd380d59e3fd (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
SECSTAGE="vfat raid0 raid1 raid5"
TILO=$IMGPATH/usr/bin/tilo
SILO=$IMGPATH/usr/sbin/silo
FAKEARCH=sparc64

# EVIL HACK HACK
cat $MODINFO | sed 's|ncr53c8xx|sym53c8xx|g' > $MODINFO-
mv -f $MODINFO- $MODINFO

cat $PCITABLE | sed 's|ncr53c8xx|sym53c8xx|g' > $PCITABLE-
mv -f $PCITABLE- $PCITABLE

prepareBootImage() {
	stagedir=/tmp/sparcboot.$$
	rm -rf $stagedir
	mkdir -p $stagedir
	cp $KERNELROOT/boot/vmlinuz-* $stagedir/vmlinux64.gz
	cp $MBD_FSIMAGE $stagedir/initrd64.img
        cp $BOOTDISKDIR/fd.b $stagedir
	cp $BOOTDISKDIR/second.b $stagedir
	cp $BOOTDISKDIR/*.msg $stagedir
	cp $BOOTDISKDIR/silo64.conf  $stagedir/silo.conf
        genromfs -V "Red Hat Linux Install" -d $stagedir -f $MBD_TMPIMAGE -a 512 -A 2048,/..
	size=`cat $MBD_TMPIMAGE | wc -c`
	filler=`expr $BOOTDISKSIZE "*" 1024 - $size`
	dd if=/dev/zero bs=$filler count=1 >> $MBD_TMPIMAGE 2> /dev/null
	echo ROM disk image: `expr $filler / 1024`k free.
	rm -rf $stagedir
	mount -tromfs -oloop $MBD_TMPIMAGE $MBD_BOOTTREE
	$SILO -r $MBD_BOOTTREE -i /fd.b -b /second.b -C /silo.conf -F
}

maketftp() {
    while [ x$(echo $1 | cut -c1-2) = x"--" ]; do
	if [ $1 = "--kernel" ]; then
	    TFTPKERNEL=$2
	    shift; shift
	    continue
	elif [ $1 = "--initrdfrom" ]; then
	    TFTPINITRD=$2
	    shift; shift
	    continue
	elif [ $1 = "--imagename" ]; then
	    TFTPIMAGE=$2
	    shift; shift
	    continue
	fi
	echo "bad argument $1 passed to maketftp"
	exit 1
    done
	
    $TILO vmlinux64 $TFTPKERNEL $TFTPINITRD $TFTPIMAGE
}

# set up the silo files
rm -rf $TOPDESTPATH/boot
rm -rf $TOPDESTPATH/etc
mkdir -p $TOPDESTPATH/boot
mkdir -p $TOPDESTPATH/etc

cp $BOOTDISKDIR/cd.b $TOPDESTPATH/boot
cp $BOOTDISKDIR/second.b $TOPDESTPATH/boot
cp $BOOTDISKDIR/*.msg $TOPDESTPATH/etc
cp $BOOTDISKDIR/silo.conf $TOPDESTPATH/etc

# set up aout kernel images
rm -rf $TOPDESTPATH/kernels
mkdir -p $TOPDESTPATH/kernels
elftoaout -o $TOPDESTPATH/kernels/vmlinux64 $KERNELROOT/boot/vmlinux-*
gzip -9 $TOPDESTPATH/kernels/vmlinux64

SCSIMODULES="qlogicpti sg st pluto fcal soc socal
             fc4 aic7xxx sym53c8xx qlogicisp"
NETMODULES="sunhme sunqe sunbmac myri_sbus 3c59x de4x5" 

makeinitrd --initrdto $TOPDESTPATH/boot/initrd64.img \
	   --initrdsize 2000 \
	   --loaderbin loader \
           --modules "$SCSIMODULES $NETMODULES" \
	   --moduleballname modules64.cgz

maketftp --kernel $KERNELROOT/boot/vmlinux-* \
	 --imagename $TOPDESTPATH/images/tftp64.img \
         --initrdfrom $TOPDESTPATH/boot/initrd64.img

makebootdisk --kernelto $TOPDESTPATH/boot/vmlinux64.gz  \
	     --imagename boot64.img \
	     --bootdisksize 1440 \
	     --initrdflags '--initrdsize 2000 \
			    --loaderbin loader-local \
			    --modules "$SCSIMODULES" \
			    --moduleballname modules64.cgz'

makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES" modules64.cgz

makeinstimage "netstg" "$SCSIMOUDLES $SECSTAGE"
makeinstimage "hdstg" "$NETMODULES $SECSTAGE"
makemainimage "stage2" "ext2"