| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Common constants for build scripts | 5 # Common constants for build scripts |
| 6 # This must evaluate properly for both /bin/bash and /bin/sh | 6 # This must evaluate properly for both /bin/bash and /bin/sh |
| 7 | 7 |
| 8 # All scripts should die on error unless commands are specifically excepted | 8 # All scripts should die on error unless commands are specifically excepted |
| 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. | 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. |
| 10 # TODO: Re-enable this once shflags is less prone to dying. | 10 # TODO: Re-enable this once shflags is less prone to dying. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 # Read settings | 70 # Read settings |
| 71 . $CHROMEOS_DEV_SETTINGS | 71 . $CHROMEOS_DEV_SETTINGS |
| 72 | 72 |
| 73 # Restore previous state of exit-on-error | 73 # Restore previous state of exit-on-error |
| 74 eval "$SAVE_OPTS" | 74 eval "$SAVE_OPTS" |
| 75 fi | 75 fi |
| 76 | 76 |
| 77 # Load shflags | 77 # Load shflags |
| 78 if [[ -f /usr/lib/shflags ]]; then | 78 if [[ -f /usr/lib/shflags ]]; then |
| 79 . /usr/lib/shflags | 79 . /usr/lib/shflags |
| 80 elif [ -f ./lib/shflags/shflags ]; then |
| 81 . "./lib/shflags/shflags" |
| 80 else | 82 else |
| 81 . "${SRC_ROOT}/scripts/lib/shflags/shflags" | 83 . "${SRC_ROOT}/scripts/lib/shflags/shflags" |
| 82 fi | 84 fi |
| 83 | 85 |
| 84 # Our local mirror | 86 # Our local mirror |
| 85 DEFAULT_CHROMEOS_SERVER=${CHROMEOS_SERVER:-"http://build.chromium.org/mirror"} | 87 DEFAULT_CHROMEOS_SERVER=${CHROMEOS_SERVER:-"http://build.chromium.org/mirror"} |
| 86 | 88 |
| 87 # Upstream mirrors and build suites come in 2 flavors | 89 # Upstream mirrors and build suites come in 2 flavors |
| 88 # DEV - development chroot, used to build the chromeos image | 90 # DEV - development chroot, used to build the chromeos image |
| 89 # IMG - bootable image, to run on actual hardware | 91 # IMG - bootable image, to run on actual hardware |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 chroot_hacks_from_outside() { | 516 chroot_hacks_from_outside() { |
| 515 # Give args better names. | 517 # Give args better names. |
| 516 local chroot_dir="${1}" | 518 local chroot_dir="${1}" |
| 517 | 519 |
| 518 # Add root as a sudoer if not already done. | 520 # Add root as a sudoer if not already done. |
| 519 if ! sudo grep -q '^root ALL=(ALL) ALL$' "${chroot_dir}/etc/sudoers" ; then | 521 if ! sudo grep -q '^root ALL=(ALL) ALL$' "${chroot_dir}/etc/sudoers" ; then |
| 520 info "Upgrading old chroot (pre 2010-10-19) - adding root to sudoers" | 522 info "Upgrading old chroot (pre 2010-10-19) - adding root to sudoers" |
| 521 sudo bash -c "echo root ALL=\(ALL\) ALL >> \"${chroot_dir}/etc/sudoers\"" | 523 sudo bash -c "echo root ALL=\(ALL\) ALL >> \"${chroot_dir}/etc/sudoers\"" |
| 522 fi | 524 fi |
| 523 } | 525 } |
| OLD | NEW |