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

Side by Side Diff: enter_chroot.sh

Issue 3249008: Copying .subversion directory into the chroot, (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: fixed code review comments. Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # Script to enter the chroot environment 7 # Script to enter the chroot environment
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 # Note that this fixes $CHROMEOS_REVISION at the time the chroot is 252 # Note that this fixes $CHROMEOS_REVISION at the time the chroot is
253 # entered. That's ok for the main use case of automated builds, 253 # entered. That's ok for the main use case of automated builds,
254 # which pass each command line into a separate call to enter_chroot 254 # which pass each command line into a separate call to enter_chroot
255 # so always have up-to-date info. For developer builds, there may not 255 # so always have up-to-date info. For developer builds, there may not
256 # be a single revision, since the developer may have 256 # be a single revision, since the developer may have
257 # hand-sync'd some subdirs and edited files in others. 257 # hand-sync'd some subdirs and edited files in others.
258 # In that case, check against origin/HEAD and mark** revision. 258 # In that case, check against origin/HEAD and mark** revision.
259 # Use git:8 chars of sha1 259 # Use git:8 chars of sha1
260 REVISION=$(git rev-parse --short=8 HEAD) 260 REVISION=$(git rev-parse --short=8 HEAD)
261 CHROOT_PASSTHRU="CHROMEOS_REVISION=$REVISION BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_OFFICIAL" 261 CHROOT_PASSTHRU="CHROMEOS_REVISION=$REVISION BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_OFFICIAL"
262 if [ -d "$HOME/.subversion" ]; then
263 # Bind mounting .subversion into chroot
264 echo "mounting ~/.subversion into chroot"
265 MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}/home/${USER}/.subversion")"
266 if [ -z "$(mount | grep -F "on $MOUNTED_PATH ")" ]; then
267 mkdir -p "$MOUNTED_PATH"
268 sudo mount --bind "$HOME/.subversion" "$MOUNTED_PATH" || \
269 die "Could not mount $MOUNTED_PATH"
270 fi
271 fi
262 272
263 # Run command or interactive shell. Also include the non-chrooted path to 273 # Run command or interactive shell. Also include the non-chrooted path to
264 # the source trunk for scripts that may need to print it (e.g. 274 # the source trunk for scripts that may need to print it (e.g.
265 # build_image.sh). 275 # build_image.sh).
266 sudo chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ 276 sudo chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \
267 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C -- "$@" 277 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C -- "$@"
268 278
269 # Remove trap and explicitly unmount 279 # Remove trap and explicitly unmount
270 trap - EXIT 280 trap - EXIT
271 teardown_env 281 teardown_env
OLDNEW
« 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