Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: image_to_live.sh

Issue 6576023: scripts: call devserver/payload generators from chroot & delete moved scripts (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: start_devserver pwn Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 # --- BEGIN COMMON.SH BOILERPLATE --- 9 # --- BEGIN COMMON.SH BOILERPLATE ---
10 # Load common CrOS utilities. Inside the chroot this file is installed in 10 # Load common CrOS utilities. Inside the chroot this file is installed in
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 --proxy_port ${FLAGS_proxy_port}" 173 --proxy_port ${FLAGS_proxy_port}"
174 fi 174 fi
175 175
176 [ ${FLAGS_for_vm} -eq ${FLAGS_TRUE} ] && \ 176 [ ${FLAGS_for_vm} -eq ${FLAGS_TRUE} ] && \
177 devserver_flags="${devserver_flags} --for_vm" 177 devserver_flags="${devserver_flags} --for_vm"
178 178
179 devserver_flags="${devserver_flags} \ 179 devserver_flags="${devserver_flags} \
180 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\"" 180 --src_image=\"$(reinterpret_path_for_chroot ${FLAGS_src_image})\""
181 181
182 info "Starting devserver with flags ${devserver_flags}" 182 info "Starting devserver with flags ${devserver_flags}"
183 ./enter_chroot.sh -- sudo sh -c "./start_devserver ${devserver_flags} \ 183 ./enter_chroot.sh -- sudo sh -c "start_devserver ${devserver_flags} \
184 --client_prefix=ChromeOSUpdateEngine \ 184 --client_prefix=ChromeOSUpdateEngine \
185 --board=${FLAGS_board} \ 185 --board=${FLAGS_board} \
186 --port=${FLAGS_devserver_port} > ${FLAGS_server_log} 2>&1" & 186 --port=${FLAGS_devserver_port} > ${FLAGS_server_log} 2>&1" &
187 187
188 info "Waiting on devserver to start" 188 info "Waiting on devserver to start"
189 info "note: be patient as the server generates the update before starting." 189 info "note: be patient as the server generates the update before starting."
190 until netstat -anp 2>&1 | grep 0.0.0.0:${FLAGS_devserver_port} > /dev/null; do 190 until netstat -anp 2>&1 | grep 0.0.0.0:${FLAGS_devserver_port} > /dev/null; do
191 sleep 5 191 sleep 5
192 echo -n "." 192 echo -n "."
193 if ! pgrep -f start_devserver > /dev/null; then 193 if ! pgrep -f start_devserver > /dev/null; then
(...skipping 21 matching lines...) Expand all
215 # Assume users providing an update url are using an archive_dir path. 215 # Assume users providing an update url are using an archive_dir path.
216 if [ -n "${FLAGS_update_url}" ]; then 216 if [ -n "${FLAGS_update_url}" ]; then
217 stateful_url=$(echo ${dev_url} | sed -e "s/update/static\/archive/") 217 stateful_url=$(echo ${dev_url} | sed -e "s/update/static\/archive/")
218 else 218 else
219 stateful_url=$(echo ${dev_url} | sed -e "s/update/static/") 219 stateful_url=$(echo ${dev_url} | sed -e "s/update/static/")
220 fi 220 fi
221 221
222 info "Starting stateful update using URL ${stateful_url}" 222 info "Starting stateful update using URL ${stateful_url}"
223 223
224 # Copy over update script and run update. 224 # Copy over update script and run update.
225 local dev_dir="${SCRIPTS_DIR}/../platform/dev" 225 local chroot_path="${SCRIPTS_DIR}/../../chroot"
226 remote_cp_to "${dev_dir}/stateful_update" "/tmp" 226 local stateful_update_script="/usr/bin/stateful_update"
227
228 remote_cp_to "${chroot_path}/${stateful_update_script}" "/tmp"
227 remote_sh "/tmp/stateful_update ${stateful_update_args} ${stateful_url}" 229 remote_sh "/tmp/stateful_update ${stateful_update_args} ${stateful_url}"
228 } 230 }
229 231
230 function get_update_args { 232 function get_update_args {
231 if [ -z ${1} ]; then 233 if [ -z ${1} ]; then
232 die "No url provided for update." 234 die "No url provided for update."
233 fi 235 fi
234 local update_args="--omaha_url ${1}" 236 local update_args="--omaha_url ${1}"
235 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then 237 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then
236 info "Forcing update independent of the current version" 238 info "Forcing update independent of the current version"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) 440 local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2)
439 info "Update was successful and rebooted to $release_description" 441 info "Update was successful and rebooted to $release_description"
440 fi 442 fi
441 443
442 print_time_elapsed 444 print_time_elapsed
443 445
444 exit 0 446 exit 0
445 } 447 }
446 448
447 main $@ 449 main $@
OLDNEW
« no previous file with comments | « generate_au_zip.py ('k') | start_devserver » ('j') | start_devserver » ('J')

Powered by Google App Engine
This is Rietveld 408576698