Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 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_string board "" "Override the board reported by the target" | 33 DEFINE_string board "" "Override the board reported by the target" |
| 34 DEFINE_integer devserver_port 8080 \ | 34 DEFINE_integer devserver_port 8080 \ |
| 35 "Port to use for devserver." | 35 "Port to use for devserver." |
| 36 DEFINE_boolean for_vm ${FLAGS_FALSE} "Image is for a vm." | 36 DEFINE_boolean for_vm ${FLAGS_FALSE} "Image is for a vm." |
| 37 DEFINE_string payload "" \ | |
|
sosa
2010/11/18 02:00:40
alphabetical order by category.
| |
| 38 "Update with this update payload, ignoring specified images." | |
| 37 DEFINE_string image "" \ | 39 DEFINE_string image "" \ |
| 38 "Update with this image path that is in this source checkout." i | 40 "Update with this image path that is in this source checkout." i |
| 39 DEFINE_string src_image "" \ | 41 DEFINE_string src_image "" \ |
| 40 "Create a delta update by passing in the image on the remote machine." | 42 "Create a delta update by passing in the image on the remote machine." |
| 41 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ | 43 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ |
| 42 "Perform update of stateful partition e.g. /var /usr/local." | 44 "Perform update of stateful partition e.g. /var /usr/local." |
| 43 DEFINE_string update_url "" "Full url of an update image." | 45 DEFINE_string update_url "" "Full url of an update image." |
| 44 | 46 |
| 45 # Flags for stateful update. | 47 # Flags for stateful update. |
| 46 DEFINE_string stateful_update_flag "" \ | 48 DEFINE_string stateful_update_flag "" \ |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 else | 127 else |
| 126 # IMAGE_PATH should be the newest image and learn the board from | 128 # IMAGE_PATH should be the newest image and learn the board from |
| 127 # the target. | 129 # the target. |
| 128 learn_board | 130 learn_board |
| 129 IMAGE_PATH="$($(dirname "$0")/get_latest_image.sh --board="${FLAGS_board}")" | 131 IMAGE_PATH="$($(dirname "$0")/get_latest_image.sh --board="${FLAGS_board}")" |
| 130 IMAGE_PATH="${IMAGE_PATH}/chromiumos_image.bin" | 132 IMAGE_PATH="${IMAGE_PATH}/chromiumos_image.bin" |
| 131 devserver_flags="${devserver_flags} \ | 133 devserver_flags="${devserver_flags} \ |
| 132 --image $(reinterpret_path_for_chroot ${IMAGE_PATH})" | 134 --image $(reinterpret_path_for_chroot ${IMAGE_PATH})" |
| 133 fi | 135 fi |
| 134 | 136 |
| 137 if [ -n "${FLAGS_payload}" ]; then | |
| 138 devserver_flags="${devserver_flags} \ | |
| 139 --payload $(reinterpret_path_for_chroot ${FLAGS_payload})" | |
| 140 fi | |
| 141 | |
| 135 [ ${FLAGS_for_vm} -eq ${FLAGS_TRUE} ] && \ | 142 [ ${FLAGS_for_vm} -eq ${FLAGS_TRUE} ] && \ |
| 136 devserver_flags="${devserver_flags} --for_vm" | 143 devserver_flags="${devserver_flags} --for_vm" |
| 137 | 144 |
| 138 devserver_flags="${devserver_flags} \ | 145 devserver_flags="${devserver_flags} \ |
| 139 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\"" | 146 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\"" |
| 140 | 147 |
| 141 info "Starting devserver with flags ${devserver_flags}" | 148 info "Starting devserver with flags ${devserver_flags}" |
| 142 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ | 149 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ |
| 143 --client_prefix=ChromeOSUpdateEngine \ | 150 --client_prefix=ChromeOSUpdateEngine \ |
| 144 --board=${FLAGS_board} \ | 151 --board=${FLAGS_board} \ |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 402 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
| 396 info "Update was successful and rebooted to $release_description" | 403 info "Update was successful and rebooted to $release_description" |
| 397 fi | 404 fi |
| 398 | 405 |
| 399 print_time_elapsed | 406 print_time_elapsed |
| 400 | 407 |
| 401 exit 0 | 408 exit 0 |
| 402 } | 409 } |
| 403 | 410 |
| 404 main $@ | 411 main $@ |
| OLD | NEW |