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 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
11 | 11 |
12 # For functions related to gpt images. | 12 # For functions related to gpt images. |
13 . "$(dirname "$0")/chromeos-common.sh" | 13 . "$(dirname "$0")/chromeos-common.sh" |
| 14 locate_gpt |
14 | 15 |
15 get_default_board | 16 get_default_board |
16 | 17 |
17 # Flags. | 18 # Flags. |
18 DEFINE_string board "$DEFAULT_BOARD" \ | 19 DEFINE_string board "$DEFAULT_BOARD" \ |
19 "The board for which the image was built." b | 20 "The board for which the image was built." b |
20 DEFINE_boolean unmount $FLAGS_FALSE \ | 21 DEFINE_boolean unmount $FLAGS_FALSE \ |
21 "Unmount previously mounted dir." u | 22 "Unmount previously mounted dir." u |
22 DEFINE_string from "/dev/sdc" \ | 23 DEFINE_string from "/dev/sdc" \ |
23 "Directory containing image or device with image on it" f | 24 "Directory containing image or device with image on it" f |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 104 |
104 # Turn path into an absolute path. | 105 # Turn path into an absolute path. |
105 FLAGS_from=`eval readlink -f ${FLAGS_from}` | 106 FLAGS_from=`eval readlink -f ${FLAGS_from}` |
106 | 107 |
107 # Perform desired operation. | 108 # Perform desired operation. |
108 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then | 109 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then |
109 unmount_image | 110 unmount_image |
110 else | 111 else |
111 mount_image | 112 mount_image |
112 fi | 113 fi |
OLD | NEW |