summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/shim-signed.postinst16
1 files changed, 15 insertions, 1 deletions
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