From ba7584561c91659a6277303397ed823805f6a762 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 2 Apr 2012 13:28:31 -0400 Subject: [PATCH] make_chroot: deploy pbzip2 early Make sure our chroot has pbzip2 as early as possible so we can leverage it later on in the build process as the default compressor. BUG=None TEST=semi-manual: - remove pbzip2 as soon as we've unpacked the chroot in make_chroot - run `cros_sdk` and see no pbzip2 warnings Change-Id: I27d00cdb97c5ffcde79eb04cfabbe6e82a72c706 Reviewed-on: https://gerrit.chromium.org/gerrit/19469 Reviewed-by: David James Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger --- sdk_lib/make_chroot.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 0a5d0984d2..4aaeb33c1c 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -93,9 +93,10 @@ function enter_chroot { # Invoke enter_chroot running the command as root, and w/out sudo. # This should be used prior to sudo being merged. +early_env=() function early_enter_chroot() { "$ENTER_CHROOT" --chroot "$FLAGS_chroot" --early_make_chroot \ - -- "${ENTER_CHROOT_ARGS[@]}" "$@" + -- "${ENTER_CHROOT_ARGS[@]}" "${early_env[@]}" "$@" } # Run a command within the chroot. The main usage of this is to avoid @@ -373,6 +374,14 @@ if ! [ -f "$CHROOT_STATE" ];then fi +if ! early_enter_chroot bash -c 'type -P pbzip2' >/dev/null ; then + # This chroot lacks pbzip2 early on, so we need to disable it. + early_env+=( + PORTAGE_BZIP2_COMMAND="bzip2" + PORTAGE_BUNZIP2_COMMAND="bunzip2" + ) +fi + if [ -z "${INITIALIZE_CHROOT}" ];then info "chroot already initialized. Skipping..." else @@ -408,7 +417,7 @@ early_enter_chroot $EMERGE_CMD --deselect dhcpcd info "Running emerge ccache curl sudo ..." early_enter_chroot $EMERGE_CMD -uNv $USEPKG --select $EMERGE_JOBS \ - ccache net-misc/curl sudo + pbzip2 ccache net-misc/curl sudo if [ -n "${INITIALIZE_CHROOT}" ]; then # If we're creating a new chroot, we also want to set it to the latest