OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
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 # This is the autoupdater for Memento. When called it consults Omaha to see | 7 # This is the autoupdater for Memento. When called it consults Omaha to see |
8 # if there's an update available. If so, it downloads it to the other | 8 # if there's an update available. If so, it downloads it to the other |
9 # partition on the Memento USB stick, then alters the MBR and partitions | 9 # partition on the Memento USB stick, then alters the MBR and partitions |
10 # as needed so the next reboot will boot into the newly installed partition. | 10 # as needed so the next reboot will boot into the newly installed partition. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 if [ "$KINSTALL_DEV" = "$INSTALL_DEV" ]; then | 163 if [ "$KINSTALL_DEV" = "$INSTALL_DEV" ]; then |
164 log "kernel install partition the same as rootfs install partition!" | 164 log "kernel install partition the same as rootfs install partition!" |
165 log " (${KINSTALL_DEV})" | 165 log " (${KINSTALL_DEV})" |
166 exit 1 | 166 exit 1 |
167 fi | 167 fi |
168 | 168 |
169 # Find whole disk device. | 169 # Find whole disk device. |
170 ROOT_DEV=${INSTALL_DEV%%[0-9]*} | 170 ROOT_DEV=${INSTALL_DEV%%[0-9]*} |
171 | 171 |
172 # Do some device sanity checks. | 172 # Do some device sanity checks. |
173 if ! expr match "$LOCAL_DEV" '^/dev/[a-z][a-z]*[12345]$' > /dev/null | 173 if ! expr match "$LOCAL_DEV" '^/dev/[a-z][a-z]*[123458]$' > /dev/null |
174 then | 174 then |
175 log "didnt find good local device. local: $LOCAL_DEV install: $INSTALL_DEV" | 175 log "didnt find good local device. local: $LOCAL_DEV install: $INSTALL_DEV" |
176 exit 1 | 176 exit 1 |
177 fi | 177 fi |
178 if ! expr match "$INSTALL_DEV" '^/dev/[a-z][a-z]*[12345]$' > /dev/null | 178 if ! expr match "$INSTALL_DEV" '^/dev/[a-z][a-z]*[123458]$' > /dev/null |
179 then | 179 then |
180 log "didnt find good install device. local: $LOCAL_DEV install: $INSTALL_DEV" | 180 log "didnt find good install device. local: $LOCAL_DEV install: $INSTALL_DEV" |
181 exit 1 | 181 exit 1 |
182 fi | 182 fi |
183 if [ "$LOCAL_DEV" == "$INSTALL_DEV" ] | 183 if [ "$LOCAL_DEV" == "$INSTALL_DEV" ] |
184 then | 184 then |
185 log local and installation device are the same: "$LOCAL_DEV" | 185 log local and installation device are the same: "$LOCAL_DEV" |
186 exit 1 | 186 exit 1 |
187 fi | 187 fi |
188 | 188 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 abort_update_if_cmd_failed | 339 abort_update_if_cmd_failed |
340 | 340 |
341 if [ -z "${FLAGS_dst_partition}" ]; then | 341 if [ -z "${FLAGS_dst_partition}" ]; then |
342 # mark update as complete so we don't try to update again | 342 # mark update as complete so we don't try to update again |
343 touch "$UPDATED_COMPLETED_FILE" | 343 touch "$UPDATED_COMPLETED_FILE" |
344 fi | 344 fi |
345 | 345 |
346 # tell user to reboot | 346 # tell user to reboot |
347 log Autoupdate applied. You should now reboot | 347 log Autoupdate applied. You should now reboot |
348 echo UPDATED | 348 echo UPDATED |
OLD | NEW |