OLD | NEW |
1 #!/bin/sh -e | 1 #!/bin/sh -e |
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 . "$(dirname "$0")/chromeos-common.sh" | 7 . "$(dirname "$0")/chromeos-common.sh" |
8 . "/opt/google/memento_updater/memento_updater_logging.sh" | 8 . "/opt/google/memento_updater/memento_updater_logging.sh" |
9 | 9 |
10 if [ $(id -u) -ne 0 ]; then | 10 if [ $(id -u) -ne 0 ]; then |
(...skipping 21 matching lines...) Expand all Loading... |
32 sync | 32 sync |
33 echo 3 > /proc/sys/vm/drop_caches | 33 echo 3 > /proc/sys/vm/drop_caches |
34 /sbin/sfdisk -R "$DST" | 34 /sbin/sfdisk -R "$DST" |
35 | 35 |
36 FACTORY_CHANNEL_ARG='--force_track=factory-channel' | 36 FACTORY_CHANNEL_ARG='--force_track=factory-channel' |
37 RELEASE_CHANNEL_ARG='--force_track=release-channel' | 37 RELEASE_CHANNEL_ARG='--force_track=release-channel' |
38 OEM_CHANNEL_ARG='--force_track=oempartitionimg-channel' | 38 OEM_CHANNEL_ARG='--force_track=oempartitionimg-channel' |
39 STATE_CHANNEL_ARG='--force_track=stateimg-channel' | 39 STATE_CHANNEL_ARG='--force_track=stateimg-channel' |
40 | 40 |
41 # Install the partitions | 41 # Install the partitions |
42 for i in FACTORY RELEASE STATE OEM; do | 42 for i in OEM STATE RELEASE FACTORY; do |
43 PART=$(eval "echo \$DST_${i}_PART") | 43 PART=$(eval "echo \$DST_${i}_PART") |
44 CHANNEL_ARG=$(eval "echo \$${i}_CHANNEL_ARG") | 44 CHANNEL_ARG=$(eval "echo \$${i}_CHANNEL_ARG") |
45 KPART="none" | 45 KPART="none" |
46 | 46 |
47 log "Factory Install: Installing $i partition to $PART" | 47 log "Factory Install: Installing $i partition to $PART" |
48 | 48 |
49 SKIP_POSTINST_ARG="--skip_postinst" | 49 SKIP_POSTINST_ARG="--skip_postinst" |
50 if [ "$i" = "FACTORY" -o "$i" = "RELEASE" ]; then | 50 if [ "$i" = "FACTORY" -o "$i" = "RELEASE" ]; then |
51 # Set up kernel partition | 51 # Set up kernel partition |
52 SKIP_POSTINST_ARG="" | 52 SKIP_POSTINST_ARG="" |
53 KPART="" | 53 KPART="" |
54 fi | 54 fi |
55 | 55 |
56 RESULT="$(/opt/google/memento_updater/memento_updater.sh --dst_partition \ | 56 RESULT="$(/opt/google/memento_updater/memento_updater.sh --dst_partition \ |
57 "${DST}${PART}" --kernel_partition "${KPART}" \ | 57 "${DST}${PART}" --kernel_partition "${KPART}" \ |
58 --allow_removable_boot $CHANNEL_ARG $SKIP_POSTINST_ARG)" | 58 --allow_removable_boot $CHANNEL_ARG $SKIP_POSTINST_ARG)" |
59 | 59 |
60 if [ "$RESULT" != "UPDATED" ]; then | 60 if [ "$RESULT" != "UPDATED" ]; then |
61 log "Factory Install: AU failed" | 61 log "Factory Install: AU failed" |
62 exit 1 | 62 exit 1 |
63 fi | 63 fi |
64 done | 64 done |
65 | 65 |
66 log "All done installing." | 66 log "All done installing." |
67 | 67 |
68 shutdown -r now | 68 shutdown -r now |
69 sleep 1d # sleep indefinitely to avoid respawning rather than shutting down | 69 sleep 1d # sleep indefinitely to avoid respawning rather than shutting down |
OLD | NEW |