From ea82dfb4dc31710def63a40f392f57413b9ff0f0 Mon Sep 17 00:00:00 2001 From: "J. Richard Barnette" Date: Wed, 6 Jun 2012 15:55:45 -0700 Subject: [PATCH] Don't look in chroot-based paths outside the chroot, even in jest. When bootstrapping a chroot, the test for "is this a private source tree repo" looked under the source tree in ~/trunk/src. That test was reliable inside the chroot (during update_chroot), but from outside the chroot (during bootstrapping) it depended on whether the user had a ~/trunk/src with a certain file. This change enforces correct behavior outside the chroot regardless of the contents of the user's home directory. BUG=chromium-os:31602 TEST=run the test case described in the bug report Change-Id: I2150347fbad9c84af537f8c572908e6e5ce312b4 Reviewed-on: https://gerrit.chromium.org/gerrit/24659 Tested-by: Richard Barnette Reviewed-by: David James Commit-Ready: Richard Barnette Reviewed-by: Mike Frysinger --- sdk_lib/make_conf_util.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sdk_lib/make_conf_util.sh b/sdk_lib/make_conf_util.sh index 5fd6e72ec8..b4ce74c62a 100644 --- a/sdk_lib/make_conf_util.sh +++ b/sdk_lib/make_conf_util.sh @@ -46,14 +46,16 @@ _make_conf_prebuilt() { # Include configuration settings for building private overlay # packages, if the overlay is present. # -# N.B. The test for the presence of the private overlay uses a path -# that only exists inside the chroot. When this function is invoked -# during bootstrapping, the test will fail, meaning the private -# overlay won't be used during bootstrapping. This is OK for -# current requirements. If you're reading this comment because you -# can't get the private overlay included during bootstrapping, this -# is your bug. :-) +# N.B. We explicitly disallow creating content for the private +# overlay during bootstrapping, as it's not currently required, +# and at least a minor nuisance to implement. Note also that the +# use of an inside-the-chroot path is based on the (currently true) +# assumption that bootstrapping use is outside the chroot, and +# non-bootstrapping use is inside the chroot. _make_conf_private() { + if [ "$1" = "wget" ] ; then + return + fi local chromeos_overlay="src/private-overlays/chromeos-overlay" chromeos_overlay="$CHROOT_TRUNK_DIR/$chromeos_overlay" if [ -d "$chromeos_overlay" ]; then @@ -83,7 +85,7 @@ _create_host_setup() { ( echo "# Automatically generated. EDIT THIS AND BE SORRY." echo _make_conf_fetchcommand "$fetchtype" - _make_conf_private + _make_conf_private "$fetchtype" _make_conf_prebuilt echo 'MAKEOPTS="-j'${NUM_JOBS}'"' ) | sudo_clobber "$host_setup" sudo chmod 644 "$host_setup"