summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2019-04-22 17:53:27 +0100
committerSteve McIntyre <steve@einval.com>2019-04-22 17:53:27 +0100
commiteec2f2f376f8c1cdbbfc72228839e663c99f98c6 (patch)
tree24bcf1d13ec560b1cb6e8d5865373b26aafb32d5 /debian
parent66927f4fb8caf37e99a760962a0e0e07ce56fcf1 (diff)
downloadshim-signed-eec2f2f376f8c1cdbbfc72228839e663c99f98c6.tar.gz
shim-signed-eec2f2f376f8c1cdbbfc72228839e663c99f98c6.zip
For grub-install, work out the right target name
Don't assume that we're on amd64 so we want x86_64-efi ...
Diffstat (limited to 'debian')
-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