Switch bootloader from yaboot to grub-ieee1275 on powerpc

This commit is contained in:
John Paul Adrian Glaubitz 2019-05-09 16:33:32 +02:00
parent 6544f2d076
commit 4940b6b64d
3 changed files with 52 additions and 114 deletions

1
debian/changelog vendored
View File

@ -13,6 +13,7 @@ debian-cd (3.1.24) UNRELEASED; urgency=medium
* Add grub-efi{,{-ia64,{-bin}}} to tools/generate_di+k_list on ia64 * Add grub-efi{,{-ia64,{-bin}}} to tools/generate_di+k_list on ia64
* Remove elilo from tools/generate_di+k_list on {i386,ia64} * Remove elilo from tools/generate_di+k_list on {i386,ia64}
* Switch bootloader from elilo to grub-efi-ia64 on ia64 * Switch bootloader from elilo to grub-efi-ia64 on ia64
* Switch bootloader from yaboot to grub-ieee1275 on powerpc
-- Holger Levsen <holger@debian.org> Wed, 20 Feb 2019 14:12:16 +0100 -- Holger Levsen <holger@debian.org> Wed, 20 Feb 2019 14:12:16 +0100

View File

@ -15,6 +15,19 @@ N=$1
CDDIR=$2 CDDIR=$2
INSTALLDIR=$CDDIR/install INSTALLDIR=$CDDIR/install
# Common mkisofs options when creating CDs
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-cache-inodes"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-l"
# mkisofs options specific to powerpc
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfsplus -apm-block-size 2048"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfsplus-file-creator-type chrp tbxi /System/Library/CoreServices/BootX"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs-bless-by p /System/Library/CoreServices"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-sysid PPC -graft-points"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "/System/Library/CoreServices/BootX=$CDDIR/../CD1/boot/grub/powerpc-ieee1275/grub.chrp"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "/System/Library/CoreServices/grub.elf=$CDDIR/../CD1/boot/grub/powerpc.elf"
# Exit if this is not CD#1/DVD#1 # Exit if this is not CD#1/DVD#1
if [ $N != "1" ]; then if [ $N != "1" ]; then
exit 0 exit 0
@ -27,125 +40,50 @@ else
DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,") DI_WWW_HOME=$(echo $DI_WWW_HOME | sed "s,%ARCH%,$ARCH,")
fi fi
case "$MKISOFS" in
*xorriso*)
XORRISO_VER=$(xorriso_version)
;;
*)
echo "ERROR: debian-cd now depends on xorriso for making powerpc bootable CDs."
exit 1;
;;
esac
cd $CDDIR/.. cd $CDDIR/..
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--iso-level 4" BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--netatalk"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-probe"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-map $BASEDIR/data/hfs.map"
# Recommended size for a HFS Catalog is 4 megas per giga, defaults to 4 megas # Download boot images.
# MAXDISKBLOCKS is measured in 2K blocks for image in $BOOT_IMAGES; do
newsize=`echo "$MAXDISKBLOCKS * 2048 / 256" | bc` if [ ! -e "$image" ]; then
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs-parms MAX_XTCSIZE=$newsize" dir=$(dirname $image)
mkdir -p $dir
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--chrp-boot" if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
# For newworld Mac booting - Note, no spaces in volid! cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-part" elif [ ! "$DI_WWW_HOME" ];then
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-no-desktop" if [ ! "$DI_DIR" ];then
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs-bless CD$N/install" DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-hfs-volid Debian/PowerPC_${CODENAME}" fi
cp "$DI_DIR/$image" "$image"
cd $INSTALLDIR else
# Extract yaboot from the archive $WGET "$DI_WWW_HOME/$image" -O "$image"
if [ -z "$YABOOT_DEBUG" ]; then
YADEB=$(find_pkg_file yaboot)
if [ -z "$YADEB" ]; then
echo "ERROR: the yaboot package is required." >&2
exit 1
fi
(dpkg --fsys-tarfile "$MIRROR/$YADEB" | \
tar xf - -C . ./usr/lib/yaboot/yaboot)
mv usr/lib/yaboot/yaboot .
rm -rf usr
if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
echo $YADEB >> $CDDIR/../$N.pkgs_extracted
find_pkg_file yaboot source >> $CDDIR/../$N.pkgs_extracted
fi
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)
cp $BASEDIR/data/$DI_CODENAME/yaboot/ofboot.b ofboot.b
if [ "$DESKTOP"x = ""x ] || [ "$DESKTOP"x = "all"x ] ; then
DEFAULT_DESKTOP="$UNSPEC_DESKTOP_DEFAULT"
else
DEFAULT_DESKTOP="$DESKTOP"
fi
for subarch in powerpc powerpc64 #prep
do
case $subarch in
powerpc|prep)
bitness=
yabootconf=mac32.conf
yabootmsg=boot32.msg
;;
powerpc64)
bitness=64
yabootconf=yaboot.conf
yabootmsg=boot.msg
;;
esac
cat $BASEDIR/data/$DI_CODENAME/yaboot/$yabootconf \
| sed "s/CODENAME/${CODENAME}/g" \
> $yabootconf
cat $BASEDIR/data/$DI_CODENAME/yaboot/$yabootmsg \
| sed "s/\${MEDIA_TYPE}/CDROM/" \
| sed "s/\${DEBIAN_VERSION}/${CODENAME}/g" \
| sed "s/\${BUILD_DATE}/${BUILD_DATE}/g" \
| sed "s/\${DEFAULT_DESKTOP}/${DEFAULT_DESKTOP}/g" \
> $yabootmsg
if [ -n "$KERNEL_PARAMS" ]; then
sed -i "/^[[:space:]]\+append=\"/ s|append=\"|append=\"$KERNEL_PARAMS |" $yabootconf
fi
if [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi fi
if ! cp -a "$DI_DIR/$subarch/cdrom" "$subarch" && [ "$bitness" ]; then fi
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 done
if [ -f prep/vmlinuz-prep.initrd ]; then # Boot setup including config and help files comes from d-i.
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-prep-boot install/prep/vmlinuz-prep.initrd" mkdir -pv $PWD/CD$N
elif [ -f powerpc/vmlinuz-prep.initrd ]; then cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx)
# We are still missing this for prep
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-prep-boot install/powerpc/vmlinuz-prep.initrd" # Copy kernel and initrd
mkdir -p $INSTALLDIR
cp -lf cdrom/vmlinux $INSTALLDIR/
cp -lf cdrom/initrd.gz $INSTALLDIR/
# Add CHRP boot header
if [ -f CD$N/ppc/bootinfo.txt ] ; then
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-chrp-boot-part"
fi fi
# Copy pegasos forth script, since pegasos machines don't support yaboot yet.
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
# 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 exit 0

View File

@ -265,7 +265,6 @@ grub-ieee1275
busybox busybox
laptop-detect laptop-detect
quik quik
yaboot
powerpc-utils powerpc-utils
hfsutils hfsutils
mkvmlinuz mkvmlinuz