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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 # Assume users providing an update url are using an archive_dir path. | 124 # Assume users providing an update url are using an archive_dir path. |
125 if [ -n "${FLAGS_update_url}" ]; then | 125 if [ -n "${FLAGS_update_url}" ]; then |
126 stateful_url=$(echo ${dev_url} | sed -e "s/update/static\/archive/") | 126 stateful_url=$(echo ${dev_url} | sed -e "s/update/static\/archive/") |
127 else | 127 else |
128 stateful_url=$(echo ${dev_url} | sed -e "s/update/static/") | 128 stateful_url=$(echo ${dev_url} | sed -e "s/update/static/") |
129 fi | 129 fi |
130 | 130 |
131 info "Starting stateful update using URL ${stateful_url}" | 131 info "Starting stateful update using URL ${stateful_url}" |
132 | 132 |
133 # Copy over update script and run update. | 133 # Copy over update script and run update. |
134 local dev_dir="$(dirname $0)/../platform/dev" | 134 local dev_dir="${SCRIPTS_DIR}/../platform/dev" |
135 remote_cp_to "${dev_dir}/stateful_update" "/tmp" | 135 remote_cp_to "${dev_dir}/stateful_update" "/tmp" |
136 remote_sh "/tmp/stateful_update ${stateful_update_args} ${stateful_url}" | 136 remote_sh "/tmp/stateful_update ${stateful_update_args} ${stateful_url}" |
137 } | 137 } |
138 | 138 |
139 function get_update_args { | 139 function get_update_args { |
140 if [ -z ${1} ]; then | 140 if [ -z ${1} ]; then |
141 die "No url provided for update." | 141 die "No url provided for update." |
142 fi | 142 fi |
143 local update_args="--omaha_url ${1}" | 143 local update_args="--omaha_url ${1}" |
144 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then | 144 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 fi | 304 fi |
305 | 305 |
306 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" | 306 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" |
307 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) | 307 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) |
308 info "Update was successful and rebooted to $release_description" | 308 info "Update was successful and rebooted to $release_description" |
309 | 309 |
310 return 0 | 310 return 0 |
311 } | 311 } |
312 | 312 |
313 main $@ | 313 main $@ |
OLD | NEW |