OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009-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 # Script to update an image onto a live running ChromiumOS instance. | 7 # Script to update an image onto a live running ChromiumOS instance. |
8 | 8 |
9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 local timeout=5 | 256 local timeout=5 |
257 # Let update engine receive call to ping the dev server. | 257 # Let update engine receive call to ping the dev server. |
258 info "Devserver handling ping. Check ${FLAGS_server_log} for more info." | 258 info "Devserver handling ping. Check ${FLAGS_server_log} for more info." |
259 sleep ${timeout} | 259 sleep ${timeout} |
260 | 260 |
261 # The devserver generates images when the update engine checks for updates. | 261 # The devserver generates images when the update engine checks for updates. |
262 while [ $(get_update_var CURRENT_OP) = ${UPDATER_UPDATE_CHECK} ]; do | 262 while [ $(get_update_var CURRENT_OP) = ${UPDATER_UPDATE_CHECK} ]; do |
263 echo -n "." && sleep ${timeout} | 263 echo -n "." && sleep ${timeout} |
264 done | 264 done |
265 | 265 |
266 info "Update generated. Update engine downloading update." | 266 info "Update generated. Update engine preparing to start update." |
267 while [ $(get_update_var CURRENT_OP) != ${UPDATER_DOWNLOADING} ]; do | |
petkov
2011/01/07 01:10:42
you should catch UPDATER_IDLE in this loop otherwi
petkov
2011/01/07 01:15:09
In fact, theoretically, if the update goes really
| |
268 echo -n "." && sleep ${timeout} | |
269 done | |
270 | |
271 info "Update engine downloading update." | |
267 while [ $(get_update_var CURRENT_OP) = ${UPDATER_DOWNLOADING} ]; do | 272 while [ $(get_update_var CURRENT_OP) = ${UPDATER_DOWNLOADING} ]; do |
268 echo "Download progress $(get_update_var PROGRESS)" && sleep ${timeout} | 273 echo "Download progress $(get_update_var PROGRESS)" && sleep ${timeout} |
269 done | 274 done |
270 | 275 |
271 info "Download complete." | 276 info "Download complete. Finalizing update." |
272 } | 277 } |
273 | 278 |
274 | 279 |
275 function run_auto_update { | 280 function run_auto_update { |
276 # Truncate the update log so our log file is clean. | 281 # Truncate the update log so our log file is clean. |
277 truncate_update_log | 282 truncate_update_log |
278 | 283 |
279 local update_args="$(get_update_args "$(get_devserver_url)")" | 284 local update_args="$(get_update_args "$(get_devserver_url)")" |
280 info "Starting update using args ${update_args}" | 285 info "Starting update using args ${update_args}" |
281 | 286 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 409 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
405 info "Update was successful and rebooted to $release_description" | 410 info "Update was successful and rebooted to $release_description" |
406 fi | 411 fi |
407 | 412 |
408 print_time_elapsed | 413 print_time_elapsed |
409 | 414 |
410 exit 0 | 415 exit 0 |
411 } | 416 } |
412 | 417 |
413 main $@ | 418 main $@ |
OLD | NEW |