OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 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 # Helper script that mounts chromium os image from a device or directory | 7 # Helper script that mounts chromium os image from a device or directory |
8 # and creates mount points for /var and /usr/local (if in dev_mode). | 8 # and creates mount points for /var and /usr/local (if in dev_mode). |
9 | 9 |
10 # --- BEGIN COMMON.SH BOILERPLATE --- | 10 # --- BEGIN COMMON.SH BOILERPLATE --- |
(...skipping 10 matching lines...) Expand all Loading... |
21 SCRIPT_ROOT=${path} | 21 SCRIPT_ROOT=${path} |
22 break | 22 break |
23 fi | 23 fi |
24 done | 24 done |
25 } | 25 } |
26 | 26 |
27 find_common_sh | 27 find_common_sh |
28 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) | 28 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) |
29 # --- END COMMON.SH BOILERPLATE --- | 29 # --- END COMMON.SH BOILERPLATE --- |
30 | 30 |
31 # Need to be inside the chroot to load chromeos-common.sh | 31 if [ $INSIDE_CHROOT -ne 1 ]; then |
32 assert_inside_chroot | 32 INSTALL_ROOT="$SRC_ROOT/platform/installer/" |
33 | 33 else |
| 34 INSTALL_ROOT=/usr/lib/installer/ |
| 35 fi |
34 # Load functions and constants for chromeos-install | 36 # Load functions and constants for chromeos-install |
35 . "/usr/lib/installer/chromeos-common.sh" || \ | 37 . "${INSTALL_ROOT}/chromeos-common.sh" || \ |
36 die "Unable to load /usr/lib/installer/chromeos-common.sh" | 38 die "Unable to load ${INSTALL_ROOT}/chromeos-common.sh" |
37 | 39 |
38 locate_gpt | 40 locate_gpt |
39 | 41 |
40 get_default_board | 42 get_default_board |
41 | 43 |
42 # Flags. | 44 # Flags. |
43 DEFINE_string board "$DEFAULT_BOARD" \ | 45 DEFINE_string board "$DEFAULT_BOARD" \ |
44 "The board for which the image was built." b | 46 "The board for which the image was built." b |
45 DEFINE_boolean read_only $FLAGS_FALSE \ | 47 DEFINE_boolean read_only $FLAGS_FALSE \ |
46 "Mount in read only mode -- skips stateful items." | 48 "Mount in read only mode -- skips stateful items." |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 FLAGS_from=`eval readlink -f ${FLAGS_from}` | 181 FLAGS_from=`eval readlink -f ${FLAGS_from}` |
180 FLAGS_rootfs_mountpt=`eval readlink -f ${FLAGS_rootfs_mountpt}` | 182 FLAGS_rootfs_mountpt=`eval readlink -f ${FLAGS_rootfs_mountpt}` |
181 FLAGS_stateful_mountpt=`eval readlink -f ${FLAGS_stateful_mountpt}` | 183 FLAGS_stateful_mountpt=`eval readlink -f ${FLAGS_stateful_mountpt}` |
182 | 184 |
183 # Perform desired operation. | 185 # Perform desired operation. |
184 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then | 186 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then |
185 unmount_image | 187 unmount_image |
186 else | 188 else |
187 mount_image | 189 mount_image |
188 fi | 190 fi |
OLD | NEW |