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

Unified Diff: src/scripts/image_to_live.sh

Issue 1784006: Changes to image_to_live to copy stateful partition over (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/init/chromeos_startup ('k') | src/scripts/remote_access.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/image_to_live.sh
diff --git a/src/scripts/image_to_live.sh b/src/scripts/image_to_live.sh
index 13cbff8b370d85ea7ee5bc99e042fa877886a896..7a87c2806c423514278456806950f7483d32451b 100755
--- a/src/scripts/image_to_live.sh
+++ b/src/scripts/image_to_live.sh
@@ -30,7 +30,8 @@ function kill_all_devservers {
function cleanup {
echo "Killing dev server."
kill_all_devservers
- cleanup_remote_access
+ cleanup_remote_access
+ ./mount_gpt_image.sh -mu
rm -rf "${TMP}"
}
@@ -54,6 +55,26 @@ function start_dev_server {
echo ""
}
+function copy_stateful_tarball {
+ echo "Starting stateful update."
+ # Mounts most recent image stateful dir to /tmp/s
+ ./mount_gpt_image.sh -m
+ # Create tar files for the stateful partition.
+ cd /tmp/s/var && sudo tar -cf /tmp/var.tar . && cd -
+ cd /tmp/s/dev_image && sudo tar -cf /tmp/developer.tar . && cd -
+ # Copy over tar files.
seano 2010/04/27 18:17:13 I might be missing the reason that you need to cre
+ remote_cp /tmp/var.tar /tmp
+ remote_cp /tmp/developer.tar /tmp
+ remote_sh "mkdir /mnt/stateful_partition/var_new &&\
+ mkdir /mnt/stateful_partition/dev_image_new &&\
+ tar -xf /tmp/var.tar -C /mnt/stateful_partition/var_new &&\
+ tar -xf /tmp/developer.tar \
+ -C /mnt/stateful_partition/dev_image_new &&\
+ touch /mnt/stateful_partition/.update_available"
+ # unmounts stateful partition
+ ./mount_gpt_image.sh -mu
+}
+
function prepare_update_metadata {
remote_sh "mount -norw,remount /"
@@ -178,6 +199,11 @@ function main() {
echo "Update was not successful."
exit 1
fi
+
+ if ! copy_stateful_tarball; then
+ echo "Stateful update was not successful."
+ exit 1
+ fi
remote_reboot
« no previous file with comments | « src/platform/init/chromeos_startup ('k') | src/scripts/remote_access.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698