Debian Codegraph @

tools/boot/kali-rolling/boot-alpha

raw
1 #!/bin/bash
2 #
3 # Do install stuff for alpha, including making bootable CDs
4 # Works with debian-installer
5 #
6 #Vorlon:
7 #
8 #The following pieces are still missing:
9 #
10 #- MILO bootloader & images. I have no way to test this directly, and
11 # haven't used MILO for years, so I'm giving this a pass on the first
12 # run.
13 #- Floppy images. Currently, debian-installer claims not to support
14 # the floppy target on alpha, which is arbitrary, but there may just not
15 # be any reason to continue supporting this install method. Another
16 # decision that can be made later.
17 #
18 # $1 is the CD number
19 # $2 is the temporary CD build dir
20
21 . $BASEDIR/tools/boot/$DI_CODENAME/common.sh
22
23 set -e
24
25 N=$1
26 CDDIR=$2
27 INSTALLDIR="install"
28
29 # Common options for all disks
30 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
31 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
32 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"
33
34 # Exit if this is not CD#1/DVD#1
35 if [ $N != "1" ]; then
36 exit 0
37 fi
38
39 if [ "$DI_WWW_HOME" = "default" ]; then
40 DI_WWW_HOME="https://d-i.debian.org/daily-images/alpha/daily/cdrom/"
41 try_di_image_cache
42 else
43 DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
44 fi
45
46 cd $CDDIR/..
47
48 #
49 # This script is called with $1 (now $N) as the CD to
50 # make bootable.
51
52 # Only disk 1* bootable
53 if [ $N != 1 ]; then
54 exit 0
55 fi
56
57 ABOOTDEB=$(find_pkg_file aboot-base)
58 if [ -z "$ABOOTDEB" ] ; then
59 echo "ERROR: the aboot-base package is required." >&2
60 exit 1
61 fi
62
63 mkdir boot$N
64 (dpkg --fsys-tarfile "$MIRROR/$ABOOTDEB" | tar xf - -C boot$N/ ./boot/bootlx)
65
66 # Download boot images
67 # XXX: Driver floppies? Any alpha that /has/ a CDROM should be able to
68 # boot from it, so this would be pure convenience of distribution.
69 #for image in cd_drivers-image.img cdrom-image.img cdrom-initrd.gz floppy-image.img floppy-initrd.gz net_drivers-image.img netboot-initrd.gz vmlinuz ; do
70
71 for image in initrd.gz vmlinuz; do
72 if [ ! -e "$image" ]; then
73 if [ ! "$DI_WWW_HOME" ];then
74 if [ ! "$DI_DIR" ];then
75 DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current"
76 fi
77 ab_file=`ls "$DI_DIR"/cdrom/$image* | tail -1`
78 cp "$ab_file" .
79 else
80 $WGET "$DI_WWW_HOME/$image"
81 fi
82 fi
83 done
84
85 echo "Using $THISTYPE boot-disks image on CD$N"
86 mkdir -p boot$N/boot
87 cp initrd.gz boot$N/boot/
88 cp vmlinuz* boot$N/boot/vmlinuz
89 mkdir -p boot$N/etc
90
91 RSIZE=$(expr $(zcat boot$N/boot/initrd.gz | wc --bytes) / 1024)
92 OPTS="ramdisk_size=$RSIZE initrd=/boot/initrd.gz root=/dev/ram devfs=mount,dall $KERNEL_PARAMS"
93
94 echo "0:boot/vmlinuz $OPTS" > boot$N/etc/aboot.conf
95 echo "1:boot/vmlinuz $OPTS console=ttyS0" >> boot$N/etc/aboot.conf
96 echo "2:boot/vmlinuz $OPTS console=ttyS1" >> boot$N/etc/aboot.conf
97
98 mkdir -p boot$N/milo
99
100 add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-alpha-boot boot/bootlx"
101
102 add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot$N"
103