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

Unified Diff: src/scripts/enter_chroot.sh

Issue 596102: Enter_chroot: Mount chrome browser source inside chroot. (Closed)
Patch Set: Created 10 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: src/scripts/enter_chroot.sh
diff --git a/src/scripts/enter_chroot.sh b/src/scripts/enter_chroot.sh
index f687c8645ffb1dec1c6bda6da2ca4785d4a9e622..f8450c361dc9055d8f92dca86a827b74f29b1149 100755
--- a/src/scripts/enter_chroot.sh
+++ b/src/scripts/enter_chroot.sh
@@ -22,6 +22,8 @@ DEFINE_string trunk "$GCLIENT_ROOT" \
"The source trunk to bind mount within the chroot." "s"
DEFINE_string build_number "" \
"The build-bot build number (when called by buildbot only)." "b"
+DEFINE_string chrome_root "" \
+ "The root of your chrome browser source. Should contain a 'src' subdir."
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
DEFINE_boolean mount $FLAGS_FALSE "Only set up mounts."
@@ -59,6 +61,9 @@ fi
# TODO: replace shflags with something less error-prone, or contribute a fix.
set -e
+INNER_CHROME_ROOT="/home/$USER/chrome_root" # inside chroot
+CHROME_ROOT_CONFIG="/var/cache/chrome_root" # inside chroot
+
sudo chmod 0777 "$FLAGS_chroot/var/lock"
LOCKFILE="$FLAGS_chroot/var/lock/enter_chroot"
@@ -88,6 +93,26 @@ function setup_env {
then
sudo mount --bind "$FLAGS_trunk" "$MOUNTED_PATH"
fi
+
+ MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}${INNER_CHROME_ROOT}")"
+ if [ -z "$(mount | grep -F "on $MOUNTED_PATH")" ]
+ then
+ CHROME_ROOT="$FLAGS_chrome_root"
+ if [ -z "$CHROME_ROOT" ]; then
+ ! CHROME_ROOT="$(cat "${FLAGS_chroot}${CHROME_ROOT_CONFIG}" \
+ 2>/dev/null)"
+ fi
+ if [[ ( -z "$CHROME_ROOT" ) || ( ! -d "${CHROME_ROOT}/src" ) ]]; then
+ echo "Not mounting chrome source"
+ sudo rm -f "${FLAGS_chroot}${CHROME_ROOT_CONFIG}"
+ else
+ echo "Mouting chrome source at: $INNER_CHROME_ROOT"
DaveMoore 2010/02/12 22:31:12 nit: spelling
+ echo "$CHROME_ROOT" | \
+ sudo dd of="${FLAGS_chroot}${CHROME_ROOT_CONFIG}"
+ mkdir -p "$MOUNTED_PATH"
+ sudo mount --bind "$CHROME_ROOT" "$MOUNTED_PATH"
+ fi
+ fi
) 200>>"$LOCKFILE"
}
« 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