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

82 lines
2.2 KiB
Plaintext
Raw Normal View History

#!/bin/bash -e
#
# boot-sparc lenny+
#
# Do install stuff for sparc, including making first CD bootable
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
set -e
N=$1
CDDIR=$2
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://people.debian.org/~stappers/d-i/sparc/daily/cdrom"
if [ -n "$DI_DIR" ];then
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
DI_WWW_HOME=""
fi
fi
if [ ! "$DI_DIST" ]; then
DI_DIST="$DI_CODENAME"
fi
# Only disc 1* bootable
if [ $N != 1 -a $N != 1_NONUS ]; then
exit 0;
fi
install_languages $CDDIR
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G boot1/boot/isofs.b -B ..."
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot1"
inst=boot1
cd $CDDIR/..
# Setup directories
mkdir -p $inst/boot
silo_deb=`$BASEDIR/tools/which_deb $MIRROR $DI_CODENAME silo`
# put the relevant parts of SILO boot loader
(ar p $MIRROR/$silo_deb data.tar.gz | \
tar zxf - -C $inst/ ./boot/{isofs,second}.b)
echo $silo_deb >> $CDDIR/../$N.pkgs_extracted
$BASEDIR/tools/which_deb $MIRROR $DI_CODENAME silo source >> $CDDIR/../$N.pkgs_extracted
# Some custom etc files
cp -f -p $BASEDIR/data/lenny/sparc/silo.conf $inst/boot/
if [ -n "$KERNEL_PARAMS" ]; then
sed -i "/^[[:space:]]\+append=\"/ s|append=\"|append=\"$KERNEL_PARAMS |" $inst/boot/silo.conf
fi
cat $BASEDIR/data/lenny/sparc/debian.txt \
| sed "s/\${MEDIA_TYPE}/CDROM/" \
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
> $inst/boot/debian.txt
# Sparc64 kernel is so big, that uncompressing it corrupts SILO memory, so
# uncompress it before hand.
if [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images/cdrom"
fi
else
DI_DIR="cdrom"
mkdir "./$DI_DIR"
wget "$DI_WWW_HOME" -O ./$DI_DIR/di.dir
sparc64=$(sed -n 's/.*a href="\(vmlinuz-.*-sparc64\)".*/\1/ip' ./$DI_DIR/di.dir)
wget "$DI_WWW_HOME/$sparc64" -O ./$DI_DIR/vmlinuz-x-sparc64
wget "$DI_WWW_HOME/initrd.gz" -O ./$DI_DIR/initrd.gz
fi
2007-08-11 23:23:25 +00:00
if [ ! -e "$DI_DIR"/initrd.gz ] ; then
DI_DIR="$DI_DIR"/2.6
fi
cp "$DI_DIR"/initrd.gz "$inst/boot/initrd.gz"
#cp "$DI_DIR"/vmlinuz-*-sparc32 "$inst/boot/sparc32"
zcat "$DI_DIR"/vmlinuz-*-sparc64 > "$inst/boot/sparc64"