make_chroot: handle make.conf files in /etc and /etc/portage
Newer stages are putting config files into /etc/portage. Make sure we
clean them out before setting up /etc.
At some point we should migrate to /etc/portage, but this version is
designed to work with our current code base.
BUG=chromium:218085
TEST=`cbuildbot chromiumos-sdk` passes
Change-Id: I3e88909f1d8d46cdb4eef811236abc52554348ec
Reviewed-on: https://gerrit.chromium.org/gerrit/46230
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh
index bea08ce..376a2c6 100755
--- a/sdk_lib/make_chroot.sh
+++ b/sdk_lib/make_chroot.sh
@@ -197,10 +197,10 @@
# and a pointer to pre-built packages.
# TODO: This should really be part of a profile in the portage.
info "Setting up /etc/make.*..."
- mv "${FLAGS_chroot}"/etc/make.conf{,.orig}
+ rm -f "${FLAGS_chroot}"/etc/{,portage/}make.{conf,profile}
+ mkdir -p "${FLAGS_chroot}/etc/portage"
ln -sf "${CHROOT_CONFIG}/make.conf.amd64-host" \
"${FLAGS_chroot}/etc/make.conf"
- mv "${FLAGS_chroot}"/etc/make.profile{,.orig}
ln -sf "${CHROOT_OVERLAY}/profiles/default/linux/amd64/10.0" \
"${FLAGS_chroot}/etc/make.profile"
@@ -405,7 +405,6 @@
INITIALIZE_CHROOT=1
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+=(