From fca690565375b167d947e53d15ffdcf93fbee181 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Tue, 4 May 2021 14:45:00 +0100 Subject: Fix up the template maintainer scripts if we're not running on an EFI system then exit cleanly --- debian/signing-template/@final_pkg_name@.postinst.in | 6 +++++- debian/signing-template/@final_pkg_name@.postrm.in | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) mode change 100644 => 100755 debian/signing-template/@final_pkg_name@.postinst.in mode change 100644 => 100755 debian/signing-template/@final_pkg_name@.postrm.in (limited to 'debian/signing-template') diff --git a/debian/signing-template/@final_pkg_name@.postinst.in b/debian/signing-template/@final_pkg_name@.postinst.in old mode 100644 new mode 100755 index 6da2a3d8..17f54c87 --- a/debian/signing-template/@final_pkg_name@.postinst.in +++ b/debian/signing-template/@final_pkg_name@.postinst.in @@ -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 diff --git a/debian/signing-template/@final_pkg_name@.postrm.in b/debian/signing-template/@final_pkg_name@.postrm.in old mode 100644 new mode 100755 index cd261b15..2da291d8 --- a/debian/signing-template/@final_pkg_name@.postrm.in +++ b/debian/signing-template/@final_pkg_name@.postrm.in @@ -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 -- cgit v1.2.3