debian-cd-clone/tools/boot/sarge/boot-i386

174 lines
4.3 KiB
Plaintext
Raw Normal View History

#!/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/$CODENAME/common.sh
set -e
N=$1
CDDIR=$2
BOOTDIR=
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]="" #multiboot in fact
KTYPE[2]="cdrom-2880"
KTYPE[3]="net-1440"
KTYPE[4]="cdrom144-1440"
KTYPE[5]=""
KTYPE[6]=""
KTYPE[7]=""
KTYPE[8]=""
KTYPE[9]=""
KTYPE[10]=""
THISTYPE=${KTYPE[$NN]}
# Download boot images
for image in cdrom-2880.img cdrom144-1440.img net-1440.img; do
if [ ! -e "$image" ]; then
wget http://people.debian.org/~joeyh/debian-installer/daily/images/$image
fi
done
if [ "$NN" = "1" ]; the
echo "Using ISOLINUX boot-disks image on CD$N"
mkdir -p boot$N/isolinux
cp -f $BASEDIR/data/$CODENAME/isolinux.bin boot$N/isolinux/
cp -lf cdrom-2880.img cdrom144-1440.img net-1440.img boot$N/isolinux/
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
else
if [ -n "$THISTYPE" ]; then
echo "Using ${THISTYPE:-vanilla} boot-disks image on CD$N"
mkdir -p boot$N/boot
cp $THISTYPE.img boot$N/boot/
echo -n "-cache-inodes -J -l -b boot/$THISTYPE.img " > $N.mkisofs_opts
else
mkdir boot$N
echo -n "-cache-inodes -J -l " > $N.mkisofs_opts
fi
fi
#install_languages $CDDIR
# Only disk one gets the extra files installed
#
if [ "$NN" = "1" ]; then
# populate the install directory as well
cp -lf *.img $CDDIR/install
# Tools for disc 1
# and include the legacy DOS stuff
if [ "${ISOLINUX:-0}" != "0" ]; then
# Include Smart Boot Manager image for people where isolinux doesn't
# work
gzip -dc $BASEDIR/data/$CODENAME/sbm.bin.gz > $CDDIR/install/sbm.bin
touch -r $BASEDIR/data/$CODENAME/sbm.bin.gz $CDDIR/install/sbm.bin
cp -p $BASEDIR/data/$CODENAME/README.sbm $CDDIR/install/
# Isolinux config files
cp -f $BASEDIR/data/$CODENAME/isolinux.txt $BASEDIR/data/$CODENAME/f*.txt boot$N/isolinux/
cat > boot$N/isolinux/isolinux.cfg <<EOF
DEFAULT /install/linpci
APPEND root=/dev/ram ro initrd=idepci.bin ramdisk_size=16384 disksize=1.44 flavor=idepci
LABEL linux
kernel /isolinux/cdrom-2880.img
LABEL cdrom
kernel /isolinux/cdrom-2880.img
LABEL cdrom144
kernel /isolinux/cdrom144-1440.img
LABEL net
kernel /isolinux/net-1440.img
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
fi
(echo "Tools for DOS :" ; \
echo "lodlin/ load Linux kernel from DOS" ;\
echo "rawrite2/ rawrite 2.0 : create disks from disk images (*.bin)"; \
) |todos > $CDDIR/tools/README.tools
if [ "disabled" = "" ]; then
(cat <<EOF;
@ echo off
rem Flush any write-cached disk blocks before we leave DOS.
If your system does not use smartdrv an error message will appear,
you can safely ignore that.
smartdrv /c
echo Please choose a linux kernel now
echo 1= IDEPCI kernel (2.2)
echo 2= compact (SCSI) kernel (2.2)
echo 3= 2.4.x kernel (2.4)
echo 4= vanilla (standard) kernel (2.2)
choice /c:1234
if errorlevel 4 goto FOUR
if errorlevel 3 goto THREE
if errorlevel 2 goto TWO
if errorlevel 1 goto ONE
echo doing default somehow and going to ONE
goto ONE
:ONE
echo using IDEPCI kernel
loadlin.exe linpci root=/dev/ram ro initrd=root.bin ramdisk_size=16384 disksize=1.44 flavor=idepci
:TWO
echo using compact (SCSI) kernel
loadlin.exe lincompt root=/dev/ram ro initrd=compact.bin ramdisk_size=16384 disksize=1.44 flavor=compact
:THREE
echo using 2.4.x kernel
loadlin.exe lin24 root=/dev/ram ro initrd=bf24.bin ramdisk_size=16384 disksize=1.44 flavor=bf2.4
:FOUR
echo using standard (vanilla) kernel
loadlin.exe linux root=/dev/ram ro initrd=root.bin ramdisk_size=16384 disksize=1.44 TERM=vt102
EOF
) |todos > $CDDIR/install/boot.bat
fi
fi
# write final lines to mkisofs_opts
if [ "$NN" = "1" ]; then
echo -n "boot$N " >> $N.mkisofs_opts
else
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
fi
# th,th, thats all