[buildd-tools-devel] [PATCH] create-chroot: switch dpkg unsafe io on by default

Riku Voipio riku.voipio at iki.fi
Wed Jun 6 11:38:35 UTC 2012


Since buildd chroots are temporary by nature, we don't need safe
io while installing packages to the chroot. Especially for lvm
and tarball chroots, where the install results will be scrapped
after every build.

A more fined version of this change would only apply this change
the chroot when starting a build, but doing that seems overly
complicated.

Signed-off-by: Riku Voipio <riku.voipio at iki.fi>
---
 bin/create-chroot |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/create-chroot b/bin/create-chroot
index 2cac4b5..e405ac9 100755
--- a/bin/create-chroot
+++ b/bin/create-chroot
@@ -343,6 +343,14 @@ EOT
         sudo chown root: "${TARGET}/etc/dpkg/dpkg.cfg.d/force-confnew"
         sudo chmod 0644 "${TARGET}/etc/dpkg/dpkg.cfg.d/force-confnew"
 
+        TEMPFILE="$(mktemp)"
+        cat > "${TEMPFILE}" <<EOT
+force-unsafe-io
+EOT
+        sudo mv "${TEMPFILE}" "${TARGET}/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+        sudo chown root: "${TARGET}/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+        sudo chmod 0644 "${TARGET}/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+
         ensure_target_unmounted
     fi
 }
-- 
1.7.9.5




More information about the Buildd-tools-devel mailing list