Bug#813007: Fix container detection (running-in-container is an Ubuntu-ism)

Martin Pitt martin.pitt at ubuntu.com
Thu Jan 28 13:55:26 UTC 2016


Package: grub2
Version: 2.02~beta2-35
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch xenial

Hello,

grub2 currently tries to call running-in-container in its postinst and
zz-update-grub. This script is an Ubuntu-ism and going away (see
https://launchpad.net/bugs/1539016), and thus container detection does
not work under Debian.

Please use systemd-detect-virt --container instead, which works under
any init system (despite the name). running-in-container is just an
(overly complicated) wrapper around systemd-detect-virt.

debdiff attached.

Thanks for considering,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -Nru grub2-2.02~beta2/debian/changelog grub2-2.02~beta2/debian/changelog
--- grub2-2.02~beta2/debian/changelog	2016-01-22 12:02:11.000000000 +0100
+++ grub2-2.02~beta2/debian/changelog	2016-01-28 14:30:23.000000000 +0100
@@ -1,3 +1,10 @@
+grub2 (2.02~beta2-35ubuntu1) xenial; urgency=medium
+
+  * debian/postinst.in, debian/kernel/zz-update-grub: Call systemd-detect-virt
+    instead of the Ubuntu specific running-in-container wrapper. (LP: #1539016)
+
+ -- Martin Pitt <martin.pitt at ubuntu.com>  Thu, 28 Jan 2016 14:25:14 +0100
+
 grub2 (2.02~beta2-35) unstable; urgency=medium
 
   * Apply the arm64 -mpc-relative-literal-loads workaround in configure
diff -Nru grub2-2.02~beta2/debian/kernel/zz-update-grub grub2-2.02~beta2/debian/kernel/zz-update-grub
--- grub2-2.02~beta2/debian/kernel/zz-update-grub	2016-01-22 12:00:21.000000000 +0100
+++ grub2-2.02~beta2/debian/kernel/zz-update-grub	2016-01-28 14:27:16.000000000 +0100
@@ -3,8 +3,8 @@
 
 which update-grub >/dev/null 2>&1 || exit 0
 
-if type running-in-container >/dev/null 2>&1 && \
-   running-in-container >/dev/null; then
+if type systemd-detect-virt >/dev/null 2>&1 &&
+   systemd-detect-virt --quiet --container; then
 	exit 0
 fi
 
diff -Nru grub2-2.02~beta2/debian/postinst.in grub2-2.02~beta2/debian/postinst.in
--- grub2-2.02~beta2/debian/postinst.in	2016-01-22 12:00:21.000000000 +0100
+++ grub2-2.02~beta2/debian/postinst.in	2016-01-28 14:30:22.000000000 +0100
@@ -296,7 +296,7 @@
 
 running_in_container()
 {
-  type running-in-container >/dev/null 2>&1 && running-in-container >/dev/null
+  type systemd-detect-virt >/dev/null 2>&1 && systemd-detect-virt --quiet --container
 }
 
 run_grub_install()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20160128/46da53df/attachment.sig>


More information about the Pkg-grub-devel mailing list