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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 # Set up a global ALL_BOARDS value | 106 # Set up a global ALL_BOARDS value |
107 if [ -d $SRC_ROOT/overlays ]; then | 107 if [ -d $SRC_ROOT/overlays ]; then |
108 ALL_BOARDS=$(cd $SRC_ROOT/overlays;ls -1d overlay-* 2>&-|sed 's,overlay-,,g') | 108 ALL_BOARDS=$(cd $SRC_ROOT/overlays;ls -1d overlay-* 2>&-|sed 's,overlay-,,g') |
109 fi | 109 fi |
110 # Strip CR | 110 # Strip CR |
111 ALL_BOARDS=$(echo $ALL_BOARDS) | 111 ALL_BOARDS=$(echo $ALL_BOARDS) |
112 # Set a default BOARD | 112 # Set a default BOARD |
113 #DEFAULT_BOARD=x86-generic # or... | 113 #DEFAULT_BOARD=x86-generic # or... |
114 DEFAULT_BOARD=$(echo $ALL_BOARDS | awk '{print $NF}') | 114 DEFAULT_BOARD=$(echo $ALL_BOARDS | awk '{print $NF}') |
115 | 115 |
116 # Enable --fast by default on non-official builds | 116 # Enable --fast by default. |
117 DEFAULT_FAST="${FLAGS_TRUE}" | 117 DEFAULT_FAST="${FLAGS_TRUE}" |
118 if [ "${CHROMEOS_OFFICIAL:-0}" = "1" ]; then | |
119 DEFAULT_FAST="${FLAGS_FALSE}" | |
120 fi | |
121 | 118 |
122 # Detect whether we're inside a chroot or not | 119 # Detect whether we're inside a chroot or not |
123 if [ -e /etc/debian_chroot ] | 120 if [ -e /etc/debian_chroot ] |
124 then | 121 then |
125 INSIDE_CHROOT=1 | 122 INSIDE_CHROOT=1 |
126 else | 123 else |
127 INSIDE_CHROOT=0 | 124 INSIDE_CHROOT=0 |
128 fi | 125 fi |
129 | 126 |
130 # Directory locations inside the dev chroot | 127 # Directory locations inside the dev chroot |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 chroot_hacks_from_outside() { | 516 chroot_hacks_from_outside() { |
520 # Give args better names. | 517 # Give args better names. |
521 local chroot_dir="${1}" | 518 local chroot_dir="${1}" |
522 | 519 |
523 # Add root as a sudoer if not already done. | 520 # Add root as a sudoer if not already done. |
524 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 |
525 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" |
526 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\"" |
527 fi | 524 fi |
528 } | 525 } |
OLD | NEW |