debian-cd-clone/etchnhalf/tools/boot/sarge/boot-powerpc

137 lines
4.2 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# Do install stuff for powerpc, 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
INSTALLDIR=$CDDIR/install
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="http://people.debian.org/~luther/d-i/images/daily"
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
cd $CDDIR/..
# Only disk 1* bootable
if [ $N != 1 -a $N != 1_NONUS ]; then
# we don't need HFS cruft on anything but CD 1
:> $N.mkisofs_opts
exit 0
fi
install_languages $CDDIR
echo -n "--chrp-boot --netatalk -hfs -probe -map $BASEDIR/data/hfs.map" \
> $N.mkisofs_opts
# We are still missing this for prep
echo -n " -prep-boot install/powerpc/vmlinuz-prep.initrd" >> $N.mkisofs_opts
# For newworld Mac booting - Note, no spaces in volid!
echo -n " -part -no-desktop -hfs-bless CD$N/install -hfs-volid Debian/PowerPC_${CODENAME}" \
>> $N.mkisofs_opts
# Recommended size for a HFS Catalog is 4 megas per giga, defaults to 4 megas
if [ -n "$SIZELIMIT1" ];then
if [ "$SIZELIMIT1" -gt 1000000000 ];then
let newsize="$SIZELIMIT1"/256
echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
fi
else
if [ -n "$SIZELIMIT" ];then
if [ "$SIZELIMIT" -gt 1000000000 ];then
let newsize="$SIZELIMIT"/256
echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
fi
else
if [ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ];then
let newsize="$DEFBINSIZE"*4096
echo -n " -hfs-parms MAX_XTCSIZE=$newsize" >> $N.mkisofs_opts
fi
fi
fi
cd $INSTALLDIR
# Extract yaboot from the archive
if [ -z "$YABOOT_DEBUG" ]; then
YADEB="$($BASEDIR/tools/apt-selection cache show yaboot | \
grep ^Filename | awk '{print $2}')"
(ar p "${MIRROR}/${YADEB}" data.tar.gz | \
tar zxf - -C . ./usr/lib/yaboot/yaboot)
mv usr/lib/yaboot/yaboot .
rm -rf usr
else
cp -f $YABOOT_DEBUG yaboot
fi
#
# generate/download images for "powerpc"
# (missing: bootvars1.3b.sit.hqx, BootX_1.2.2.sit, boot-floppy-hfs.img)
BUILD_DATE=$(date +%Y%m%d)
cat $BASEDIR/data/$DI_CODENAME/yaboot/boot.msg \
| sed "s/\${MEDIA_TYPE}/CDROM/" \
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
> boot.msg
cat $BASEDIR/data/$DI_CODENAME/yaboot/yaboot.conf \
| sed "s/CODENAME/${CODENAME}/g" > yaboot.conf
cp $BASEDIR/data/$DI_CODENAME/yaboot/ofboot.b ofboot.b
for subarch in powerpc power3 power4
do
if [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp -a "$DI_DIR/$subarch/cdrom" "$subarch"
if [ "$subarch" = "powerpc" ]; then
cp -a "$DI_DIR/$subarch/cdrom-minimal" "$subarch/minimal" || true
else
# Supported for netboot only on POWER3 and POWER4.
rm -rf "$subarch/2.4"
# POWER3 and POWER4 PReP machines do not exist.
rm -f "$subarch/vmlinuz-prep.initrd"
fi
else
wget -r -nd --no-parent --level=1 -P "$subarch" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom/"
if [ $subarch = powerpc ]; then
wget -r -nd --no-parent --level=1 -P "$subarch/2.4" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom/2.4/"
wget -r -nd --no-parent --level=1 -P "$subarch/minimal" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom-minimal/"
wget -r -nd --no-parent --level=1 -P "$subarch/minimal/2.4" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom-minimal/2.4/"
else
# POWER3 and POWER4 PReP machines do not exist.
rm -f "$subarch/vmlinuz-prep.initrd"
fi
fi
# Save some space with hardlinks; these kernels are identical.
if [ -e powerpc/vmlinux ] && [ -e powerpc/minimal/vmlinux ]; then
ln -f powerpc/vmlinux powerpc/minimal/vmlinux
fi
if [ -e powerpc/2.4/vmlinux ] && [ -e powerpc/minimal/2.4/vmlinux ]; then
ln -f powerpc/2.4/vmlinux powerpc/minimal/2.4/vmlinux
fi
done
#
# Copy pegasos forth script, since pegasos machines don't support yaboot yet.
BUILD_DATE=$(date +%Y%m%d)
cat $BASEDIR/data/$DI_CODENAME/pegasos/pegasos \
| sed "s/\${MEDIA_TYPE}/CDROM/" \
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
> pegasos
exit 0