From: Maximilian Engelhardt Date: Mon, 7 Dec 2020 22:54:16 +0000 (+0100) Subject: d/xen-hypervisor-V-F.postinst.vsn-in: use reboot-required X-Git-Tag: archive/raspbian/4.14.1+11-gb0b734a8b3-1+rpi1^2~71 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a4763b0782f4c0445ff58c2e66f6bec22ed97f0b;p=xen.git d/xen-hypervisor-V-F.postinst.vsn-in: use reboot-required When updating the xen hypervisor, touch the /run/reboot-required file to indicate a reboot is required. Also add information about the package requesting the reboot to the /run/reboot-required.pkgs file. Closes: #862408 Signed-off-by: Maximilian Engelhardt Reviewed-by: Hans van Kranenburg --- diff --git a/debian/xen-hypervisor-V-F.postinst.vsn-in b/debian/xen-hypervisor-V-F.postinst.vsn-in index 1540842eec..623637b057 100644 --- a/debian/xen-hypervisor-V-F.postinst.vsn-in +++ b/debian/xen-hypervisor-V-F.postinst.vsn-in @@ -7,6 +7,20 @@ case "$1" in if command -v update-grub > /dev/null && [ -d /boot/grub ]; then update-grub || : fi + + # create or update /run/reboot-required{,.pkgs} if xen hypervisor is + # running + if [ -e "/sys/hypervisor/type" ]; then + type="$(cat /sys/hypervisor/type)" + if [ "$type" = xen ]; then + if [ -d /run ]; then + touch /run/reboot-required + if ! grep -q "^$DPKG_MAINTSCRIPT_PACKAGE$" /run/reboot-required.pkgs 2> /dev/null ; then + echo "$DPKG_MAINTSCRIPT_PACKAGE" >> /run/reboot-required.pkgs + fi + fi + fi + fi ;; abort-upgrade|abort-remove|abort-deconfigure)