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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 # Parse devserver flags. | 93 # Parse devserver flags. |
94 if [ -n "${FLAGS_image}" ]; then | 94 if [ -n "${FLAGS_image}" ]; then |
95 devserver_flags="${devserver_flags} \ | 95 devserver_flags="${devserver_flags} \ |
96 --image $(reinterpret_path_for_chroot ${FLAGS_image})" | 96 --image $(reinterpret_path_for_chroot ${FLAGS_image})" |
97 IMAGE_PATH="${FLAGS_image}" | 97 IMAGE_PATH="${FLAGS_image}" |
98 | 98 |
99 elif [ -n "${FLAGS_archive_dir}" ]; then | 99 elif [ -n "${FLAGS_archive_dir}" ]; then |
100 devserver_flags="${devserver_flags} \ | 100 devserver_flags="${devserver_flags} \ |
101 --archive_dir $(reinterpret_path_for_chroot ${FLAGS_archive_dir}) -t" | 101 --archive_dir $(reinterpret_path_for_chroot ${FLAGS_archive_dir}) -t" |
102 IMAGE_PATH="${FLAGS_archive_dir}/chromiumos_test_image.bin" | 102 IMAGE_PATH="${FLAGS_archive_dir}/chromiumos_test_image.bin" |
| 103 else |
| 104 # IMAGE_PATH should be the newest image and learn the board from |
| 105 # the target. |
| 106 FLAGS_board="" |
| 107 learn_board |
| 108 IMAGE_PATH="$($(dirname "$0")/get_latest_image.sh --board="${FLAGS_board}")" |
| 109 IMAGE_PATH="${IMAGE_PATH}/chromiumos_image.bin" |
103 fi | 110 fi |
104 | 111 |
105 info "Starting devserver with flags ${devserver_flags}" | 112 info "Starting devserver with flags ${devserver_flags}" |
106 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ | 113 ./enter_chroot.sh "sudo ./start_devserver ${devserver_flags} \ |
107 --client_prefix=ChromeOSUpdateEngine > ${FLAGS_server_log} 2>&1" & | 114 --client_prefix=ChromeOSUpdateEngine > ${FLAGS_server_log} 2>&1" & |
108 | 115 |
109 echo -n "Waiting on devserver to start" | 116 echo -n "Waiting on devserver to start" |
110 until netstat -anp 2>&1 | grep 0.0.0.0:${FLAGS_devserver_port} > /dev/null | 117 until netstat -anp 2>&1 | grep 0.0.0.0:${FLAGS_devserver_port} > /dev/null |
111 do | 118 do |
112 sleep .5 | 119 sleep .5 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 verify_image | 355 verify_image |
349 else | 356 else |
350 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 357 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
351 info "Update was successful and rebooted to $release_description" | 358 info "Update was successful and rebooted to $release_description" |
352 fi | 359 fi |
353 | 360 |
354 exit 0 | 361 exit 0 |
355 } | 362 } |
356 | 363 |
357 main $@ | 364 main $@ |
OLD | NEW |