From d0a2e12511f7592831ba68a285b5fa98990770f0 Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Tue, 14 Sep 2010 13:03:11 -0700 Subject: [PATCH] image_to_live was not providing a URL to the stateful_update script executed on the remote machine. Without the URL, stateful_update would default to reading /mnt/stateful_partition/etc/lsb-release for the URL, which is not setup by the script. I've modified image_to_live to convert the dev server url into the proper form to access the stateful.image.gz and pass it along to stateful_update on the remote system. Change-Id: I77971c83b7efef5f053fda7fcd2585ca73f3134a BUG=6705 TEST=Imaged several machines using Dev Server. Review URL: http://codereview.chromium.org/3417001 --- image_to_live.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/image_to_live.sh b/image_to_live.sh index a6b70bee90..449eba89e1 100755 --- a/image_to_live.sh +++ b/image_to_live.sh @@ -69,12 +69,22 @@ function start_dev_server { # from the dev server and prepares the update. chromeos_startup finishes # the update on next boot. function copy_stateful_update { - info "Starting stateful update." - local dev_dir="$(dirname $0)/../platform/dev" + local dev_url=$(get_devserver_url) + local stateful_url="" + + # Assume users providing an update url are using an archive_dir path. + if [ -n "${FLAGS_update_url}" ]; then + stateful_url=$(echo ${dev_url} | sed -e "s/update/static\/archive/") + else + stateful_url=$(echo ${dev_url} | sed -e "s/update/static/") + fi + + info "Starting stateful update using URL ${stateful_url}" # Copy over update script and run update. - remote_cp_to "$dev_dir/stateful_update" "/tmp" - remote_sh "/tmp/stateful_update" + local dev_dir="$(dirname $0)/../platform/dev" + remote_cp_to "${dev_dir}/stateful_update" "/tmp" + remote_sh "/tmp/stateful_update ${stateful_url}" } function get_update_args {