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

Side by Side Diff: enter_chroot.sh

Issue 6598056: Remove obsolete CHROMEOS_REVISION setting in enter_chroot. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 9 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 # --- BEGIN COMMON.SH BOILERPLATE --- 9 # --- BEGIN COMMON.SH BOILERPLATE ---
10 # Load common CrOS utilities. Inside the chroot this file is installed in 10 # Load common CrOS utilities. Inside the chroot this file is installed in
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 # Apply any hacks needed to update the chroot. 345 # Apply any hacks needed to update the chroot.
346 chroot_hacks_from_outside "${FLAGS_chroot}" 346 chroot_hacks_from_outside "${FLAGS_chroot}"
347 chroot_hacks_too 347 chroot_hacks_too
348 348
349 349
350 # Make sure we unmount before exiting 350 # Make sure we unmount before exiting
351 trap teardown_env EXIT 351 trap teardown_env EXIT
352 setup_env 352 setup_env
353 353
354 # Get the git revision to pass into the chroot. 354 CHROOT_PASSTHRU="BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_ OFFICIAL"
355 #
356 # This must be determined outside the chroot because (1) there is no
357 # git inside the chroot, and (2) if there were it would likely be
358 # the wrong version, which would mess up the .git directories.
359 #
360 # Note that this fixes $CHROMEOS_REVISION at the time the chroot is
361 # entered. That's ok for the main use case of automated builds,
362 # which pass each command line into a separate call to enter_chroot
363 # so always have up-to-date info. For developer builds, there may not
364 # be a single revision, since the developer may have
365 # hand-sync'd some subdirs and edited files in others.
366 # In that case, check against origin/HEAD and mark** revision.
367 # Use git:8 chars of sha1
368 REVISION=$(cd ${FLAGS_trunk}/src/scripts ; git rev-parse --short=8 HEAD)
369 CHROOT_PASSTHRU="CHROMEOS_REVISION=$REVISION BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_OFFICIAL"
370 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \ 355 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \
371 CHROMEOS_RELEASE_APPID=${CHROMEOS_RELEASE_APPID:-"{DEV-BUILD}"}" 356 CHROMEOS_RELEASE_APPID=${CHROMEOS_RELEASE_APPID:-"{DEV-BUILD}"}"
372 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \ 357 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \
373 CHROMEOS_VERSION_TRACK=$CHROMEOS_VERSION_TRACK CHROMEOS_VERSION_AUSERVER=$CHROME OS_VERSION_AUSERVER CHROMEOS_VERSION_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER" 358 CHROMEOS_VERSION_TRACK=$CHROMEOS_VERSION_TRACK CHROMEOS_VERSION_AUSERVER=$CHROME OS_VERSION_AUSERVER CHROMEOS_VERSION_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER"
374 359
375 if [ -d "$HOME/.subversion" ]; then 360 if [ -d "$HOME/.subversion" ]; then
376 TARGET="/home/${USER}/.subversion" 361 TARGET="/home/${USER}/.subversion"
377 mkdir -p "${FLAGS_chroot}${TARGET}" 362 mkdir -p "${FLAGS_chroot}${TARGET}"
378 ensure_mounted "${HOME}/.subversion" "--bind" "${TARGET}" 363 ensure_mounted "${HOME}/.subversion" "--bind" "${TARGET}"
379 fi 364 fi
(...skipping 10 matching lines...) Expand all
390 # Run command or interactive shell. Also include the non-chrooted path to 375 # Run command or interactive shell. Also include the non-chrooted path to
391 # the source trunk for scripts that may need to print it (e.g. 376 # the source trunk for scripts that may need to print it (e.g.
392 # build_image.sh). 377 # build_image.sh).
393 sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ 378 sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \
394 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \ 379 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \
395 SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@" 380 SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@"
396 381
397 # Remove trap and explicitly unmount 382 # Remove trap and explicitly unmount
398 trap - EXIT 383 trap - EXIT
399 teardown_env 384 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