debian: call update-grub when installing/removing xen-hypervisor-common
authorMaximilian Engelhardt <maxi@daemonizer.de>
Sun, 24 Oct 2021 17:24:17 +0000 (19:24 +0200)
committerHans van Kranenburg <hans@knorrie.org>
Fri, 17 Dec 2021 10:53:04 +0000 (11:53 +0100)
This fixes #988901 as now update-grub will be called by all packages
that can affect the state of the update-grub generated output.

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
debian/xen-hypervisor-common.postinst [new file with mode: 0644]
debian/xen-hypervisor-common.postrm [new file with mode: 0644]

diff --git a/debian/xen-hypervisor-common.postinst b/debian/xen-hypervisor-common.postinst
new file mode 100644 (file)
index 0000000..1540842
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+    configure)
+        if command -v update-grub > /dev/null && [ -d /boot/grub ]; then
+            update-grub || :
+        fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+       echo "postinst called with unknown argument \`$1'" >&2
+       exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/xen-hypervisor-common.postrm b/debian/xen-hypervisor-common.postrm
new file mode 100644 (file)
index 0000000..4833411
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+    remove)
+        if command -v update-grub > /dev/null && [ -d /boot/grub ]; then
+            update-grub || :
+        fi
+    ;;
+
+    purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0