Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2011 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 CHROOT_PASSTHRU="BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_ OFFICIAL" | 354 CHROOT_PASSTHRU="BUILDBOT_BUILD=$FLAGS_build_number CHROMEOS_OFFICIAL=$CHROMEOS_ OFFICIAL" |
| 355 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \ | 355 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \ |
| 356 CHROMEOS_RELEASE_APPID=${CHROMEOS_RELEASE_APPID:-"{DEV-BUILD}"}" | 356 CHROMEOS_RELEASE_APPID=${CHROMEOS_RELEASE_APPID:-"{DEV-BUILD}"}" |
| 357 | 357 |
| 358 # Set CHROMEOS_VERSION_TRACK, CHROMEOS_VERSION_AUSERVER, CHROMEOS_VERSION_DEVSER VER | |
|
petkov
2011/03/14 21:59:00
80 chars
| |
| 359 # as environment variables to override the default assumptions (local AU server) | |
| 360 # These are used in cros_set_lsb_release, and are used by external Chromium OS | |
| 361 # builders | |
|
petkov
2011/03/14 21:59:00
periods at the end of the sentences.
| |
| 362 | |
| 363 CHROOT_PASSTHRU="${CHROOT_PASSTHRU} \ | |
| 364 CHROMEOS_VERSION_TRACK=${CHROMEOS_VERSION_TRACK} \ | |
| 365 CHROMEOS_VERSION_AUSERVER=${CHROMEOS_VERSION_AUSERVER} \ | |
| 366 CHROMEOS_VERSION_DEVSERVER=${CHROMEOS_VERSION_DEVSERVER}" | |
| 367 | |
| 358 if [ -d "$HOME/.subversion" ]; then | 368 if [ -d "$HOME/.subversion" ]; then |
| 359 TARGET="/home/${USER}/.subversion" | 369 TARGET="/home/${USER}/.subversion" |
| 360 mkdir -p "${FLAGS_chroot}${TARGET}" | 370 mkdir -p "${FLAGS_chroot}${TARGET}" |
| 361 ensure_mounted "${HOME}/.subversion" "--bind" "${TARGET}" | 371 ensure_mounted "${HOME}/.subversion" "--bind" "${TARGET}" |
| 362 fi | 372 fi |
| 363 | 373 |
| 364 # Configure committer username and email in chroot .gitconfig | 374 # Configure committer username and email in chroot .gitconfig |
| 365 if [ $FLAGS_git_config -eq $FLAGS_TRUE ]; then | 375 if [ $FLAGS_git_config -eq $FLAGS_TRUE ]; then |
| 366 git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ | 376 git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ |
| 367 user.name "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')" | 377 user.name "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')" |
| 368 git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ | 378 git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ |
| 369 user.email "$(cd /tmp; git var GIT_COMMITTER_IDENT | \ | 379 user.email "$(cd /tmp; git var GIT_COMMITTER_IDENT | \ |
| 370 sed -e 's/.*<\([^>]*\)>.*/\1/')" | 380 sed -e 's/.*<\([^>]*\)>.*/\1/')" |
| 371 fi | 381 fi |
| 372 | 382 |
| 373 # Run command or interactive shell. Also include the non-chrooted path to | 383 # Run command or interactive shell. Also include the non-chrooted path to |
| 374 # the source trunk for scripts that may need to print it (e.g. | 384 # the source trunk for scripts that may need to print it (e.g. |
| 375 # build_image.sh). | 385 # build_image.sh). |
| 376 sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ | 386 sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ |
| 377 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \ | 387 EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \ |
| 378 SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@" | 388 SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@" |
| 379 | 389 |
| 380 # Remove trap and explicitly unmount | 390 # Remove trap and explicitly unmount |
| 381 trap - EXIT | 391 trap - EXIT |
| 382 teardown_env | 392 teardown_env |
| OLD | NEW |