summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-07-12 12:48:44 +0100
committerSteve McIntyre <steve@einval.com>2021-07-12 12:48:44 +0100
commitda0843e7d444c7c2c3d939d39b1a921a3092b2d5 (patch)
tree82e4b4e19d17e207f63c7f7c40222f82ac48cf2a
parent5cf4d57e204e557ecb8f3cb245710d2e47985992 (diff)
downloadshim-signed-da0843e7d444c7c2c3d939d39b1a921a3092b2d5.tar.gz
shim-signed-da0843e7d444c7c2c3d939d39b1a921a3092b2d5.zip
Tweak how we call grub-install; don't abort on error
Not ideal behaviour either, but don't break upgrades. Copy the behaviour from the grub packages here. Closes: #990984
-rw-r--r--debian/changelog8
-rwxr-xr-xdebian/shim-signed.postinst12
-rwxr-xr-xdebian/shim-signed.postrm12
3 files changed, 30 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index d78ac2a..87a6e37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+shim-signed (1.38) unstable; urgency=medium
+
+ * Tweak how we call grub-install; don't abort on error. Not ideal
+ behaviour either, but don't break upgrades. Copy the behaviour
+ from the grub packages here. Closes: #990984
+
+ -- Steve McIntyre <93sam@debian.org> Mon, 12 Jul 2021 12:46:52 +0100
+
shim-signed (1.37) unstable; urgency=medium
* Build against new signed binaries corresponding to 15.4-6
diff --git a/debian/shim-signed.postinst b/debian/shim-signed.postinst
index f850043..1ddd00a 100755
--- a/debian/shim-signed.postinst
+++ b/debian/shim-signed.postinst
@@ -48,6 +48,15 @@ config_item ()
eval echo "\$$1"
}
+# Call grub-install but don't fail on errors. Let's not break upgrades
+run_grub_install()
+{
+ if ! grub-install $@ ; then
+ echo "Failed: grub-install $@" >&2
+ echo "WARNING: Bootloader is not properly installed, system may not be bootable" >&2
+ fi
+}
+
case $1 in
configure)
bootloader_id="$(config_item GRUB_DISTRIBUTOR | tr A-Z a-z | \
@@ -76,7 +85,8 @@ case $1 in
OPTIONS="$OPTIONS --no-nvram"
fi
- grub-install --target=${GRUB_EFI_TARGET} $OPTIONS
+ run_grub_install --target=${GRUB_EFI_TARGET} $OPTIONS
+
if dpkg --compare-versions "$2" lt-nl "1.22~"; then
rm -f /boot/efi/EFI/ubuntu/MokManager.efi
fi
diff --git a/debian/shim-signed.postrm b/debian/shim-signed.postrm
index a161df8..9db2640 100755
--- a/debian/shim-signed.postrm
+++ b/debian/shim-signed.postrm
@@ -51,6 +51,15 @@ config_item ()
eval echo "\$$1"
}
+# Call grub-install but don't fail on errors. Let's not break upgrades
+run_grub_install()
+{
+ if ! grub-install $@ ; then
+ echo "Failed: grub-install $@" >&2
+ echo "WARNING: Bootloader is not properly installed, system may not be bootable" >&2
+ fi
+}
+
case $1 in
remove|purge)
bootloader_id="$(config_item GRUB_DISTRIBUTOR | tr A-Z a-z | \
@@ -79,7 +88,8 @@ case $1 in
OPTIONS="$OPTIONS --no-nvram"
fi
- grub-install --target=${GRUB_EFI_TARGET} $OPTIONS
+ run_grub_install --target=${GRUB_EFI_TARGET} $OPTIONS
+
if dpkg --compare-versions "$2" lt-nl "1.22~"; then
rm -f /boot/efi/EFI/ubuntu/MokManager.efi
fi