OLD | NEW |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009 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 . "$SRC_ROOT/third_party/shflags/files/src/shflags" | 78 . "$SRC_ROOT/third_party/shflags/files/src/shflags" |
79 | 79 |
80 # Mirrors and build suites come in 3 flavors | 80 # Our local mirror |
81 # EXT - external source used to build local package repository | 81 DEFAULT_CHROMEOS_SERVER=${CHROMEOS_SERVER:-"http://build.chromium.org/mirror"} |
82 # DEV - development chroot, from local package repository | |
83 # IMG - bootable image, from local package repository | |
84 | 82 |
85 # Build suites | 83 # Upstream mirrors and build suites come in 2 flavors |
86 DEFAULT_EXT_SUITE=${CHROMEOS_EXT_SUITE:-"chromeos_dev"} | 84 # DEV - development chroot, used to build the chromeos image |
87 DEFAULT_DEV_SUITE=${CHROMEOS_DEV_SUITE:-"chromeos_dev"} | 85 # IMG - bootable image, to run on actual hardware |
88 DEFAULT_IMG_SUITE=${CHROMEOS_IMG_SUITE:-"chromeos"} | |
89 | 86 |
90 # Package repositories (mirrors) | 87 DEFAULT_DEV_MIRROR=${CHROMEOS_DEV_MIRROR:-"${DEFAULT_CHROMEOS_SERVER}/ubuntu"} |
91 DEFAULT_EXT_MIRROR=${CHROMEOS_EXT_MIRROR:-"http://build.chromium.org/buildbot/pa
ckages"} | 88 DEFAULT_DEV_SUITE=${CHROMEOS_DEV_SUITE:-"karmic"} |
92 DEFAULT_DEV_MIRROR=${CHROMEOS_DEV_MIRROR:-"file://$GCLIENT_ROOT/repo/apt"} | 89 |
93 DEFAULT_IMG_MIRROR=${CHROMEOS_IMG_MIRROR:-"copy:///home/$USER/trunk/repo/apt"} | 90 DEFAULT_IMG_MIRROR=${CHROMEOS_IMG_MIRROR:-"${DEFAULT_CHROMEOS_SERVER}/ubuntu"} |
| 91 DEFAULT_IMG_SUITE=${CHROMEOS_IMG_SUITE:-"karmic"} |
94 | 92 |
95 # Default location for chroot | 93 # Default location for chroot |
96 DEFAULT_CHROOT_DIR=${CHROMEOS_CHROOT_DIR:-"$GCLIENT_ROOT/chroot"} | 94 DEFAULT_CHROOT_DIR=${CHROMEOS_CHROOT_DIR:-"$GCLIENT_ROOT/chroot"} |
97 | 95 |
98 # All output files from build should go under $DEFAULT_BUILD_ROOT, so that | 96 # All output files from build should go under $DEFAULT_BUILD_ROOT, so that |
99 # they don't pollute the source directory. | 97 # they don't pollute the source directory. |
100 DEFAULT_BUILD_ROOT=${CHROMEOS_BUILD_ROOT:-"$SRC_ROOT/build"} | 98 DEFAULT_BUILD_ROOT=${CHROMEOS_BUILD_ROOT:-"$SRC_ROOT/build"} |
101 | 99 |
102 # Detect whether we're inside a chroot or not | 100 # Detect whether we're inside a chroot or not |
103 if [ -e /etc/debian_chroot ] | 101 if [ -e /etc/debian_chroot ] |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 is_whitelisted() { | 195 is_whitelisted() { |
198 local file=$1 | 196 local file=$1 |
199 local whitelist="$FLAGS_whitelist" | 197 local whitelist="$FLAGS_whitelist" |
200 test -f "$whitelist" || (echo "Whitelist file missing ($whitelist)" && exit 1) | 198 test -f "$whitelist" || (echo "Whitelist file missing ($whitelist)" && exit 1) |
201 | 199 |
202 local checksum=$(md5sum "$file" | awk '{ print $1 }') | 200 local checksum=$(md5sum "$file" | awk '{ print $1 }') |
203 local count=$(sed -e "s/#.*$//" "${whitelist}" | grep -c "$checksum" \ | 201 local count=$(sed -e "s/#.*$//" "${whitelist}" | grep -c "$checksum" \ |
204 || /bin/true) | 202 || /bin/true) |
205 test $count -ne 0 | 203 test $count -ne 0 |
206 } | 204 } |
OLD | NEW |