Index: bin/cros_overlay_list |
diff --git a/bin/cros_overlay_list b/bin/cros_overlay_list |
index 2cf911a858141888a84037eadf03bdf69e79efe4..7031068261db71568b91fabc5147c27476a6f2c0 100755 |
--- a/bin/cros_overlay_list |
+++ b/bin/cros_overlay_list |
@@ -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}" |
Greg Spencer (Chromium)
2011/01/26 22:30:45
So, in my CL for cleaning things up, I've used the
robotboy
2011/01/26 23:07:38
I think I prefer to have the error checking and re
Greg Spencer (Chromium)
2011/01/26 23:47:46
No, that's fine. I might even adopt some of it fo
|
get_default_board |