OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 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 modify a keyfob-based chromeos system image for testability. | 7 # Script to modify a keyfob-based chromeos system image for testability. |
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 else | 183 else |
184 echo "Modifying image ${FLAGS_image} for test..." | 184 echo "Modifying image ${FLAGS_image} for test..." |
185 fi | 185 fi |
186 | 186 |
187 set -e | 187 set -e |
188 | 188 |
189 IMAGE_DIR=$(dirname "$FLAGS_image") | 189 IMAGE_DIR=$(dirname "$FLAGS_image") |
190 IMAGE_NAME="$(basename "$FLAGS_image")" | 190 IMAGE_NAME="$(basename "$FLAGS_image")" |
191 ROOT_FS_DIR="$IMAGE_DIR/rootfs" | 191 ROOT_FS_DIR="$IMAGE_DIR/rootfs" |
192 STATEFUL_DIR="$IMAGE_DIR/stateful_partition" | 192 STATEFUL_DIR="$IMAGE_DIR/stateful_partition" |
193 SCRIPTS_DIR=${SCRIPT_ROOT} | |
194 DEV_USER="chronos" | 193 DEV_USER="chronos" |
195 | 194 |
196 trap cleanup EXIT | 195 trap cleanup EXIT |
197 | 196 |
198 # Mounts gpt image and sets up var, /usr/local and symlinks. | 197 # Mounts gpt image and sets up var, /usr/local and symlinks. |
199 "$SCRIPTS_DIR/mount_gpt_image.sh" -i "$IMAGE_NAME" -f "$IMAGE_DIR" \ | 198 "$SCRIPTS_DIR/mount_gpt_image.sh" -i "$IMAGE_NAME" -f "$IMAGE_DIR" \ |
200 -r "$ROOT_FS_DIR" -s "$STATEFUL_DIR" | 199 -r "$ROOT_FS_DIR" -s "$STATEFUL_DIR" |
201 | 200 |
202 if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then | 201 if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then |
203 # We don't want to emerge test packages on factory install, otherwise we run | 202 # We don't want to emerge test packages on factory install, otherwise we run |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 cleanup | 245 cleanup |
247 | 246 |
248 # Now make it bootable with the flags from build_image | 247 # Now make it bootable with the flags from build_image |
249 "${SCRIPTS_DIR}/bin/cros_make_image_bootable" "$(dirname "${FLAGS_image}")" \ | 248 "${SCRIPTS_DIR}/bin/cros_make_image_bootable" "$(dirname "${FLAGS_image}")" \ |
250 $(basename "${FLAGS_image}") | 249 $(basename "${FLAGS_image}") |
251 | 250 |
252 print_time_elapsed | 251 print_time_elapsed |
253 | 252 |
254 trap - EXIT | 253 trap - EXIT |
255 | 254 |
OLD | NEW |