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" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if [ ${FLAGS_read_only} -eq ${FLAGS_FALSE} ]; then | 129 if [ ${FLAGS_read_only} -eq ${FLAGS_FALSE} ]; then |
130 setup_symlinks_on_root "${FLAGS_stateful_mountpt}/dev_image" \ | 130 setup_symlinks_on_root "${FLAGS_stateful_mountpt}/dev_image" \ |
131 "${FLAGS_stateful_mountpt}/var" "${FLAGS_stateful_mountpt}" | 131 "${FLAGS_stateful_mountpt}/var" "${FLAGS_stateful_mountpt}" |
132 fi | 132 fi |
133 echo "Image specified by ${FLAGS_from} mounted at"\ | 133 echo "Image specified by ${FLAGS_from} mounted at"\ |
134 "${FLAGS_rootfs_mountpt} successfully." | 134 "${FLAGS_rootfs_mountpt} successfully." |
135 } | 135 } |
136 | 136 |
137 # Find the last image built on the board. | 137 # Find the last image built on the board. |
138 if [ ${FLAGS_most_recent} -eq ${FLAGS_TRUE} ] ; then | 138 if [ ${FLAGS_most_recent} -eq ${FLAGS_TRUE} ] ; then |
139 IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}" | 139 FLAGS_from="$(./get_latest_image.sh --board="${FLAGS_board}")" |
140 FLAGS_from="${IMAGES_DIR}/$(ls -t ${IMAGES_DIR} 2>&-| head -1)" | |
141 fi | 140 fi |
142 | 141 |
143 # Turn path into an absolute path. | 142 # Turn path into an absolute path. |
144 FLAGS_from=`eval readlink -f ${FLAGS_from}` | 143 FLAGS_from=`eval readlink -f ${FLAGS_from}` |
145 | 144 |
146 # Perform desired operation. | 145 # Perform desired operation. |
147 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then | 146 if [ ${FLAGS_unmount} -eq ${FLAGS_TRUE} ] ; then |
148 unmount_image | 147 unmount_image |
149 else | 148 else |
150 mount_image | 149 mount_image |
151 fi | 150 fi |
OLD | NEW |