169 lines
4.1 KiB
Bash
Executable File
169 lines
4.1 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# boot-i386 v 1.13 (c) Steve McIntyre <stevem@chiark.greenend.org.uk>
|
|
# Released under GPL 31 Mar 1999
|
|
# 06-10-99 jjw Added $CODENAME and $CODENAME_STATUS support
|
|
#
|
|
# Heavily hacked by Raphaël Hertzog <hertzog@debian.org> for
|
|
# YACS (the new debian-cd in potato)
|
|
# 12MAR00 updated for current i386 bootdisks --jwest
|
|
# 02JAN01 cd1=default-kern, cd2=compact-kern, cd3=idepci-kern --jwest
|
|
#
|
|
# Do install stuff for i386, including making bootable CDs
|
|
#
|
|
# $1 is the CD number
|
|
# $2 is the temporary CD build dir
|
|
|
|
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//'`
|
|
|
|
|
|
# what kernel-type to put on what disk?
|
|
# a null "" value will use the default boot-disk kernel
|
|
#
|
|
KTYPE[1]=""
|
|
KTYPE[2]="compact"
|
|
KTYPE[3]="idepci"
|
|
KTYPE[4]="udma100-ext3"
|
|
KTYPE[5]="reiserfs"
|
|
KTYPE[6]=""
|
|
KTYPE[7]=""
|
|
KTYPE[8]=""
|
|
|
|
# Show user what is going on.
|
|
#
|
|
echo "Using ${KTYPE[$NN]} boot-disks image on CD$N"
|
|
|
|
# Put boot images on CD1...CD(N)
|
|
#
|
|
:> $N.mkisofs_opts
|
|
mkdir -p boot$N/boot
|
|
cp -f CD1/dists/$CODENAME/main/disks-$ARCH/current/images-2.88/${KTYPE[$NN]}/rescue.bin boot$N/boot/
|
|
|
|
echo -n "-J -b boot/rescue.bin " > $N.mkisofs_opts
|
|
|
|
|
|
|
|
# Only disk one gets the extra files installed
|
|
#
|
|
if [ $N == "1" ] || [ $N == "1_NONUS" ] ; then
|
|
|
|
|
|
|
|
# # new new new # #
|
|
# The next chunk of code is only used if MULTIBOOT=yes
|
|
# Make disk1 a multi-boot image
|
|
# ElTorito supports multiple boot images
|
|
# Setup all boot-disk images (currently 5)
|
|
|
|
|
|
if [ $MULTIBOOT == "yes" ] ; then
|
|
echo "Adding additional boot images to CD1"
|
|
|
|
for i in 2 3 4 5 ; do
|
|
|
|
# first copy/link the next boot block to the disk.
|
|
ln CD1/dists/$CODENAME/main/disks-$ARCH/current/images-2.88/${KTYPE[$i]}/rescue.bin boot$N/boot/${KTYPE[$i]}.bin
|
|
# then the eltorito-alt-boot cmd to mkisofs_opts
|
|
echo -n "-eltorito-alt-boot " >> $N.mkisofs_opts
|
|
# then copy the mkisofs command for this image to the mkisofs_opts
|
|
echo -n "-b boot/${KTYPE[$i]}.bin " >> $N.mkisofs_opts
|
|
|
|
done
|
|
fi
|
|
|
|
|
|
|
|
|
|
# populate the install directory as well
|
|
(cd $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/ ; \
|
|
cp -f images-1.44/resc*.bin $CDDIR/install ; \
|
|
cp -f linux $CDDIR/install/linux ; \
|
|
cp -f compact/linux $CDDIR/install/lincompt ; \
|
|
cp -f idepci/linux $CDDIR/install/linpci ; \
|
|
cp -f udma100-ext3/linux $CDDIR/install/linext3 ; \
|
|
cp -f reiserfs/linux $CDDIR/install/linreis ; \
|
|
cp -f images-1.44/root.bin $CDDIR/install )
|
|
|
|
|
|
# Tools for disc 1
|
|
# and include the legacy DOS stuff
|
|
|
|
cp -f $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/dosutils/* $CDDIR/install/
|
|
|
|
(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
|
|
|
|
(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= standard kernel (2.2)
|
|
echo 2= compact kernel (2.2)
|
|
echo 3= IDEPCI kernel (2.2)
|
|
echo 4= UDMA100-ext3 kernel (2.2)
|
|
echo 5= reiserfs kernel (2.2)
|
|
|
|
choice /c:1234
|
|
if errorlevel 5 goto FIVE
|
|
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 standard kernel
|
|
loadlin.exe linux root=/dev/ram ro initrd=root.bin
|
|
|
|
:TWO
|
|
echo using compact kernel
|
|
loadlin.exe lincompt root=/dev/ram ro initrd=root.bin
|
|
|
|
:THREE
|
|
echo using IDEPCI kernel
|
|
loadlin.exe linpci root=/dev/ram ro initrd=root.bin
|
|
|
|
:FOUR
|
|
echo using UDMA100-ext3 kernel
|
|
loadlin.exe linext3 root=/dev/ram ro initrd=root.bin
|
|
|
|
:FIVE
|
|
echo using reiserfs kernel
|
|
loadlin.exe linreis root=/dev/ram ro initrd=root.bin
|
|
EOF
|
|
) |todos > $CDDIR/install/boot.bat
|
|
|
|
fi
|
|
|
|
|
|
|
|
# write final lines to mkisofs_opts
|
|
echo -n "-c boot/boot.catalog boot$N " >> $N.mkisofs_opts
|
|
|
|
|
|
# th,th, thats all
|