| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 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 # A script to install from removable media to hard disk. | 7 # A script to install from removable media to hard disk. |
| 8 | 8 |
| 9 if [ "$USER" != "chronos" ] | 9 if [ "$USER" != "chronos" ] |
| 10 then | 10 then |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 sudo mount "$DST_PARTITION" "$ROOTFS_DIR" | 195 sudo mount "$DST_PARTITION" "$ROOTFS_DIR" |
| 196 # run postinst script | 196 # run postinst script |
| 197 sudo "$ROOTFS_DIR"/postinst "$DST_PARTITION" | 197 sudo "$ROOTFS_DIR"/postinst "$DST_PARTITION" |
| 198 sudo umount "$ROOTFS_DIR" | 198 sudo umount "$ROOTFS_DIR" |
| 199 | 199 |
| 200 # set up stateful partition | 200 # set up stateful partition |
| 201 STATEFUL_PARTITION="${DST}1" | 201 STATEFUL_PARTITION="${DST}1" |
| 202 sudo mkfs.ext3 "$STATEFUL_PARTITION" | 202 sudo mkfs.ext3 "$STATEFUL_PARTITION" |
| 203 sudo tune2fs -L "H-STATE" "$STATEFUL_PARTITION" | 203 sudo tune2fs -L "H-STATE" "$STATEFUL_PARTITION" |
| 204 | 204 |
| 205 # install things into stateful partition |
| 206 STATEFUL_DIR=/tmp/stateful_partition_on_hd |
| 207 mkdir -p "$STATEFUL_DIR" |
| 208 sudo mount "$STATEFUL_PARTITION" "$STATEFUL_DIR" |
| 209 cp -fpru /home/* "$STATEFUL_DIR" |
| 210 sudo umount "$STATEFUL_DIR" |
| 211 |
| 205 # Force data to disk before we declare done. | 212 # Force data to disk before we declare done. |
| 206 sync | 213 sync |
| 207 | 214 |
| 208 echo "------------------------------------------------------------" | 215 echo "------------------------------------------------------------" |
| 209 echo "" | 216 echo "" |
| 210 echo "Installation to '$DST' complete." | 217 echo "Installation to '$DST' complete." |
| 211 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." | 218 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." |
| 212 | 219 |
| 213 trap - EXIT | 220 trap - EXIT |
| OLD | NEW |