2002-10-10 12:56:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Do install stuff for i386, including making bootable CDs
|
|
|
|
# Works with debian-installer
|
|
|
|
#
|
|
|
|
# $1 is the CD number
|
|
|
|
# $2 is the temporary CD build dir
|
|
|
|
|
2004-07-11 09:34:59 +00:00
|
|
|
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
|
2002-10-10 12:56:48 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
N=$1
|
|
|
|
CDDIR=$2
|
|
|
|
BOOTDIR=
|
2004-04-14 10:44:46 +00:00
|
|
|
if [ "$DI_WWW_HOME" = "default" ];then
|
|
|
|
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
|
|
|
|
fi
|
|
|
|
if [ ! "$DI_DIST" ]; then
|
|
|
|
DI_DIST="$DI_CODENAME"
|
2003-11-13 16:33:50 -01:00
|
|
|
fi
|
2002-10-10 12:56:48 +00:00
|
|
|
|
|
|
|
cd $CDDIR/..
|
|
|
|
|
|
|
|
# This script is called with $1 (now $N) as the CD to
|
|
|
|
# make bootable. N may be in the form "n" or "n_NONUS"
|
|
|
|
# There may be more than 4 disks...support extras.
|
|
|
|
|
|
|
|
# Strip NONUS part of disk number
|
|
|
|
# NN will be 1...N so it can be used as an index
|
|
|
|
NN=`echo $N | sed -e 's/_NONUS//'`
|
|
|
|
|
|
|
|
# List of boot image for each CD
|
2002-10-11 09:05:55 +00:00
|
|
|
KTYPE[1]="" #isolinux multiboot in fact
|
2004-02-08 03:43:17 -01:00
|
|
|
KTYPE[2]="cdrom"
|
2003-07-25 16:12:50 +00:00
|
|
|
# XXX add net-image back when it's fixed
|
|
|
|
KTYPE[3]=""
|
2003-09-13 17:06:50 +00:00
|
|
|
KTYPE[4]=""
|
2002-10-10 12:56:48 +00:00
|
|
|
KTYPE[5]=""
|
|
|
|
KTYPE[6]=""
|
|
|
|
KTYPE[7]=""
|
|
|
|
KTYPE[8]=""
|
|
|
|
KTYPE[9]=""
|
|
|
|
KTYPE[10]=""
|
|
|
|
|
|
|
|
THISTYPE=${KTYPE[$NN]}
|
|
|
|
|
2004-02-08 18:05:29 -01:00
|
|
|
BOOT_IMAGES="cdrom/boot.img cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
|
2004-09-11 23:07:43 +00:00
|
|
|
DISK_IMAGES="floppy/cd-drivers.img floppy/boot.img floppy/root.img"
|
2004-09-23 12:06:29 +00:00
|
|
|
# Only include extra disk images on full CDs, not on smaller images.
|
2004-10-01 00:05:06 +00:00
|
|
|
if [ "$INSTALLER_CD" != 1 ] && [ "$INSTALLER_CD" != 2 ]; then
|
2004-09-23 12:06:29 +00:00
|
|
|
# Note that floppy/access/drivers.img was renamed to cd-drivers, both
|
|
|
|
# present for the transition.
|
2004-09-25 14:20:26 +00:00
|
|
|
EXTRA_DISK_IMAGES="floppy/net-drivers.img floppy/access/root.img floppy/access/boot.img floppy/access/cd-drivers.img floppy/access/drivers.img"
|
2004-09-23 12:06:29 +00:00
|
|
|
fi
|
2004-02-08 03:43:17 -01:00
|
|
|
|
2004-09-11 23:07:43 +00:00
|
|
|
# Download boot images and floppies.
|
2004-02-08 03:43:17 -01:00
|
|
|
for image in $BOOT_IMAGES $DISK_IMAGES; do
|
2002-10-10 12:56:48 +00:00
|
|
|
if [ ! -e "$image" ]; then
|
2004-02-08 03:43:17 -01:00
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
2005-01-12 15:38:17 -01:00
|
|
|
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
|
|
|
|
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
elif [ ! "$DI_WWW_HOME" ];then
|
2004-04-14 10:44:46 +00:00
|
|
|
cp "$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image"
|
|
|
|
fi
|
2002-10-10 12:56:48 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2004-09-11 23:07:43 +00:00
|
|
|
# Floppies that are not really required or may be unavailable.
|
|
|
|
for image in $EXTRA_DISK_IMAGES; do
|
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
2005-01-12 15:38:17 -01:00
|
|
|
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
|
|
|
|
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
elif [ ! "$DI_WWW_HOME" ];then
|
2004-09-18 14:58:10 +00:00
|
|
|
cp "$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/$image" "$image" || true
|
2004-09-11 23:07:43 +00:00
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image" || rm -f "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-10-10 17:27:12 +00:00
|
|
|
if [ "$NN" = "1" ]; then
|
2002-10-10 12:56:48 +00:00
|
|
|
echo "Using ISOLINUX boot-disks image on CD$N"
|
|
|
|
mkdir -p boot$N/isolinux
|
2004-07-11 09:34:59 +00:00
|
|
|
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
|
2004-02-08 03:43:17 -01:00
|
|
|
cp -lf cdrom/vmlinuz $CDDIR/install/
|
2004-04-21 11:11:32 +00:00
|
|
|
cp -lf cdrom/initrd.gz $CDDIR/install/
|
2004-11-29 17:36:42 -01:00
|
|
|
echo -n "-cache-inodes -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table " > $N.mkisofs_opts
|
2002-10-10 12:56:48 +00:00
|
|
|
else
|
|
|
|
if [ -n "$THISTYPE" ]; then
|
2002-10-11 09:05:55 +00:00
|
|
|
echo "Using $THISTYPE boot-disks image on CD$N"
|
2002-10-10 12:56:48 +00:00
|
|
|
mkdir -p boot$N/boot
|
2004-02-08 03:43:17 -01:00
|
|
|
cp $THISTYPE/boot.img boot$N/boot/
|
2004-11-29 17:36:42 -01:00
|
|
|
echo -n "-cache-inodes -J -b boot/boot.img " > $N.mkisofs_opts
|
2002-10-10 12:56:48 +00:00
|
|
|
else
|
|
|
|
mkdir boot$N
|
2004-11-29 17:36:42 -01:00
|
|
|
echo -n "-cache-inodes -J " > $N.mkisofs_opts
|
2002-10-10 12:56:48 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-08-20 14:11:35 +00:00
|
|
|
write_isolinux_config () {
|
2004-07-29 01:11:42 +00:00
|
|
|
cat > boot$N/isolinux/isolinux.cfg <<EOF
|
2004-07-13 05:33:15 +00:00
|
|
|
DEFAULT /install/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
APPEND vga=normal initrd=/install/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2002-10-10 12:56:48 +00:00
|
|
|
LABEL linux
|
2002-10-11 09:05:55 +00:00
|
|
|
kernel /install/vmlinuz
|
2002-10-10 12:56:48 +00:00
|
|
|
LABEL cdrom
|
2002-10-11 09:05:55 +00:00
|
|
|
kernel /install/vmlinuz
|
2003-12-22 16:30:44 -01:00
|
|
|
LABEL expert
|
|
|
|
kernel /install/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
append DEBCONF_PRIORITY=low vga=normal initrd=/install/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2002-10-10 12:56:48 +00:00
|
|
|
DISPLAY isolinux.txt
|
|
|
|
TIMEOUT 0
|
|
|
|
PROMPT 1
|
|
|
|
F1 f1.txt
|
|
|
|
F2 f2.txt
|
|
|
|
F3 f3.txt
|
|
|
|
F4 f4.txt
|
|
|
|
F5 f5.txt
|
|
|
|
F6 f6.txt
|
|
|
|
F7 f7.txt
|
|
|
|
F8 f8.txt
|
|
|
|
F9 f9.txt
|
|
|
|
F0 f10.txt
|
|
|
|
EOF
|
2004-07-29 01:11:42 +00:00
|
|
|
}
|
2002-10-10 12:56:48 +00:00
|
|
|
|
2004-07-29 01:11:42 +00:00
|
|
|
write_isolinux_config_26 () {
|
|
|
|
cat > boot$N/isolinux/isolinux.cfg <<EOF
|
2004-04-21 11:11:32 +00:00
|
|
|
DEFAULT /install/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
APPEND $KERNEL_PARAMS vga=normal initrd=/install/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2004-04-21 11:11:32 +00:00
|
|
|
LABEL linux
|
|
|
|
kernel /install/vmlinuz
|
|
|
|
LABEL cdrom
|
|
|
|
kernel /install/vmlinuz
|
2004-07-29 01:11:42 +00:00
|
|
|
LABEL linux26
|
|
|
|
kernel /install/2.6/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
append $KERNEL_PARAMS vga=normal initrd=/install/2.6/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2004-04-21 11:11:32 +00:00
|
|
|
LABEL expert
|
|
|
|
kernel /install/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
append $KERNEL_PARAMS DEBCONF_PRIORITY=low vga=normal initrd=/install/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2004-07-29 01:11:42 +00:00
|
|
|
LABEL expert26
|
|
|
|
kernel /install/2.6/vmlinuz
|
2004-08-30 19:23:47 +00:00
|
|
|
append $KERNEL_PARAMS DEBCONF_PRIORITY=low vga=normal initrd=/install/2.6/initrd.gz ramdisk_size=10240 root=/dev/rd/0 devfs=mount,dall rw --
|
2004-04-21 11:11:32 +00:00
|
|
|
DISPLAY isolinux.txt
|
|
|
|
TIMEOUT 0
|
|
|
|
PROMPT 1
|
|
|
|
F1 f1.txt
|
|
|
|
F2 f2.txt
|
|
|
|
F3 f3.txt
|
|
|
|
F4 f4.txt
|
|
|
|
F5 f5.txt
|
|
|
|
F6 f6.txt
|
|
|
|
F7 f7.txt
|
|
|
|
F8 f8.txt
|
|
|
|
F9 f9.txt
|
|
|
|
F0 f10.txt
|
|
|
|
EOF
|
2004-07-29 01:11:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Only disk one gets the extra files installed
|
|
|
|
if [ "$NN" = "1" ]; then
|
|
|
|
# populate the install directory as well
|
2004-09-18 15:31:10 +00:00
|
|
|
for disk in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
|
|
|
|
if [ -e "$disk" ]; then
|
2004-07-29 01:11:42 +00:00
|
|
|
dir=$(dirname $disk)
|
|
|
|
mkdir -p $CDDIR/install/$dir
|
|
|
|
cp -lf $disk $CDDIR/install/$dir
|
2004-09-18 15:31:10 +00:00
|
|
|
fi
|
2004-07-29 01:11:42 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Include Smart Boot Manager image for people where isolinux fails
|
|
|
|
gzip -dc $BASEDIR/data/$DI_CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
|
|
|
|
# Keep the original file timestamp
|
|
|
|
touch -r $BASEDIR/data/$DI_CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
|
|
|
|
cp -p $BASEDIR/data/$DI_CODENAME/README.sbm $CDDIR/install/
|
|
|
|
# Isolinux help files come from d-i.
|
|
|
|
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
|
|
|
|
mv -f boot$N/isolinux/syslinux.txt boot$N/isolinux/isolinux.txt
|
|
|
|
if [ -e boot$N/isolinux/f3.txt.with26 ];then
|
|
|
|
mv boot$N/isolinux/f3.txt.with26 boot$N/isolinux/f3.txt
|
|
|
|
for image in cdrom/2.6/initrd.gz cdrom/2.6/vmlinuz; do
|
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
|
|
|
if [ ! "$DI_WWW_HOME" ];then
|
|
|
|
cp "$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/$image" "$image"
|
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cp -a cdrom/2.6 $CDDIR/install/2.6
|
|
|
|
write_isolinux_config_26
|
|
|
|
else
|
|
|
|
write_isolinux_config
|
|
|
|
fi
|
2004-09-07 16:52:25 +00:00
|
|
|
|
|
|
|
if [ "$SPLASHPNG" ] ; then
|
|
|
|
# Insert our own splash screen. Color index 15 is
|
|
|
|
# background, and index 7 is foreground. Set to black and
|
|
|
|
# white respecively
|
|
|
|
pngtopnm < $SPLASHPNG | ppmquant 16 | \
|
|
|
|
ppmtolss16 "#ffffff=7" "#000000=15" > boot$N/isolinux/splash.rle
|
|
|
|
fi
|
2004-07-29 01:11:42 +00:00
|
|
|
fi
|
2004-04-21 11:11:32 +00:00
|
|
|
|
2004-07-29 01:11:42 +00:00
|
|
|
# write final lines to mkisofs_opts
|
|
|
|
if [ "$NN" = "1" ]; then
|
|
|
|
echo -n "boot$N " >> $N.mkisofs_opts
|
|
|
|
else
|
|
|
|
if [ -n "$THISTYPE" ]; then
|
|
|
|
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
|
|
|
|
fi
|
2004-04-21 11:11:32 +00:00
|
|
|
fi
|
2004-07-29 01:11:42 +00:00
|
|
|
|
|
|
|
# th,th, thats all
|