]> git.proxmox.com Git - efi-boot-shim.git/commitdiff
Fix up the template maintainer scripts
authorSteve McIntyre <steve@einval.com>
Tue, 4 May 2021 13:45:00 +0000 (14:45 +0100)
committerSteve McIntyre <steve@einval.com>
Tue, 4 May 2021 16:53:23 +0000 (16:53 +0000)
if we're not running on an EFI system then exit cleanly

debian/changelog
debian/signing-template/@final_pkg_name@.postinst.in [changed mode: 0644->0755]
debian/signing-template/@final_pkg_name@.postrm.in [changed mode: 0644->0755]

index 996e79fb1df3882023280ba8bec54979437153d2..aacd2b24efde95b3b59bbb8069d66b1424820495 100644 (file)
@@ -1,3 +1,10 @@
+shim (15.4-4) unstable; urgency=medium
+
+  * Fix up those maintainer scripts - if we're not running on an EFI
+    system then exit cleanly.
+
+ -- Steve McIntyre <93sam@debian.org>  Tue, 04 May 2021 17:53:21 +0100
+
 shim (15.4-3) unstable; urgency=medium
 
   * Add maintainer scripts to the template packages to manage
old mode 100644 (file)
new mode 100755 (executable)
index 6da2a3d..17f54c8
@@ -1,6 +1,11 @@
 #! /bin/sh
 set -e
 
+# If we're not on an EFI system, do nothing
+if [ ! -d /sys/firmware/efi ]; then
+    exit 0
+fi
+
 # Must load the confmodule for our template to be installed correctly.
 . /usr/share/debconf/confmodule
 
@@ -53,7 +58,6 @@ case $1 in
        # needed
        if [ "$bootloader_id" ] && \
           [ -d "/boot/efi/EFI/$bootloader_id" ] && \
-          [ -d /sys/firmware/efi ] && \
           which grub-install >/dev/null 2>&1
        then
            # Check for some of the options that matter, so we can
old mode 100644 (file)
new mode 100755 (executable)
index cd261b1..2da291d
@@ -1,6 +1,11 @@
 #! /bin/sh
 set -e
 
+# If we're not on an EFI system, do nothing
+if [ ! -d /sys/firmware/efi ]; then
+    exit 0
+fi
+
 case @arch@ in
     i386)
        SHIM_REMOVE="mmia32.efi fbia32.efi";;
@@ -39,8 +44,7 @@ case $1 in
        # If we're being removed, remove the copies installed in the
        # ESP. grub-install doesn't clean those up for us.
        if [ "$bootloader_id" ] && \
-          [ -d "/boot/efi/EFI/$bootloader_id" ] && \
-          [ -d /sys/firmware/efi ]; then
+          [ -d "/boot/efi/EFI/$bootloader_id" ]; then
 
            cd /boot/efi/EFI/$bootloader_id
            rm -f $SHIM_REMOVE