Switch bootloader from silo to grub-ieee1275 on sparc
This commit is contained in:
parent
1e09a3153f
commit
a364f3b9d5
|
@ -15,6 +15,7 @@ debian-cd (3.1.24) UNRELEASED; urgency=medium
|
||||||
* 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
|
* Switch bootloader from yaboot to grub-ieee1275 on powerpc
|
||||||
* Switch bootloader from yaboot to grub-ieee1275 on ppc64
|
* Switch bootloader from yaboot to grub-ieee1275 on ppc64
|
||||||
|
* Switch bootloader from silo to grub-ieee1275 on sparc
|
||||||
|
|
||||||
-- 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
|
||||||
|
|
||||||
|
|
|
@ -1,93 +1,86 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash
|
||||||
#
|
|
||||||
# boot-sparc
|
|
||||||
#
|
#
|
||||||
# Do install stuff for sparc, including making first CD bootable
|
# Do install stuff for sparc, 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
|
. $BASEDIR/tools/boot/$DI_CODENAME/common.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
#set -x
|
||||||
|
|
||||||
N=$1
|
N=$1
|
||||||
CDDIR=$2
|
CDDIR=$2
|
||||||
|
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 sparc
|
||||||
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G $CDDIR/../CD1/cdboot.img"
|
||||||
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-B '...'"
|
||||||
|
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "--grub2-sparc-core /boot/grub/core.img"
|
||||||
|
|
||||||
# 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
|
||||||
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"
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DI_WWW_HOME" = "default" ]; then
|
if [ "$DI_WWW_HOME" = "default" ]; then
|
||||||
DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc/daily/cdrom/"
|
DI_WWW_HOME="https://d-i.debian.org/daily-images/sparc/daily"
|
||||||
try_di_image_cache
|
try_di_image_cache
|
||||||
else
|
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
|
||||||
|
|
||||||
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-G boot1/boot/isofs.b -B ..."
|
case "$MKISOFS" in
|
||||||
add_mkisofs_opt $CDDIR/../$N.mkisofs_dirs "boot1"
|
*xorriso*)
|
||||||
|
XORRISO_VER=$(xorriso_version)
|
||||||
inst=boot1
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: debian-cd now depends on xorriso for making sparc bootable CDs."
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd $CDDIR/..
|
cd $CDDIR/..
|
||||||
|
|
||||||
# Setup directories
|
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinux cdrom/debian-cd_info.tar.gz"
|
||||||
mkdir -p $inst/boot
|
|
||||||
|
|
||||||
silo_deb=$(find_pkg_file silo)
|
# Download boot images.
|
||||||
if [ -z "$silo_deb" ]; then
|
for image in $BOOT_IMAGES; do
|
||||||
echo "ERROR: silo package is required"
|
if [ ! -e "$image" ]; then
|
||||||
exit 1
|
dir=$(dirname $image)
|
||||||
fi
|
mkdir -p $dir
|
||||||
# put the relevant parts of SILO boot loader
|
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
|
||||||
(dpkg --fsys-tarfile $MIRROR/$silo_deb | \
|
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
|
||||||
tar xf - -C $inst/ ./boot/{isofs,second}.b)
|
elif [ ! "$DI_WWW_HOME" ];then
|
||||||
|
if [ ! "$DI_DIR" ];then
|
||||||
|
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
|
||||||
|
fi
|
||||||
|
cp "$DI_DIR/$image" "$image"
|
||||||
|
else
|
||||||
|
$WGET "$DI_WWW_HOME/$image" -O "$image"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ -n "$ARCHIVE_EXTRACTED_SOURCES" ]; then
|
# Boot setup including config and help files comes from d-i.
|
||||||
echo $silo_deb >> $CDDIR/../$N.pkgs_extracted
|
mkdir -pv $PWD/CD$N
|
||||||
find_pkg_file silo source >> $CDDIR/../$N.pkgs_extracted
|
cat cdrom/debian-cd_info.tar.gz | (cd CD$N/; tar zx)
|
||||||
fi
|
|
||||||
|
|
||||||
# Some custom etc files
|
# Prepend cdboot.img with 512 zero bytes as block 0 contains
|
||||||
cp -f -p $BASEDIR/data/${CODENAME}/sparc/silo.conf $inst/boot/
|
# the SUN disk label and would get overwritten by xorriso
|
||||||
if [ -n "$KERNEL_PARAMS" ]; then
|
dd if=/dev/zero of=$CDDIR/../CD1/cdboot.img bs=512 count=1
|
||||||
# Add KERNEL_PARAMS to any existing append line
|
dd if=$CDDIR/../CD1/boot/grub/sparc64-ieee1275/cdboot.img of=$CDDIR/../CD1/cdboot.img bs=512 count=1 oflag=append conv=notrunc
|
||||||
sed -i "/^[[:space:]]*append=\"/ s|append=\"|append=\"$KERNEL_PARAMS |" \
|
|
||||||
$inst/boot/silo.conf
|
|
||||||
# If there is no default append= line, add it
|
|
||||||
if ! grep -q "^append=" $inst/boot/silo.conf; then
|
|
||||||
sed -i "/^default=/ a\append=\"$KERNEL_PARAMS\"" \
|
|
||||||
$inst/boot/silo.conf
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cat $BASEDIR/data/${CODENAME}/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
|
|
||||||
cp $BASEDIR/data/${CODENAME}/sparc/notsupported.txt $inst/boot/
|
|
||||||
|
|
||||||
# Sparc64 kernel is so big, that uncompressing it corrupts SILO memory, so
|
# Copy kernel and initrd
|
||||||
# uncompress it before hand.
|
mkdir -p $INSTALLDIR
|
||||||
|
cp -lf cdrom/vmlinux $INSTALLDIR/
|
||||||
|
cp -lf cdrom/initrd.gz $INSTALLDIR/
|
||||||
|
|
||||||
if [ ! "$DI_WWW_HOME" ];then
|
exit 0
|
||||||
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
|
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
|
@ -235,7 +235,6 @@ grub-efi-arm64-bin
|
||||||
initramfs-tools
|
initramfs-tools
|
||||||
grub-ieee1275
|
grub-ieee1275
|
||||||
busybox
|
busybox
|
||||||
silo
|
|
||||||
libc6-sparcv9b
|
libc6-sparcv9b
|
||||||
libc6-sparcv9
|
libc6-sparcv9
|
||||||
linux-image-sparc32
|
linux-image-sparc32
|
||||||
|
|
Loading…
Reference in New Issue