2005-05-05 16:15:44 +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
|
|
|
|
|
|
|
|
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
N=$1
|
|
|
|
CDDIR=$2
|
|
|
|
BOOTDIR=
|
|
|
|
if [ "$DI_WWW_HOME" = "default" ];then
|
2006-07-23 17:38:16 +00:00
|
|
|
DI_WWW_HOME="http://people.debian.org/~joeyh/d-i/images/daily"
|
2005-05-17 16:08:15 +00:00
|
|
|
if [ -n "$DI_DIR" ];then
|
|
|
|
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
|
|
|
|
DI_WWW_HOME=""
|
2006-05-02 21:52:05 +00:00
|
|
|
echo "Using images from $DI_DIR"
|
2005-05-17 16:08:15 +00:00
|
|
|
fi
|
2005-05-05 16:15:44 +00:00
|
|
|
fi
|
|
|
|
if [ ! "$DI_DIST" ]; then
|
|
|
|
DI_DIST="$DI_CODENAME"
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
KTYPE[1]="" #isolinux multiboot in fact
|
2006-07-30 13:00:57 +00:00
|
|
|
# Disable el-torito boot CD for Etch Beta 3
|
|
|
|
#KTYPE[2]="cdrom"
|
|
|
|
KTYPE[2]=""
|
2005-05-05 16:15:44 +00:00
|
|
|
# XXX add net-image back when it's fixed
|
|
|
|
KTYPE[3]=""
|
|
|
|
KTYPE[4]=""
|
|
|
|
KTYPE[5]=""
|
|
|
|
KTYPE[6]=""
|
|
|
|
KTYPE[7]=""
|
|
|
|
KTYPE[8]=""
|
|
|
|
KTYPE[9]=""
|
|
|
|
KTYPE[10]=""
|
|
|
|
|
|
|
|
THISTYPE=${KTYPE[$NN]}
|
|
|
|
|
2006-05-24 18:00:58 +00:00
|
|
|
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
|
2005-12-28 17:07:01 -01:00
|
|
|
# Only include disk images on full CDs, not on smaller images.
|
2006-11-22 23:42:39 -01:00
|
|
|
if [ "$INSTALLER_CD" != 1 ] && [ "$INSTALLER_CD" != 2 ]; then
|
|
|
|
DISK_IMAGES="floppy/cd-drivers.img floppy/boot.img floppy/root.img"
|
|
|
|
#EXTRA_DISK_IMAGES="cdrom/boot.img"
|
|
|
|
fi
|
2005-05-05 16:15:44 +00:00
|
|
|
|
|
|
|
# Download boot images and floppies.
|
2005-12-28 17:07:01 -01:00
|
|
|
for image in $BOOT_IMAGES; do
|
2005-05-05 16:15:44 +00:00
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
|
|
|
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
|
2005-05-17 16:08:15 +00:00
|
|
|
if [ ! "$DI_DIR" ];then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
|
|
|
fi
|
2006-08-24 18:52:10 +00:00
|
|
|
echo "Copying images from $DI_DIR"
|
2005-05-17 16:08:15 +00:00
|
|
|
cp "$DI_DIR/$image" "$image"
|
2005-05-05 16:15:44 +00:00
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2006-05-24 18:00:58 +00:00
|
|
|
# Images that are not really required or may be unavailable.
|
2005-12-28 17:07:01 -01:00
|
|
|
for image in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
|
2005-05-05 16:15:44 +00:00
|
|
|
if [ ! -e "$image" ]; then
|
|
|
|
dir=$(dirname $image)
|
|
|
|
mkdir -p $dir
|
|
|
|
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
|
2005-05-17 16:08:15 +00:00
|
|
|
if [ ! "$DI_DIR" ];then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
|
|
|
fi
|
|
|
|
cp "$DI_DIR/$image" "$image" || true
|
2005-05-05 16:15:44 +00:00
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/$image" -O "$image" || rm -f "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$NN" = "1" ]; then
|
|
|
|
echo "Using ISOLINUX boot-disks image on CD$N"
|
|
|
|
mkdir -p boot$N/isolinux
|
|
|
|
cp -f $BASEDIR/data/$DI_CODENAME/isolinux.bin boot$N/isolinux/
|
|
|
|
cp -lf cdrom/vmlinuz $CDDIR/install/
|
|
|
|
cp -lf cdrom/initrd.gz $CDDIR/install/
|
|
|
|
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
|
|
|
|
else
|
|
|
|
if [ -n "$THISTYPE" ]; then
|
|
|
|
echo "Using $THISTYPE boot-disks image on CD$N"
|
|
|
|
mkdir -p boot$N/boot
|
|
|
|
cp $THISTYPE/boot.img boot$N/boot/
|
|
|
|
echo -n "-cache-inodes -J -b boot/boot.img " > $N.mkisofs_opts
|
|
|
|
else
|
|
|
|
mkdir boot$N
|
|
|
|
echo -n "-cache-inodes -J " > $N.mkisofs_opts
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-05-14 17:27:44 +00:00
|
|
|
syslinux_files () {
|
|
|
|
type=$1
|
|
|
|
|
|
|
|
mv boot$N/isolinux/f3.txt.$type boot$N/isolinux/f3.txt
|
|
|
|
mv boot$N/isolinux/f4.txt.$type boot$N/isolinux/f4.txt
|
|
|
|
mv boot$N/isolinux/isolinux.cfg.$type boot$N/isolinux/isolinux.cfg
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_image () {
|
|
|
|
image=$1
|
|
|
|
dir=$(dirname "$image")
|
|
|
|
|
2006-05-15 22:04:18 +00:00
|
|
|
if [ ! -e "$image" ]; then
|
2006-05-14 17:27:44 +00:00
|
|
|
mkdir -p $dir
|
|
|
|
if [ ! "$DI_WWW_HOME" ];then
|
|
|
|
if [ ! "$DI_DIR" ];then
|
|
|
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
|
|
|
fi
|
|
|
|
cp "$DI_DIR/cdrom/$image" "$image"
|
|
|
|
else
|
|
|
|
wget "$DI_WWW_HOME/cdrom/$image" -O "$image"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d $CDDIR/install/$dir ]; then
|
2006-05-15 22:04:18 +00:00
|
|
|
mkdir -p $CDDIR/install/$dir
|
2006-05-14 17:27:44 +00:00
|
|
|
fi
|
2006-05-15 22:04:18 +00:00
|
|
|
cp -a "$image" $CDDIR/install/$dir/
|
2006-05-14 17:27:44 +00:00
|
|
|
}
|
|
|
|
|
2005-05-05 16:15:44 +00:00
|
|
|
# Only disk one gets the extra files installed
|
|
|
|
if [ "$NN" = "1" ]; then
|
|
|
|
# populate the install directory as well
|
|
|
|
for disk in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
|
|
|
|
if [ -e "$disk" ]; then
|
|
|
|
dir=$(dirname $disk)
|
|
|
|
mkdir -p $CDDIR/install/$dir
|
|
|
|
cp -lf $disk $CDDIR/install/$dir
|
|
|
|
fi
|
|
|
|
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/
|
2005-07-08 08:07:22 +00:00
|
|
|
|
|
|
|
# Isolinux setup including config and help files comes from d-i.
|
2005-05-05 16:15:44 +00:00
|
|
|
cat cdrom/debian-cd_info.tar.gz | (cd boot$N/isolinux/; tar zx)
|
2006-05-14 17:27:44 +00:00
|
|
|
if [ -e boot$N/isolinux/f3.txt.with26+gtk ]; then
|
|
|
|
extra_image 2.6/initrd.gz
|
|
|
|
extra_image 2.6/vmlinuz
|
|
|
|
extra_image gtk/initrd.gz
|
|
|
|
syslinux_files with26+gtk
|
|
|
|
elif [ -e boot$N/isolinux/f3.txt.withgtk ]; then
|
|
|
|
extra_image gtk/initrd.gz
|
|
|
|
syslinux_files withgtk
|
2006-05-15 00:53:46 +00:00
|
|
|
elif [ -e boot$N/isolinux/f3.txt.with26 ];then
|
2006-05-14 17:27:44 +00:00
|
|
|
extra_image 2.6/initrd.gz
|
|
|
|
extra_image 2.6/vmlinuz
|
|
|
|
syslinux_files with26
|
2005-05-06 18:47:45 +00:00
|
|
|
fi
|
2006-05-15 22:00:57 +00:00
|
|
|
rm -f boot$N/isolinux/isolinux.cfg.with* 2>/dev/null || true
|
2005-05-05 16:15:44 +00:00
|
|
|
|
|
|
|
if [ "$SPLASHPNG" ] ; then
|
2006-09-02 10:56:44 +00:00
|
|
|
# Insert our own splash screen. Color index 0 is
|
2005-05-05 16:15:44 +00:00
|
|
|
# background, and index 7 is foreground. Set to black and
|
|
|
|
# white respecively
|
|
|
|
pngtopnm < $SPLASHPNG | ppmquant 16 | \
|
2006-09-02 10:56:44 +00:00
|
|
|
ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
|
2005-05-05 16:15:44 +00:00
|
|
|
fi
|
2005-07-08 09:22:27 +00:00
|
|
|
|
|
|
|
if [ -n "$KERNEL_PARAMS" ]; then
|
|
|
|
# Substitute custom kernel params into the isolinux config
|
|
|
|
# file.
|
2006-10-08 11:25:42 +00:00
|
|
|
sed -i "s|append |append $KERNEL_PARAMS |" boot$N/isolinux/isolinux.cfg
|
2005-07-08 09:22:27 +00:00
|
|
|
fi
|
2006-10-18 20:47:32 +00:00
|
|
|
|
|
|
|
if [ -n "$ISOLINUX_DEFAULT" ]; then
|
|
|
|
sed -i "s/^DEFAULT .*$/DEFAULT $ISOLINUX_DEFAULT/" boot$N/isolinux/isolinux.cfg
|
|
|
|
fi
|
2005-05-05 16:15:44 +00:00
|
|
|
fi
|
|
|
|
|
2006-11-26 21:42:02 -01:00
|
|
|
sed -i "s|built on|built on $BUILD_DATE using d-i|" boot$N/isolinux/f1.txt
|
|
|
|
|
2005-05-17 16:08:15 +00:00
|
|
|
# Add autorun if we have README.html
|
|
|
|
|
|
|
|
if [ -f $CDDIR/README.html ]; then
|
|
|
|
todos > $CDDIR/autorun.inf <<EOF
|
|
|
|
[autorun]
|
|
|
|
open=autorun.bat
|
|
|
|
EOF
|
|
|
|
todos > $CDDIR/autorun.bat <<EOF
|
|
|
|
@echo Starting "README.html"...
|
|
|
|
@start README.html
|
|
|
|
@exit
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
2005-05-05 16:15:44 +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
|
|
|
|
fi
|
|
|
|
|
|
|
|
# th,th, thats all
|