summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-05-04 17:37:50 +0100
committerSteve McIntyre <steve@einval.com>2021-05-04 17:37:50 +0100
commit52ef752276b5d62613ecbfcfb97c3f3ee2f84220 (patch)
tree9091991f014b033ed8803676a9847ddc8386f67b /debian
parent8a90bd14b054030e92bbb7027b565e999e27d371 (diff)
downloadshim-signed-52ef752276b5d62613ecbfcfb97c3f3ee2f84220.tar.gz
shim-signed-52ef752276b5d62613ecbfcfb97c3f3ee2f84220.zip
If we're not running on an EFI system then exit cleanly
in postinst and postrm. We have nothing to do here. Closes: #988059
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog2
-rwxr-xr-xdebian/shim-signed.postinst10
-rwxr-xr-xdebian/shim-signed.postrm10
3 files changed, 18 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index f2ac4dd..ce3864c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ shim-signed (1.35) unstable; urgency=medium
* Add explicit dependency from shim-signed to shim-signed-common.
Also check if we have update-secureboot-policy available before we
try to call it. Closes: #988047, #988056
+ * If we're not running on an EFI system then exit cleanly in
+ postinst and postrm. We have nothing to do here. Closes: #988059
-- Steve McIntyre <93sam@debian.org> Tue, 04 May 2021 09:37:09 +0100
diff --git a/debian/shim-signed.postinst b/debian/shim-signed.postinst
index d4850e1..c5d7247 100755
--- a/debian/shim-signed.postinst
+++ b/debian/shim-signed.postinst
@@ -1,6 +1,11 @@
#! /bin/sh
set -e
+# If we're not on an EFI system, do nothing else
+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
@@ -77,7 +81,9 @@ case $1 in
fi
# Finally, trigger the policy script from the -common package
- SHIM_NOTRIGGER=y update-secureboot-policy
+ if which update-secureboot-policy >/dev/null 2>&1; then
+ SHIM_NOTRIGGER=y update-secureboot-policy
+ fi
;;
esac
diff --git a/debian/shim-signed.postrm b/debian/shim-signed.postrm
index cd62504..d8f7c61 100755
--- a/debian/shim-signed.postrm
+++ b/debian/shim-signed.postrm
@@ -1,6 +1,11 @@
#! /bin/sh
set -e
+# If we're not on an EFI system, do nothing else
+if [ ! -d /sys/firmware/efi ]; then
+ exit 0
+fi
+
# Must load the confmodule for our template to be installed correctly.
. /usr/share/debconf/confmodule
@@ -56,7 +61,6 @@ case $1 in
# from the boot chain in the ESP
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
@@ -83,7 +87,9 @@ case $1 in
rm -f "/boot/efi/EFI/$bootloader_id/$SHIM_REMOVE"
fi
- SHIM_NOTRIGGER=y update-secureboot-policy
+ if which update-secureboot-policy >/dev/null 2>&1; then
+ SHIM_NOTRIGGER=y update-secureboot-policy
+ fi
;;
esac