| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DEFAULT_BUILD_ROOT=${CHROMEOS_BUILD_ROOT:-"$SRC_ROOT/build"} | 98 DEFAULT_BUILD_ROOT=${CHROMEOS_BUILD_ROOT:-"$SRC_ROOT/build"} |
| 99 | 99 |
| 100 # Set up a global ALL_BOARDS value | 100 # Set up a global ALL_BOARDS value |
| 101 ALL_BOARDS=$(cd $SRC_ROOT/overlays;ls -1d overlay-* 2>&-|sed 's,overlay-,,g') | 101 ALL_BOARDS=$(cd $SRC_ROOT/overlays;ls -1d overlay-* 2>&-|sed 's,overlay-,,g') |
| 102 # Strip CR | 102 # Strip CR |
| 103 ALL_BOARDS=$(echo $ALL_BOARDS) | 103 ALL_BOARDS=$(echo $ALL_BOARDS) |
| 104 # Set a default BOARD | 104 # Set a default BOARD |
| 105 #DEFAULT_BOARD=x86-generic # or... | 105 #DEFAULT_BOARD=x86-generic # or... |
| 106 DEFAULT_BOARD=$(echo $ALL_BOARDS | awk '{print $NF}') | 106 DEFAULT_BOARD=$(echo $ALL_BOARDS | awk '{print $NF}') |
| 107 | 107 |
| 108 # Enable --fast by default on non-official builds |
| 109 DEFAULT_FAST="${FLAGS_TRUE}" |
| 110 if [ "${CHROMEOS_OFFICIAL:-0}" = "1" ]; then |
| 111 DEFAULT_FAST="${FLAGS_FALSE}" |
| 112 fi |
| 113 |
| 108 # Detect whether we're inside a chroot or not | 114 # Detect whether we're inside a chroot or not |
| 109 if [ -e /etc/debian_chroot ] | 115 if [ -e /etc/debian_chroot ] |
| 110 then | 116 then |
| 111 INSIDE_CHROOT=1 | 117 INSIDE_CHROOT=1 |
| 112 else | 118 else |
| 113 INSIDE_CHROOT=0 | 119 INSIDE_CHROOT=0 |
| 114 fi | 120 fi |
| 115 | 121 |
| 116 # Directory locations inside the dev chroot | 122 # Directory locations inside the dev chroot |
| 117 CHROOT_TRUNK_DIR="/home/$USER/trunk" | 123 CHROOT_TRUNK_DIR="/home/$USER/trunk" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 start_time=$(date +%s) | 445 start_time=$(date +%s) |
| 440 | 446 |
| 441 # Print time elsapsed since start_time. | 447 # Print time elsapsed since start_time. |
| 442 print_time_elapsed() { | 448 print_time_elapsed() { |
| 443 end_time=$(date +%s) | 449 end_time=$(date +%s) |
| 444 elapsed_seconds="$(( $end_time - $start_time ))" | 450 elapsed_seconds="$(( $end_time - $start_time ))" |
| 445 minutes="$(( $elapsed_seconds / 60 ))" | 451 minutes="$(( $elapsed_seconds / 60 ))" |
| 446 seconds="$(( $elapsed_seconds % 60 ))" | 452 seconds="$(( $elapsed_seconds % 60 ))" |
| 447 echo "Elapsed time: ${minutes}:${seconds}" | 453 echo "Elapsed time: ${minutes}:${seconds}" |
| 448 } | 454 } |
| OLD | NEW |