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. |
11 | 11 |
12 . "$(dirname $0)/common.sh" | 12 . "$(dirname $0)/common.sh" |
13 . "$(dirname $0)/remote_access.sh" | 13 . "$(dirname $0)/remote_access.sh" |
14 | 14 |
15 # Flags to control image_to_live. | 15 # Flags to control image_to_live. |
16 DEFINE_boolean ignore_hostname ${FLAGS_TRUE} \ | 16 DEFINE_boolean ignore_hostname ${FLAGS_TRUE} \ |
17 "Ignore existing AU hostname on running instance use this hostname." | 17 "Ignore existing AU hostname on running instance use this hostname." |
18 DEFINE_boolean ignore_version ${FLAGS_TRUE} \ | 18 DEFINE_boolean ignore_version ${FLAGS_TRUE} \ |
19 "Ignore existing version on running instance and always update." | 19 "Ignore existing version on running instance and always update." |
20 DEFINE_string server_log "dev_server.log" \ | 20 DEFINE_string server_log "dev_server.log" \ |
21 "Path to log for the devserver." | 21 "Path to log for the devserver." |
22 DEFINE_boolean update "${FLAGS_TRUE}" \ | 22 DEFINE_boolean update "${FLAGS_TRUE}" \ |
23 "Perform update of root partition." | 23 "Perform update of root partition." |
24 DEFINE_boolean update_known_hosts ${FLAGS_FALSE} \ | 24 DEFINE_boolean update_known_hosts ${FLAGS_FALSE} \ |
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_string update_url "" "Full url of an update image." | |
29 DEFINE_boolean verify ${FLAGS_TRUE} "Verify image on device after update." | 28 DEFINE_boolean verify ${FLAGS_TRUE} "Verify image on device after update." |
30 | 29 |
31 # Flags for devserver. | 30 # Flags for devserver. |
32 DEFINE_string archive_dir "" \ | 31 DEFINE_string archive_dir "" \ |
33 "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 |
34 DEFINE_string board "" "Override the board reported by the target" | 33 DEFINE_string board "" "Override the board reported by the target" |
35 DEFINE_integer devserver_port 8080 \ | 34 DEFINE_integer devserver_port 8080 \ |
36 "Port to use for devserver." | 35 "Port to use for devserver." |
37 DEFINE_boolean for_vm ${FLAGS_FALSE} "Image is for a vm." | 36 DEFINE_boolean for_vm ${FLAGS_FALSE} "Image is for a vm." |
38 DEFINE_string image "" \ | 37 DEFINE_string image "" \ |
39 "Update with this image path that is in this source checkout." i | 38 "Update with this image path that is in this source checkout." i |
40 DEFINE_string payload "" \ | 39 DEFINE_string payload "" \ |
41 "Update with this update payload, ignoring specified images." | 40 "Update with this update payload, ignoring specified images." |
42 DEFINE_string proxy_port "" \ | 41 DEFINE_string proxy_port "" \ |
43 "Have the client request from this proxy instead of devserver." | 42 "Have the client request from this proxy instead of devserver." |
44 DEFINE_string src_image "" \ | 43 DEFINE_string src_image "" \ |
45 "Create a delta update by passing in the image on the remote machine." | 44 "Create a delta update by passing in the image on the remote machine." |
46 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ | 45 DEFINE_boolean update_stateful ${FLAGS_TRUE} \ |
47 "Perform update of stateful partition e.g. /var /usr/local." | 46 "Perform update of stateful partition e.g. /var /usr/local." |
| 47 DEFINE_string update_url "" "Full url of an update image." |
48 | 48 |
49 # Flags for stateful update. | 49 # Flags for stateful update. |
50 DEFINE_string stateful_update_flag "" \ | 50 DEFINE_string stateful_update_flag "" \ |
51 "Flag to pass to stateful update e.g. old, clean, etc." s | 51 "Flag to pass to stateful update e.g. old, clean, etc." s |
52 | 52 |
53 UPDATER_BIN="/usr/bin/update_engine_client" | 53 UPDATER_BIN="/usr/bin/update_engine_client" |
54 UPDATER_IDLE="UPDATE_STATUS_IDLE" | 54 UPDATER_IDLE="UPDATE_STATUS_IDLE" |
55 UPDATER_NEED_REBOOT="UPDATE_STATUS_UPDATED_NEED_REBOOT" | 55 UPDATER_NEED_REBOOT="UPDATE_STATUS_UPDATED_NEED_REBOOT" |
56 UPDATER_UPDATE_CHECK="UPDATE_STATUS_CHECKING_FOR_UPDATE" | 56 UPDATER_UPDATE_CHECK="UPDATE_STATUS_CHECKING_FOR_UPDATE" |
57 UPDATER_DOWNLOADING="UPDATE_STATUS_DOWNLOADING" | 57 UPDATER_DOWNLOADING="UPDATE_STATUS_DOWNLOADING" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 412 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
413 info "Update was successful and rebooted to $release_description" | 413 info "Update was successful and rebooted to $release_description" |
414 fi | 414 fi |
415 | 415 |
416 print_time_elapsed | 416 print_time_elapsed |
417 | 417 |
418 exit 0 | 418 exit 0 |
419 } | 419 } |
420 | 420 |
421 main $@ | 421 main $@ |
OLD | NEW |