From a9471fa61746bd1af69ca8459f386740dcc0b6f2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:22:43 +0200 Subject: Using dpkg with --force-unsafe-io to improve performance. Signed-off-by: Daniel Baumann --- .../progress-linux/0001-dpkg-force-unsafe-io.patch | 73 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 74 insertions(+) create mode 100644 debian/patches/progress-linux/0001-dpkg-force-unsafe-io.patch create mode 100644 debian/patches/series diff --git a/debian/patches/progress-linux/0001-dpkg-force-unsafe-io.patch b/debian/patches/progress-linux/0001-dpkg-force-unsafe-io.patch new file mode 100644 index 0000000..cf97750 --- /dev/null +++ b/debian/patches/progress-linux/0001-dpkg-force-unsafe-io.patch @@ -0,0 +1,73 @@ +Author: Daniel Baumann +Description: Using dpkg with --force-unsafe-io to improve performance. + +diff -Naurp debootstrap.orig/scripts/debian-common debootstrap/scripts/debian-common +--- debootstrap.orig/scripts/debian-common ++++ debootstrap/scripts/debian-common +@@ -1,3 +1,13 @@ ++case $CODENAME in ++ etch*|lenny) ++ dpkg_force_unsafe_io="" ++ ;; ++ ++ *) ++ dpkg_force_unsafe_io="--force-unsafe-io" ++ ;; ++esac ++ + if doing_variant fakechroot; then + test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" + fi +@@ -102,7 +112,7 @@ Status: install ok installed" >> "$TARGE + x_feign_install dpkg + + x_core_install () { +- smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") ++ smallyes '' | in_target dpkg --force-depends $dpkg_force_unsafe_io --install $(debfor "$@") + } + + p () { +@@ -163,7 +173,7 @@ Status: install ok installed" >> "$TARGE + + smallyes '' | + (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ +- dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | ++ dpkg --status-fd 8 --force-depends $dpkg_force_unsafe_io --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING + + info CONFREQ "Configuring required packages..." +@@ -184,7 +194,7 @@ echo \"Warning: Fake start-stop-daemon c + + smallyes '' | + (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ +- dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | ++ dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends $dpkg_force_unsafe_io 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING + + baseprog=0 +@@ -201,7 +211,7 @@ echo \"Warning: Fake start-stop-daemon c + # XXX: progress is tricky due to how dpkg_progress works + # -- cjwatson 2009-07-29 + p; smallyes '' | +- in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) ++ in_target dpkg --force-overwrite --force-confold $dpkg_force_unsafe_io --skip-same-version --install $(debfor $predep) + base=$(without "$base" "$predep") + done_predeps="$done_predeps $predep" + done +@@ -209,14 +219,14 @@ echo \"Warning: Fake start-stop-daemon c + if [ -n "$base" ]; then + smallyes '' | + (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ +- dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | ++ dpkg --status-fd 8 --force-overwrite --force-confold $dpkg_force_unsafe_io --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING + + info CONFBASE "Configuring the base system..." + + smallyes '' | + (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ +- dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | ++ dpkg --status-fd 8 --force-confold --skip-same-version $dpkg_force_unsafe_io --configure -a 8>&1 1>&7 || echo EXITCODE $?) | + dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING + fi + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..1f1511f --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +progress-linux/0001-dpkg-force-unsafe-io.patch -- cgit v1.2.3