From 8e6750dee7152d15b2876c8b00655d11b92daf4c Mon Sep 17 00:00:00 2001 From: "J. Richard Barnette" Date: Mon, 22 Aug 2011 12:35:52 -0700 Subject: [PATCH] Clean up sdk_lib/enter_chroot.sh startup boilerplate. BUG=None TEST=run cros_sdk Change-Id: I39fafd58c7cc9fd536fe9b75f314f9970766a483 Reviewed-on: http://gerrit.chromium.org/gerrit/6414 Tested-by: Richard Barnette Reviewed-by: Chris Sosa Reviewed-by: David James --- sdk_lib/enter_chroot.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 33fb303017..e3635e5ed0 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -6,15 +6,8 @@ # Script to enter the chroot environment -# The script lives in scripts/ or scripts/sdk_lib/ -for path in "$(dirname $0)" "$(dirname $0)/../"; do - if [ -r "${path}/common.sh" ]; then - SCRIPT_ROOT=${path} - break - fi -done - -. "${SCRIPT_ROOT}/common.sh" || { echo "Unable to load common.sh"; exit 1; } +SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..) +. "${SCRIPT_ROOT}/common.sh" || exit 1 # Script must be run outside the chroot and as a regular user. assert_outside_chroot