OLD | NEW |
1 #!/bin/sh -u | 1 #!/bin/sh -u |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 # A script to install from removable media to hard disk. | 6 # A script to install from removable media to hard disk. |
7 | 7 |
8 # Load functions and constants for chromeos-install. | 8 # Load functions and constants for chromeos-install. |
9 . "$(dirname "$0")/chromeos-common.sh" || exit 1 | 9 . "$(dirname "$0")/chromeos-common.sh" || exit 1 |
10 . /usr/lib/shflags || exit 1 | 10 . /usr/lib/shflags || exit 1 |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 echo "Copying ESP..." | 445 echo "Copying ESP..." |
446 fast_dd 512 ${ESP_IMG_SECTORS} ${START_ESP} ${ESP_IMG_OFFSET} \ | 446 fast_dd 512 ${ESP_IMG_SECTORS} ${START_ESP} ${ESP_IMG_OFFSET} \ |
447 if=${ESP_IMG} of=${DST} conv=notrunc | 447 if=${ESP_IMG} of=${DST} conv=notrunc |
448 | 448 |
449 # If postinst fails, we should still clear stateful. | 449 # If postinst fails, we should still clear stateful. |
450 if [ "${FLAGS_preserve_stateful}" -eq "${FLAGS_FALSE}" ]; then | 450 if [ "${FLAGS_preserve_stateful}" -eq "${FLAGS_FALSE}" ]; then |
451 echo "Clearing the stateful partition..." | 451 echo "Clearing the stateful partition..." |
452 loop_offset_setup $DST $START_STATEFUL | 452 loop_offset_setup $DST $START_STATEFUL |
453 sudo mkfs.ext3 -F -b 4096 -L "H-STATE" ${LOOP_DEV} \ | 453 sudo mkfs.ext3 -F -b 4096 -L "H-STATE" ${LOOP_DEV} \ |
454 $(($NUM_STATEFUL_SECTORS / 8)) | 454 $(($NUM_STATEFUL_SECTORS / 8)) |
| 455 # Need to synchronize before releasing loop device, otherwise the losetup -d |
| 456 # may get device busy. |
| 457 sync |
455 loop_offset_cleanup | 458 loop_offset_cleanup |
456 fi | 459 fi |
457 | 460 |
458 # TODO: support arm during postinst so that we get partition selection and | 461 # TODO: support arm during postinst so that we get partition selection and |
459 # verified boot. | 462 # verified boot. |
460 if [ "$ARCH" != "ARM" ]; then | 463 if [ "$ARCH" != "ARM" ]; then |
461 # We can't guarantee that the kernel will see the new partition table, so | 464 # We can't guarantee that the kernel will see the new partition table, so |
462 # we can't use it directly. We could force the kernel to reload it with an | 465 # we can't use it directly. We could force the kernel to reload it with an |
463 # ioctl, but then we might have the UI mounting and displaying any old | 466 # ioctl, but then we might have the UI mounting and displaying any old |
464 # filesystems left over from the last install, and we don't want that either. | 467 # filesystems left over from the last install, and we don't want that either. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 --set bootcmd="mmc read 0 C0008000 0 1; autoscr C0008000" | 524 --set bootcmd="mmc read 0 C0008000 0 1; autoscr C0008000" |
522 fi | 525 fi |
523 | 526 |
524 # Force data to disk before we declare done. | 527 # Force data to disk before we declare done. |
525 sync | 528 sync |
526 | 529 |
527 echo "------------------------------------------------------------" | 530 echo "------------------------------------------------------------" |
528 echo "" | 531 echo "" |
529 echo "Installation to '$DST' complete." | 532 echo "Installation to '$DST' complete." |
530 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." | 533 echo "Please shutdown, remove the USB device, cross your fingers, and reboot." |
OLD | NEW |