| 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 14 matching lines...) Expand all Loading... |
| 25 "Update your known_hosts with the new remote instance's key." | 25 "Update your known_hosts with the new remote instance's key." |
| 26 DEFINE_string update_log "update_engine.log" \ | 26 DEFINE_string update_log "update_engine.log" \ |
| 27 "Path to log for the update_engine." | 27 "Path to log for the update_engine." |
| 28 DEFINE_boolean verify ${FLAGS_TRUE} "Verify image on device after update." | 28 DEFINE_boolean verify ${FLAGS_TRUE} "Verify image on device after update." |
| 29 | 29 |
| 30 # Flags for devserver. | 30 # Flags for devserver. |
| 31 DEFINE_string archive_dir "" \ | 31 DEFINE_string archive_dir "" \ |
| 32 "Update using the test image in the image.zip in this directory." a | 32 "Update using the test image in the image.zip in this directory." a |
| 33 DEFINE_integer devserver_port 8080 \ | 33 DEFINE_integer devserver_port 8080 \ |
| 34 "Port to use for devserver." | 34 "Port to use for devserver." |
| 35 DEFINE_boolean for_vm ${FLAGS_FALSE} "Image is for a vm." |
| 35 DEFINE_string image "" \ | 36 DEFINE_string image "" \ |
| 36 "Update with this image path that is in this source checkout." i | 37 "Update with this image path that is in this source checkout." i |
| 37 DEFINE_string src_image "" \ | 38 DEFINE_string src_image "" \ |
| 38 "Create a delta update by passing in the image on the remote machine." | 39 "Create a delta update by passing in the image on the remote machine." |
| 39 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ | 40 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ |
| 40 "Perform update of stateful partition e.g. /var /usr/local." | 41 "Perform update of stateful partition e.g. /var /usr/local." |
| 41 DEFINE_string update_url "" "Full url of an update image." | 42 DEFINE_string update_url "" "Full url of an update image." |
| 42 | 43 |
| 43 # Flags for stateful update. | 44 # Flags for stateful update. |
| 44 DEFINE_string stateful_update_flag "" \ | 45 DEFINE_string stateful_update_flag "" \ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 IMAGE_PATH="${FLAGS_archive_dir}/chromiumos_test_image.bin" | 123 IMAGE_PATH="${FLAGS_archive_dir}/chromiumos_test_image.bin" |
| 123 else | 124 else |
| 124 # IMAGE_PATH should be the newest image and learn the board from | 125 # IMAGE_PATH should be the newest image and learn the board from |
| 125 # the target. | 126 # the target. |
| 126 FLAGS_board="" | 127 FLAGS_board="" |
| 127 learn_board | 128 learn_board |
| 128 IMAGE_PATH="$($(dirname "$0")/get_latest_image.sh --board="${FLAGS_board}")" | 129 IMAGE_PATH="$($(dirname "$0")/get_latest_image.sh --board="${FLAGS_board}")" |
| 129 IMAGE_PATH="${IMAGE_PATH}/chromiumos_image.bin" | 130 IMAGE_PATH="${IMAGE_PATH}/chromiumos_image.bin" |
| 130 fi | 131 fi |
| 131 | 132 |
| 133 [ ${FLAGS_for_vm} -eq ${FLAGS_TRUE} ] && \ |
| 134 devserver_flags="${devserver_flags} --for_vm" |
| 135 |
| 132 devserver_flags="${devserver_flags} \ | 136 devserver_flags="${devserver_flags} \ |
| 133 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\"" | 137 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\"" |
| 134 | 138 |
| 135 info "Starting devserver with flags ${devserver_flags}" | 139 info "Starting devserver with flags ${devserver_flags}" |
| 136 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ | 140 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ |
| 137 --client_prefix=ChromeOSUpdateEngine \ | 141 --client_prefix=ChromeOSUpdateEngine \ |
| 138 --port=${FLAGS_devserver_port} > ${FLAGS_server_log} 2>&1" & | 142 --port=${FLAGS_devserver_port} > ${FLAGS_server_log} 2>&1" & |
| 139 | 143 |
| 140 info "Waiting on devserver to start" | 144 info "Waiting on devserver to start" |
| 141 info "note: be patient as the server generates the update before starting." | 145 info "note: be patient as the server generates the update before starting." |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 388 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
| 385 info "Update was successful and rebooted to $release_description" | 389 info "Update was successful and rebooted to $release_description" |
| 386 fi | 390 fi |
| 387 | 391 |
| 388 print_time_elapsed | 392 print_time_elapsed |
| 389 | 393 |
| 390 exit 0 | 394 exit 0 |
| 391 } | 395 } |
| 392 | 396 |
| 393 main $@ | 397 main $@ |
| OLD | NEW |