summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-23 16:48:38 -0400
committerScott Moser <smoser@brickies.net>2016-08-23 16:48:38 -0400
commit2865eaceea68d592b03018d09c64f01fe3456a44 (patch)
tree4de2180a980a110b6949553de3050d7d28cd90cc
parente18ed85921139d34f015b43075a21335e87fb319 (diff)
downloadcloud-init-git-2865eaceea68d592b03018d09c64f01fe3456a44.tar.gz
Import version 0.7.7~bzr1156-0ubuntu2ubuntu/0.7.7_bzr1156-0ubuntu2
Imported using git-dsc-commit.
-rw-r--r--debian/changelog8
-rw-r--r--debian/cloud-init.postinst6
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/systemd_detect_virt.patch29
4 files changed, 41 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index b99e77de..8299adc9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+cloud-init (0.7.7~bzr1156-0ubuntu2) xenial; urgency=medium
+
+ * debian/cloud-init.postinst, systemd_detect_virt.patch: Call
+ systemd-detect-virt instead of the Ubuntu specific running-in-container
+ wrapper. (LP: #1539016)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com> Thu, 28 Jan 2016 14:12:51 +0100
+
cloud-init (0.7.7~bzr1156-0ubuntu1) xenial; urgency=medium
* New upstream snapshot.
diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst
index c0d31d46..90277be0 100644
--- a/debian/cloud-init.postinst
+++ b/debian/cloud-init.postinst
@@ -162,9 +162,9 @@ fix_1336855() {
[ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ] && return 0
# Check if we are in a container, i.e. LXC
- for t in running-in-container lxc-is-container; do
- command -v $t && $t && return 0
- done >/dev/null 2>&1
+ if systemd-detect-virt --quiet --container || lxc-is-container 2>/dev/null; then
+ return 0
+ fi
# Find out where grub thinks the root device is. Only continue if
# grub postinst would install/reinstall grub
diff --git a/debian/patches/series b/debian/patches/series
index e69de29b..d07203f9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+systemd_detect_virt.patch
diff --git a/debian/patches/systemd_detect_virt.patch b/debian/patches/systemd_detect_virt.patch
new file mode 100644
index 00000000..32961a20
--- /dev/null
+++ b/debian/patches/systemd_detect_virt.patch
@@ -0,0 +1,29 @@
+Description: Use systemd-detect-virt to detect a container. running-in-container is an Ubuntu-ism and going away.
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Forwarded: https://code.launchpad.net/~pitti/cloud-init/systemd-detect-virt/+merge/284278
+Bug-Ubuntu: https://launchpad.net/bugs/1539016
+
+Index: cloud-init-0.7.7~bzr1156/cloudinit/util.py
+===================================================================
+--- cloud-init-0.7.7~bzr1156.orig/cloudinit/util.py
++++ cloud-init-0.7.7~bzr1156/cloudinit/util.py
+@@ -76,7 +76,9 @@ FALSE_STRINGS = ('off', '0', 'no', 'fals
+
+
+ # Helper utils to see if running in a container
+-CONTAINER_TESTS = ('running-in-container', 'lxc-is-container')
++CONTAINER_TESTS = (['systemd-detect-virt', '--quiet', '--container'],
++ ['running-in-container'],
++ ['lxc-is-container'])
+
+
+ def decode_binary(blob, encoding='utf-8'):
+@@ -1749,7 +1751,7 @@ def is_container():
+ try:
+ # try to run a helper program. if it returns true/zero
+ # then we're inside a container. otherwise, no
+- subp([helper])
++ subp(helper)
+ return True
+ except (IOError, OSError):
+ pass