Chromium Code Reviews| 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 |