Revert "Force our umount w/in the chroot."

This change breaks the chromiumos_sdk builder.  See

http://uberchromegw.corp.google.com/i/chromiumos/builders/chromiumos%20sdk/builds/2314/steps/BuildBoard/logs/stdio

This reverts commit 23da619f13

Change-Id: I47aa6e94aa0c62494cc40e9964f25097d3353322
Reviewed-on: https://gerrit.chromium.org/gerrit/32349
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
This commit is contained in:
Chris Sosa 2012-09-05 19:56:53 -07:00
parent 15a884825a
commit 389634d71c
4 changed files with 3 additions and 43 deletions

View File

@ -1,12 +0,0 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Ensure that crosutils path overrides are in use; note that chroot
# creation also invokes this, thus why we check for CROS_CHROOT; for
# the normal upgrade pathway, it's non existant. For chroot creation,
# It points to the chroot base.
echo 'export PATH="/usr/local/path-overrides${PATH:+:${PATH}}"' | \
sudo tee "${CROS_CHROOT}"/etc/profile.d/crosutils-path-overrides.sh \
> /dev/null
sudo chmod 644 "${CROS_CHROOT}"/etc/profile.d/crosutils-path-overrides.sh

View File

@ -466,12 +466,12 @@ assert_not_root_user() {
# Usage: check_flags_only_and_allow_null_arg "$@" && set --
check_flags_only_and_allow_null_arg() {
do_shift=1
if [ $# = 1 -a -z "$1" ]; then
if [[ $# == 1 && -z "$@" ]]; then
echo "$0: warning: ignoring null argument" >&2
shift
do_shift=0
fi
if [ $# -gt 0 ]; then
if [[ $# -gt 0 ]]; then
echo "error: invalid arguments: \"$@\"" >&2
flags_help
exit 1
@ -1071,22 +1071,3 @@ switch_to_strict_mode() {
# TODO: Re-enable this once shflags is set -e safe.
#switch_to_strict_mode
# The following code is used to ensure our umount wrapper is in use.
# Shouldn't be invoked by anything other than common.sh
_enable_path_overrides(){
# Ensure that our PATH overrides are in use.
local override_dir=$(readlink -f "${SCRIPT_ROOT}/path-overrides")
local IFS=:
local x
for x in ${PATH}; do
x=$(readlink -f "${x}")
if [ "${x}" = "${override_dir}" ]; then
# Already is in path; nothing more to do.
return
fi
done
export PATH="${override_dir}${PATH:+:${PATH}}"
}
_enable_path_overrides

View File

@ -274,13 +274,9 @@ setup_env() {
queue_mount /run/shm "--bind" /run/shm
fi
fi
# Get path overrides for the chroot in place now- it's possible
# that they may be needed for early teardown.
queue_mount "${FLAGS_trunk}/src/scripts/path-overrides" "--bind" \
"/usr/local/path-overrides"
queue_mount "${FLAGS_trunk}" "--bind" "${CHROOT_TRUNK_DIR}"
debug "Setting up referenced repositories if required."
REFERENCE_DIR=$(git config --file \
"${FLAGS_trunk}/.repo/manifests.git/config" \

View File

@ -177,11 +177,6 @@ init_setup () {
sudo bash -e "${SCRIPT_ROOT}/chroot_version_hooks.d/45_rewrite_sudoers.d" \
"${FLAGS_chroot}" "${USER}" "${ENVIRONMENT_WHITELIST[@]}"
# Turn on the path overrides; subshelled to protect our env from whatever
# vars the scriptlet may bleed.
( CROS_CHROOT="${FLAGS_chroot}"
. "${SCRIPT_ROOT}/chroot_version_hooks.d/47_path_overrides" )
sudo find "${FLAGS_chroot}/etc/"sudoers* -type f -exec chmod 0440 {} +
# Fix bad group for some.
sudo chown -R root:root "${FLAGS_chroot}/etc/"sudoers*