From 3a19971c45c1e1986f5e8a9dbf476cc9493e09b6 Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Wed, 8 Dec 2004 22:47:20 +0000 Subject: [PATCH] Added script to make amd64 CDs/DVDs bootable. FIXME: the help text for isolinux still needs updating... --- tools/boot/sarge/boot-amd64 | 202 ++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100755 tools/boot/sarge/boot-amd64 diff --git a/tools/boot/sarge/boot-amd64 b/tools/boot/sarge/boot-amd64 new file mode 100755 index 00000000..7effbe79 --- /dev/null +++ b/tools/boot/sarge/boot-amd64 @@ -0,0 +1,202 @@ +#!/bin/bash +# +# Do install stuff for amd64, 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 + DI_WWW_HOME="http://debian-amd64.alioth.debian.org/debian-installer/daily" +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 +KTYPE[2]="cdrom" +# 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]} + +# Only sets up CD#1 for now +if [ "$NN" != "1" ] ; then + exit 0 +fi + +BOOT_IMAGES="cdrom/boot.img cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz" +DISK_IMAGES="" + +# Add a sid->sarge symlink for now until sarge exists separately +ln -s sarge $CDDIR/dists/sid + +mkdir cdrom +cp $MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/hd-media/boot.img.gz cdrom +gunzip cdrom/boot.img.gz +cp $MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/cdrom/vmlinuz cdrom +cp $MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/cdrom/initrd.gz cdrom +cp $MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/cdrom/debian-cd_info.tar.gz cdrom + +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 -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table " > $N.mkisofs_opts +fi + +#install_languages $CDDIR + +# Only disk one gets the extra files installed +# +if [ "$NN" = "1" ]; then + + +# populate the install directory as well +for disk in $DISK_IMAGES; do + dir=$(dirname $disk) + mkdir -p $CDDIR/install/$dir + cp -lf $disk $CDDIR/install/$dir +done + +# ISOLINUX setup + +# 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/initrd.gz cdrom/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 $CDDIR/install +# Isolinux config file. +cat > boot$N/isolinux/isolinux.cfg < boot$N/isolinux/isolinux.cfg < $CDDIR/tools/README.tools + +# Loadlin script for starting install via dos/windows +(cat < $CDDIR/install/boot.bat + +fi + +# 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