Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: cros_generate_update_payload

Issue 6602018: scripts: allow calling cros_generate_update_payload from outside the chroot (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cros_generate_update_payload
diff --git a/cros_generate_update_payload b/cros_generate_update_payload
index b55f438526109e2db548938d8d5b588a5ede0ec9..4f5d86c12acbb5256384e209e012cca0eed71862 100755
--- a/cros_generate_update_payload
+++ b/cros_generate_update_payload
@@ -12,7 +12,8 @@
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
# location.
find_common_sh() {
- local common_paths=(/usr/lib/crosutils $(dirname "$(readlink -f "$0")"))
+ local thisdir="$(dirname "$(readlink -f "$0")")"
+ local common_paths=(/usr/lib/crosutils "${thisdir}")
local path
SCRIPT_ROOT=
@@ -22,17 +23,22 @@ find_common_sh() {
break
fi
done
+
+ # HACK(zbehan): We have to fake GCLIENT_ROOT in case we're running inside
+ # au_zip enviroment. GCLIENT_ROOT detection became fatal...
+ [ "${SCRIPT_ROOT}" == "${thisdir}" ] && \
+ export GCLIENT_ROOT="."
}
find_common_sh
. "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1)
# --- END COMMON.SH BOILERPLATE ---
-# Need to be inside the chroot to load chromeos-common.sh
-assert_inside_chroot
-
# Load functions and constants for chromeos-install
-. "/usr/lib/installer/chromeos-common.sh" || \
+# NOTE: Needs to be called from outside the chroot.
+. "/usr/lib/installer/chromeos-common.sh" &> /dev/null || \
+. "${SRC_ROOT}/platform/installer/chromeos-common.sh" &> /dev/null || \
+. "./chromeos-common.sh" || \
die "Unable to load /usr/lib/installer/chromeos-common.sh"
SRC_MNT=""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698