Skip to content

Commit

Permalink
powerpc64: make autoboot possible on powernv machines
Browse files Browse the repository at this point in the history
It's required to specify a default boot option in order to make
petitboot's autoboot feature work.

Tested on Raptor Blackbird

Reviewed by:	imp, luporl
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D32838
  • Loading branch information
adalava committed Nov 26, 2021
1 parent e141b62 commit b6644f5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions usr.sbin/bsdinstall/scripts/bootconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#
# $FreeBSD$


FREEBSD_BOOTLABEL="FreeBSD"

BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1

Expand All @@ -41,8 +44,10 @@ if [ `uname -m` == powerpc ]; then
platform=`sysctl -n hw.platform`
if [ "$platform" == ps3 -o "$platform" == powernv ]; then
rootpart=$(awk '{ if($2 == "/") printf("%s:%s\n", $3, $1); }' $PATH_FSTAB)
kboot_conf=$BSDINSTALL_CHROOT/boot/etc/kboot.conf
mkdir -p $BSDINSTALL_CHROOT/boot/etc/
echo FreeBSD=\'/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=${rootpart}\' > $BSDINSTALL_CHROOT/boot/etc/kboot.conf
echo default=$FREEBSD_BOOTLABEL > $kboot_conf
echo $FREEBSD_BOOTLABEL=\'/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=${rootpart}\' >> $kboot_conf
fi
fi

Expand Down Expand Up @@ -81,11 +86,9 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then
cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}"
fi

bootlabel="FreeBSD"

if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
f_dprintf "Creating UEFI boot entry"
efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null
efibootmgr --create --activate --label "$FREEBSD_BOOTLABEL" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null
fi

f_dprintf "Finished configuring ESP"
Expand Down

0 comments on commit b6644f5

Please sign in to comment.