debian-cd-clone/tools/boot/etch/boot-powerpc

129 lines
3.7 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
set -x
N=$1
CDDIR=$2
INSTALLDIR=$CDDIR/install
if [ "$DI_WWW_HOME" = "default" ];then
2006-06-24 12:31:04 +00:00
DI_WWW_HOME="http://people.debian.org/~wouter/d-i/powerpc/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/..
install_languages $CDDIR
add_mkisofs_opt $N.mkisofs_opts "--iso-level 2"
add_mkisofs_opt $N.mkisofs_opts "--chrp-boot"
add_mkisofs_opt $N.mkisofs_opts "--netatalk"
add_mkisofs_opt $N.mkisofs_opts "-hfs"
add_mkisofs_opt $N.mkisofs_opts "-probe"
add_mkisofs_opt $N.mkisofs_opts "-map $BASEDIR/data/hfs.map"
# For newworld Mac booting - Note, no spaces in volid!
add_mkisofs_opt $N.mkisofs_opts "-part"
add_mkisofs_opt $N.mkisofs_opts "-no-desktop"
add_mkisofs_opt $N.mkisofs_opts "-hfs-bless CD$N/install"
add_mkisofs_opt $N.mkisofs_opts "-hfs-volid Debian/PowerPC_${CODENAME}"
# 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
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
fi
else
if [ -n "$SIZELIMIT" ];then
if [ "$SIZELIMIT" -gt 1000000000 ];then
let newsize="$SIZELIMIT"/256
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
fi
else
if [ -n "$DEFBINSIZE" ] && [ "$DEFBINSIZE" -gt 1000 ];then
let newsize="$DEFBINSIZE"*4096
add_mkisofs_opt $N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize"
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)
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 powerpc64
do
bitness=${subarch#powerpc}
if [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
if ! cp -a "$DI_DIR/$subarch/cdrom" "$subarch" && [ "$bitness" ]; then
cp -a "$DI_DIR/$subarch/cdrom${bitness}" "$subarch"
fi
else
if ! wget -r -nd --no-parent --level=1 -P "$subarch" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom/" && [ "$bitness" ]; then
wget -r -nd --no-parent --level=1 -P "$subarch" -R 'index*' "$DI_WWW_HOME/$subarch/cdrom${bitness}/"
fi
fi
done
if [ -f powerpc/vmlinuz-prep.initrd ]; then
# We are still missing this for prep
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-prep-boot install/powerpc/vmlinuz-prep.initrd"
fi
2005-06-10 21:45:45 +00:00
# Copy pegasos forth script, since pegasos machines don't support yaboot yet.
cat $BASEDIR/data/$DI_CODENAME/pegasos/pegasos \
2005-06-10 21:45:45 +00:00
| sed "s/\${MEDIA_TYPE}/CDROM/" \
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
> pegasos
# Let's copy the IBM CHRP stuff into place now.
cd $CDDIR
mkdir ppc
mkdir ppc/chrp
cp $BASEDIR/data/$DI_CODENAME/chrp/bootinfo.txt ppc
mkdir etc
cp $INSTALLDIR/yaboot.conf etc
exit 0