mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
image_to_live verifies root_dev changed.
Without this, image_to_live can sometimes think that an update from the same version to same version worked when it failed. BUG=chromium-os:9002 TEST=By hand (hardware && success only) Review URL: http://codereview.chromium.org/6045004 Change-Id: Ic0835372a45a45785e21ba1527d478f447bcf42a
This commit is contained in:
parent
e82f07c262
commit
c6c925d8ef
@ -329,6 +329,11 @@ function verify_image {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function find_root_dev {
|
||||||
|
remote_sh "rootdev -s"
|
||||||
|
echo ${REMOTE_OUT}
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
assert_outside_chroot
|
assert_outside_chroot
|
||||||
|
|
||||||
@ -356,6 +361,8 @@ function main() {
|
|||||||
remote_reboot
|
remote_reboot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local initial_root_dev=$(find_root_dev)
|
||||||
|
|
||||||
if [ -z "${FLAGS_update_url}" ]; then
|
if [ -z "${FLAGS_update_url}" ]; then
|
||||||
# Start local devserver if no update url specified.
|
# Start local devserver if no update url specified.
|
||||||
start_dev_server
|
start_dev_server
|
||||||
@ -386,6 +393,13 @@ function main() {
|
|||||||
remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release"
|
remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release"
|
||||||
if [ ${FLAGS_verify} -eq ${FLAGS_TRUE} ]; then
|
if [ ${FLAGS_verify} -eq ${FLAGS_TRUE} ]; then
|
||||||
verify_image
|
verify_image
|
||||||
|
|
||||||
|
if [ "${initial_root_dev}" == "$(find_root_dev)" ]; then
|
||||||
|
# At this point, the software version didn't change, but we didn't
|
||||||
|
# switch partitions either. Means it was an update to the same version
|
||||||
|
# that failed.
|
||||||
|
die "The root partition did NOT change. The update failed."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2)
|
local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2)
|
||||||
info "Update was successful and rebooted to $release_description"
|
info "Update was successful and rebooted to $release_description"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user