summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2018-10-22 14:29:33 +0200
committerjingui.ren <jingui.ren@samsung.com>2019-01-25 14:34:02 +0800
commitc13186c9c817d86d7daa7914bca01784b496877c (patch)
treee7c9db28023df1b979d3733992670248cdbca63b
parentb7acacb26a380d40d3881681f9e55cbc240d4f59 (diff)
downloadbuild-c13186c9c817d86d7daa7914bca01784b496877c.tar.gz
build-c13186c9c817d86d7daa7914bca01784b496877c.tar.bz2
build-c13186c9c817d86d7daa7914bca01784b496877c.zip
Change-Id: I26459cc056eb5adbb4e0299ebd755542dd41b9eb
-rw-r--r--build-pkg-deb12
-rw-r--r--build-recipe-debootstrap4
2 files changed, 13 insertions, 3 deletions
diff --git a/build-pkg-deb b/build-pkg-deb
index 539952f..bb937a9 100644
--- a/build-pkg-deb
+++ b/build-pkg-deb
@@ -21,6 +21,8 @@
#
################################################################
+DEB_UNSAFE_IO=
+
#
# A wrapper around chroot to set the environment correctly for dpkg and
# pre/postinst scripts.
@@ -58,15 +60,19 @@ pkg_initdb_deb() {
rm -f "$BUILD_ROOT"/.init_b_cache/dpkg.deb
cp "$BUILD_ROOT"/.init_b_cache/rpms/dpkg.deb "$BUILD_ROOT"/.init_b_cache/dpkg.deb || cleanup_and_exit 1
fi
- deb_chroot "$BUILD_ROOT" dpkg --install --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1
+ DEB_UNSAFE_IO=
+ chroot "$BUILD_ROOT" dpkg --force-unsafe-io --version >/dev/null 2>&1 && DEB_UNSAFE_IO="--force-unsafe-io"
+ deb_chroot "$BUILD_ROOT" dpkg --install $DEB_UNSAFE_IO --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1
}
pkg_prepare_deb() {
- :
+ # test if dpkg knows --force-unsafe-io
+ DEB_UNSAFE_IO=
+ chroot $BUILD_ROOT dpkg --force-unsafe-io --version >/dev/null 2>&1 && DEB_UNSAFE_IO="--force-unsafe-io"
}
pkg_install_deb() {
- ( deb_chroot "$BUILD_ROOT" dpkg --install --force-depends .init_b_cache/$PKG.deb 2>&1 || touch "$BUILD_ROOT"/exit ) | \
+ ( deb_chroot "$BUILD_ROOT" dpkg --install $DEB_UNSAFE_IO --force-depends .init_b_cache/$PKG.deb 2>&1 || touch "$BUILD_ROOT"/exit ) | \
perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg|Preparing to unpack )/||/^$/||print'
# ugly workaround for upstart system. some packages (procps) try
# to start a service in their configure phase. As we don't have
diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
index 62ab7d5..c2fb263 100644
--- a/build-recipe-debootstrap
+++ b/build-recipe-debootstrap
@@ -45,6 +45,10 @@ recipe_build_debootstrap() {
done
FULL_PKG_LIST="${FULL_PKG_LIST#,}"
rm -rf "$BUILD_ROOT/$myroot"
+ if chroot $BUILD_ROOT dpkg --force-unsafe-io --version >/dev/null 2>&1 ; then
+ mkdir -p "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d"
+ echo force-unsafe-io > "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+ fi
set -- chroot $BUILD_ROOT debootstrap --keep-debootstrap-dir --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries
echo "running debootstrap..."
if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then