mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
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 <davidjames@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
b51593405b
commit
ba7584561c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user