Update cros_overlay_list to work from either src/scripts or /usr/bin.

Change-Id: If4c2852568454c2dccf09b0fc1e180ed228a1bb7

BUG=chromium-os:4230
TEST=run cros_overlay_list from both locations in the chroot and src/scripts outside the chroot.

Review URL: http://codereview.chromium.org/6293021
This commit is contained in:
Anton Staaf 2011-01-27 09:38:46 -08:00
parent d6ca361c09
commit 95e56d1ca2

View File

@ -6,9 +6,24 @@
# This script generates the list of board overlays and variants.
# Load common constants. This should be the first executable line.
# The path to common.sh should be relative to your script's location.
. "$(dirname "$0")/../common.sh"
# Load common CrOS utilities. Inside the chroot this file is installed in
# /usr/lib/crosutils. Outside the chroot we find it relative to the scripts
# location.
common_paths="/usr/lib/crosutils $(dirname "$0")/.."
for path in ${common_paths} ; do
if [ -f "${path}/common.sh" ] ; then
COMMON_SH="${path}/common.sh"
break
fi
done
if [ -z "${COMMON_SH}" ] ; then
error "common.sh not found in search path (${common_paths})"
exit 1
fi
. "${COMMON_SH}"
get_default_board