From eec2f2f376f8c1cdbbfc72228839e663c99f98c6 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Mon, 22 Apr 2019 17:53:27 +0100 Subject: For grub-install, work out the right target name Don't assume that we're on amd64 so we want x86_64-efi ... --- debian/shim-signed.postinst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/shim-signed.postinst b/debian/shim-signed.postinst index 89d445d..99e8b0d 100644 --- a/debian/shim-signed.postinst +++ b/debian/shim-signed.postinst @@ -4,6 +4,20 @@ set -e # Must load the confmodule for our template to be installed correctly. . /usr/share/debconf/confmodule +ARCH=$(dpkg --print-architecture) +case ${ARCH} in + amd64) + GRUB_EFI_TARGET="x86_64-efi";; + i386) + GRUB_EFI_TARGET="i386-efi";; + arm64) + GRUB_EFI_TARGET="arm64-efi";; + *) + echo "Unsupported dpkg architecture ${ARCH} in $0. ABORT" + exit 1 + ;; +esac + config_item () { if [ -f /etc/default/grub ]; then @@ -30,7 +44,7 @@ case $1 in if [ "$bootloader_id" ] && [ -d "/boot/efi/EFI/$bootloader_id" ] \ && which grub-install >/dev/null 2>&1 then - grub-install --target=x86_64-efi + grub-install --target=${GRUB_EFI_TARGET} if dpkg --compare-versions "$2" lt-nl "1.22~"; then rm -f /boot/efi/EFI/ubuntu/MokManager.efi fi -- cgit v1.2.3