Bug#775076: adt-setup-vm: sets force-unsafe-io for host dpkg, not guest

Martin Pitt mpitt at debian.org
Sun Jan 11 12:49:10 UTC 2015


Hello again,

Christian Kastner [2015-01-11  2:47 +0100]:
> I have attached a debdiff for the version in Jessie which includes the
> bugfix from my earlier patch, and adds a postinst in which the offending
> file is removed.

Thanks! I backported the other commit to fix the other missing $root's, and
cleaned up the postinst a bit. Attaching it here, and then will
contact the release team about a testing-proposed-updates upload.

I also uploaded yet another version 3.9.3 (sorry!) to unstable which
also includes the postinst cleanup bit.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff --git a/debian/changelog b/debian/changelog
index 9040131..7961f2e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+autopkgtest (3.6.1) UNRELEASED; urgency=medium
+
+  [ Christian Kastner ]
+  * adt-setup-vm: Modify guest's dpkg config for enabling force-unsafe-io, not
+    host's, when a root directory is specified as argument. (Closes: #775076)
+  * Clean up /etc/dpkg/dpkg.cfg.d/autopkgtest on upgrades if its contents are
+    just "force-unsafe-io", indicating that this file was generated by the
+    above bug.
+
+  [ Martin Pitt ]
+  * adt-setup-vm: Check guest's /etc/network/interfaces for existing eth0
+    instead of host's, when specifying a directory argument. (Spotted as a
+    side issue in #775076)
+
+ -- Martin Pitt <mpitt at debian.org>  Sun, 11 Jan 2015 13:32:13 +0200
+
 autopkgtest (3.6) unstable; urgency=medium
 
   [ Antonio Terceiro ]
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..ec51743
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl "3.6.1"; then
+    # If this file exists and its only content is "force-unsafe-io", then it was
+    # generated by #775076 and must be removed.
+    if [ -e /etc/dpkg/dpkg.cfg.d/autopkgtest ]; then
+            if [ "`cat /etc/dpkg/dpkg.cfg.d/autopkgtest`" = "force-unsafe-io" ]; then
+                    echo "Cleaning up erroneous /etc/dpkg/dpkg.cfg.d/autopkgtest..."
+                    rm -f /etc/dpkg/dpkg.cfg.d/autopkgtest
+            fi
+    fi
+fi
+
+#DEBHELPER#
diff --git a/tools/adt-setup-vm b/tools/adt-setup-vm
index 5c25781..4d01e54 100755
--- a/tools/adt-setup-vm
+++ b/tools/adt-setup-vm
@@ -68,13 +68,13 @@ EOF
 fi
 
 # set up networking
-if ! grep -qr eth0 /etc/network/interfaces /etc/network/interfaces.d/; then
+if ! grep -qr eth0 "$root/etc/network/interfaces" "$root/etc/network/interfaces.d/"; then
     /bin/echo -e '\nauto eth0\niface eth0 inet dhcp' >> "$root"/etc/network/interfaces
 fi
 
 # go-faster apt/dpkg
 echo "Acquire::Languages \"none\";" > "$root"/etc/apt/apt.conf.d/90nolanguages
-echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/autopkgtest
+echo 'force-unsafe-io' > "$root"/etc/dpkg/dpkg.cfg.d/autopkgtest
 
 # auto-detect apt-cacher-ng
 if [ -z "${ADT_APT_PROXY:-}" ]; then
-------------- 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/autopkgtest-devel/attachments/20150111/e86479c7/attachment.sig>


More information about the autopkgtest-devel mailing list