diff options
author | Michael Schroeder <mls@suse.de> | 2018-10-22 14:29:33 +0200 |
---|---|---|
committer | Ren Jingui <jingui.ren@samsung.com> | 2019-01-29 12:01:58 +0000 |
commit | 7b538266c0d1db5e780b119b6e6811a59117618c (patch) | |
tree | e7c9db28023df1b979d3733992670248cdbca63b | |
parent | 0bcba402d8de752e79e943685da8ead2cc960aed (diff) | |
download | build-7b538266c0d1db5e780b119b6e6811a59117618c.tar.gz build-7b538266c0d1db5e780b119b6e6811a59117618c.tar.bz2 build-7b538266c0d1db5e780b119b6e6811a59117618c.zip |
Check if dpkg supports the --force-unsafe-io option
Change-Id: I26459cc056eb5adbb4e0299ebd755542dd41b9eb
-rw-r--r-- | build-pkg-deb | 12 | ||||
-rw-r--r-- | build-recipe-debootstrap | 4 |
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 |