OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
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 # A script to install from removable media to hard disk. | 7 # A script to install from removable media to hard disk. |
8 | 8 |
9 # This is used to force partitions to be larger than they may be | 9 # This is used to force partitions to be larger than they may be |
10 # On the source install media | 10 # On the source install media |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 sudo mount "$DST_PARTITION" "$ROOTFS_DIR" | 216 sudo mount "$DST_PARTITION" "$ROOTFS_DIR" |
217 # run postinst script | 217 # run postinst script |
218 sudo "$ROOTFS_DIR"/postinst "$DST_PARTITION" | 218 sudo "$ROOTFS_DIR"/postinst "$DST_PARTITION" |
219 sudo umount "$ROOTFS_DIR" | 219 sudo umount "$ROOTFS_DIR" |
220 | 220 |
221 # set up stateful partition | 221 # set up stateful partition |
222 STATEFUL_PARTITION="${DST}1" | 222 STATEFUL_PARTITION="${DST}1" |
223 sudo mkfs.ext3 "$STATEFUL_PARTITION" | 223 sudo mkfs.ext3 "$STATEFUL_PARTITION" |
224 sudo tune2fs -L "H-STATE" "$STATEFUL_PARTITION" | 224 sudo tune2fs -L "H-STATE" "$STATEFUL_PARTITION" |
225 | 225 |
226 # install things into stateful partition | 226 # Install dev image into the stateful partition |
227 if [ -d /home/autotest-client ] | 227 if [ -f /root/.dev_mode ] ; then |
228 then | |
229 STATEFUL_DIR=/tmp/stateful_partition_on_hd | 228 STATEFUL_DIR=/tmp/stateful_partition_on_hd |
230 mkdir -p "$STATEFUL_DIR" | 229 mkdir -p "$STATEFUL_DIR" |
231 sudo mount "$STATEFUL_PARTITION" "$STATEFUL_DIR" | 230 sudo mount "$STATEFUL_PARTITION" "$STATEFUL_DIR" |
232 sudo mkdir -p "$STATEFUL_DIR/home/autotest-client" | 231 sudo cp -fpru /mnt/stateful_partition/dev_image "$STATEFUL_DIR/dev_image" |
233 sudo cp -fpru /home/autotest-client "$STATEFUL_DIR/home/autotest-client" | |
234 sudo umount "$STATEFUL_DIR" | 232 sudo umount "$STATEFUL_DIR" |
235 fi | 233 fi |
236 | 234 |
237 # Force data to disk before we declare done. | 235 # Force data to disk before we declare done. |
238 sync | 236 sync |
239 | 237 |
240 echo "------------------------------------------------------------" | 238 echo "------------------------------------------------------------" |
241 echo "" | 239 echo "" |
242 echo "Installation to '$DST' complete." | 240 echo "Installation to '$DST' complete." |
243 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." | 241 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." |
244 | 242 |
245 trap - EXIT | 243 trap - EXIT |
OLD | NEW |