bootloader: fix arm64 install path

This fixes a regression introduced by
Ia99687815667c3cf5e82cf21d841d3b1008b8fa9

It turns out that [[ -d /usr/lib/grub/*-efi ]] is not a good check,
because [[ doesn't split that and try to glob match ( [ would ).  This
has resulted in us triggering this path on ARM64.

This is an x86-64 only check, because on other platforms we either
don't support EFI or are EFI only.  Restrict this check to get arm64
working again.

Change-Id: I6a75f8504826bcb0ac122d53dfb9faff975077f4
This commit is contained in:
Ian Wienand 2022-02-21 13:41:47 +11:00
parent b3e81b19e7
commit 0b48d74322

View File

@ -95,9 +95,12 @@ GRUB_OPTS="--force "
# * the boot images are placed in /usr/lib/grub/<cpu>-<platform> # * the boot images are placed in /usr/lib/grub/<cpu>-<platform>
# * i386-pc is used for BIOS-based machines # * i386-pc is used for BIOS-based machines
# http://www.gnu.org/software/grub/manual/grub.html#Installation # http://www.gnu.org/software/grub/manual/grub.html#Installation
# # * this check is only valid for x86_64; other platforms we support
if [[ -d /sys/firmware/efi && ! -d /usr/lib/grub/*-efi ]]; then # are either not EFI (ppc) or always EFI (arm64)
if [[ "x86_64 amd64" =~ ${ARCH} ]]; then
if [[ -d /sys/firmware/efi && ! -d /usr/lib/grub/x86_64-efi ]]; then
GRUB_OPTS="$GRUB_OPTS --target=i386-pc" GRUB_OPTS="$GRUB_OPTS --target=i386-pc"
fi
fi fi
if [[ "$ARCH" =~ "ppc" ]] ; then if [[ "$ARCH" =~ "ppc" ]] ; then