debian-cd-clone/tools/boot/potato/boot-sparc

78 lines
1.9 KiB
Plaintext
Raw Normal View History

2000-03-14 03:07:15 -01:00
#!/bin/bash -e
#
# boot-sparc v 2.00 (c) Steve Dunham <dunham@cse.msu.edu>, Eric
1999-11-11 16:10:37 -01:00
# Delaunay <delaunay@lix.polytechnique.fr>, Steve McIntyre
2000-03-14 03:07:15 -01:00
# <stevem@chiark.greenend.org.uk>, Ben Collins <bcollins@debian.org>
1999-11-11 16:10:37 -01:00
# Released under GPL 31 Mar 1999
# See the file COPYING for license details
# Released as part of the slink_cd package, not much use standalone
#
2000-03-14 03:07:15 -01:00
# Mar 2000: Converted to an ext2 CD partition for the first CD
#
2000-03-14 03:07:15 -01:00
# Do install stuff for sparc, including making bootable CDs
1999-11-11 16:10:37 -01:00
set -e
1999-11-11 16:10:37 -01:00
N=$1
CDDIR=$2
cd $CDDIR/..
2000-03-14 03:07:15 -01:00
:> $N.mkisofs_opts
# Disk 1 only
2000-03-14 03:07:15 -01:00
[ "$N" = 1 ] || exit 0
2000-03-14 03:58:56 -01:00
echo "-B boot/second.b boot1" > $N.mkisofs_opts
2000-03-14 03:07:15 -01:00
rm -rf boot1
2000-03-14 03:07:15 -01:00
inst=boot1
2000-03-14 03:07:15 -01:00
# Setup directories
mkdir -p $inst/{boot/sun4{u,cdm},etc}
# put the relevant parts of SILO boot loader
2000-03-14 03:07:15 -01:00
cp -p $BOOTDIR/{cd,second}.b $inst/boot/
2000-03-14 03:07:15 -01:00
# Some custom etc files
cp -p $BASEDIR/tools/boot/potato/sparc-etc/{boot-msg.txt,debian.txt,silo.conf} \
$inst/etc/
2000-03-14 03:07:15 -01:00
# linux kernel & co are fetched directly from the rescue disks
tmp=/var/tmp/debian_cd
mnt=$tmp/mnt
if [ -d $mnt/ ]; then
umount $mnt >/dev/null 2>&1 || true
else
mkdir -p $mnt
fi
for suba in sun4cdm sun4u; do
cp -f $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/$suba/images-1.44/rescue.bin \
$tmp/rescue.bin
mount -o loop,ro $tmp/rescue.bin $mnt
cp $mnt/linux $inst/boot/$suba/linux
umount $mnt
rm -f $tmp/rescue.bin
done
# Unpack the root tree into the directory. we use the tftp root.tar.gz
tar zxf $CDDIR/dists/$CODENAME/main/disks-$ARCH/current/root.tar.gz -C $tmp/
cp -a $tmp/debian-sparc-root/* $inst/.
# no longer need this
rm -rf $tmp
# Get rid of some junk
rm -f $inst/{boot_message,type.txt}
2000-03-14 03:07:15 -01:00
# Make writable areas point to /tmp
rmdir $inst/var/{log,run}
ln -s ../tmp/log $inst/var/log
ln -s ../tmp/run $inst/var/run
# Hack...need a better way
ln -s ../tmp/resolv.conf $inst/etc/resolv.conf
ln -s ../../target/usr/bin/whiptail $inst/usr/bin/whiptail
rmdir $inst/lib/modules
ln -s ../target/lib/modules $inst/lib/modules