3
# Do install stuff for i386/mac, including making bootable CDs
4
# Works with debian-installer
7
# $2 is the temporary CD build dir
9
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
16
if [ "$DI_WWW_HOME" = "default" ];then
17
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
19
if [ ! "$DI_DIST" ]; then
20
export DI_DIST="$DI_CODENAME"
22
if [ -z "$DI_PATH" ]; then
23
DI_PATH="$($BASEDIR/tools/find-newest-installer)"
31
# This script is called with $1 (now $N) as the CD to
32
# make bootable. N may be in the form "n" or "n_NONUS"
33
# There may be more than 4 disks...support extras.
35
# Strip NONUS part of disk number
36
# NN will be 1...N so it can be used as an index
38
NN=`echo $N | sed -e 's/_NONUS//'`
40
# List of boot image for each CD
41
KTYPE[1]="" #elilo multiboot in fact
43
# XXX add net-image back when it's fixed
53
THISTYPE=${KTYPE[$NN]}
55
BOOT_IMAGES="udeb.list cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
57
TAR_IMAGES="netboot/netboot.tar.gz"
59
# Download boot images
60
for image in $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
61
if [ ! -e "$image" ]; then
64
if [ ! "$DI_WWW_HOME" ];then
65
cp "$DI_PATH/current/images/$image" "$image"
67
wget "$DI_WWW_HOME/$image" -O "$image"
72
if [ "$NN" = "1" ]; then
73
check_kernel_sync udeb.list
75
echo "Using elilo boot-disks image on CD$N"
76
mkdir -p boot$N/install
77
ELILODEB="$($BASEDIR/tools/apt-selection cache show elilo | \
78
grep ^Filename | awk '{print $2}')"
79
(ar p "$MIRROR/$ELILODEB" data.tar.gz | \
80
tar zxf - -C . ./usr/lib/elilo/elilo.efi)
81
mv usr/lib/elilo/elilo.efi boot$N/install/
84
if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
85
cp -lf cdrom/vmlinuz $CDDIR/install/
86
cp -lf cdrom/initrd.gz $CDDIR/install/
88
if [ "$CDIMAGE_LIVE" = 1 ]; then
89
mv $CDDIR/casper/filesystem.kernel-386 $CDDIR/casper/vmlinuz
90
CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-386")"
91
mv $CDDIR/casper/filesystem.initrd-386 "$CDDIR$CASPER_INITRD"
93
echo -n "-cache-inodes -J -l " > $N.mkisofs_opts
94
# HFS hybrid filesystem for booting on Intel-based Macs
95
echo -n "--netatalk -hfs -probe -map $BASEDIR/data/hfs.map " >> $N.mkisofs_opts
96
echo -n "-part -no-desktop -hfs-bless CD$N/install -hfs-bless-file CD$N/install/elilo.efi -hfs-volid ${CAPPROJECT}_i386_${CODENAME} " >> $N.mkisofs_opts
97
# Recommended size for an HFS catalog is 4 MB per GB, defaults to 4 MB
98
if [ "$SIZELIMIT1" ]; then
99
if [ "$SIZELIMIT1" -gt 1000000000 ]; then
100
echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT1 / 256)) " >> $N.mkisofs_opts
102
elif [ "$SIZELIMIT" ]; then
103
if [ "$SIZELIMIT" -gt 1000000000 ]; then
104
echo -n "-hfs-parms MAX_XTCSIZE=$(($SIZELIMIT / 256)) " >> $N.mkisofs_opts
106
elif [ "$DEFBINSIZE" ]; then
107
if [ "$DEFBINSIZE" -gt 1000 ]; then
108
echo -n "-hfs-parms MAX_XTCSIZE=$(($DEFBINSIZE * 4096)) " >> $N.mkisofs_opts
113
"$BASEDIR/tools/sorting_weights" "$N"
114
echo -n "-sort $(pwd)/$N.weights " >> $N.mkisofs_opts
116
#install_languages $CDDIR
118
# Only disk one gets the extra files installed
120
if [ "$NN" = "1" ]; then
123
# populate the install directory as well
124
for disk in $DISK_IMAGES; do
126
mkdir -p $CDDIR/install/$dir
127
cp -lf $disk $CDDIR/install/$dir
130
if [ "$CDIMAGE_INSTALL" = 1 ]; then
131
for tar in $TAR_IMAGES; do
133
mkdir -p $CDDIR/install/$dir
134
tar -C $CDDIR/install/$dir -xzpf $tar
140
# Extract memtest86+ from the archive
141
MEMTEST86DEB="$($BASEDIR/tools/apt-selection cache show memtest86+ | \
142
grep ^Filename | awk '{print $2}')"
143
ar p "$MIRROR/$MEMTEST86DEB" data.tar.gz | \
144
tar xzf - -C $CDDIR/install/ ./boot/memtest86+.bin
145
mv $CDDIR/install/boot/memtest86+.bin $CDDIR/install/mt86plus
146
rm -rf $CDDIR/install/boot
147
# elilo help files come from d-i.
148
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/install/; tar zx)
149
# Remove ISOLINUX configuration; only for non-Macs.
150
rm -f boot$N/install/isolinux*
151
rm -f boot$N/install/*.txt*
152
rm -f boot$N/install/*.hlp*
153
# Override splash screen.
154
if [ "$SPLASHRLE" ] && [ -e "$SPLASHRLE" ]; then
155
cp -p "$SPLASHRLE" boot$N/install/splash.rle
157
if [ "$GFXSPLASH" ] && [ -e "$GFXSPLASH" ]; then
158
cp -p "$GFXSPLASH" boot$N/install/splash.pcx
160
if [ "$CDIMAGE_INSTALL" = 1 ]; then
161
rm -f boot$N/install/*.msg.live
163
for x in boot$N/install/*.msg.live; do
164
[ -f "$x" ] || continue
167
for x in boot$N/install/*.msg.live; do
168
[ -f "$x" ] || continue
175
# write final lines to mkisofs_opts
176
if [ "$NN" = "1" ]; then
177
echo -n "boot$N " >> $N.mkisofs_opts
179
if [ -n "$THISTYPE" ]; then
180
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts