| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 # Copys stateful update script which fetches the newest stateful update | 64 # Copys stateful update script which fetches the newest stateful update |
| 65 # from the dev server and prepares the update. chromeos_startup finishes | 65 # from the dev server and prepares the update. chromeos_startup finishes |
| 66 # the update on next boot. | 66 # the update on next boot. |
| 67 function copy_stateful_update { | 67 function copy_stateful_update { |
| 68 echo "Starting stateful update." | 68 echo "Starting stateful update." |
| 69 local dev_dir="$(dirname $0)/../platform/dev" | 69 local dev_dir="$(dirname $0)/../platform/dev" |
| 70 | 70 |
| 71 # Copy over update script and run update. | 71 # Copy over update script and run update. |
| 72 remote_cp "$dev_dir/stateful_update" "/tmp" | 72 remote_cp_to "$dev_dir/stateful_update" "/tmp" |
| 73 remote_sh "/tmp/stateful_update" | 73 remote_sh "/tmp/stateful_update" |
| 74 } | 74 } |
| 75 | 75 |
| 76 function prepare_update_metadata { | 76 function prepare_update_metadata { |
| 77 remote_sh "mount -norw,remount /" | 77 remote_sh "mount -norw,remount /" |
| 78 | 78 |
| 79 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then | 79 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then |
| 80 echo "Forcing update independent of the current version" | 80 echo "Forcing update independent of the current version" |
| 81 remote_sh "cat /etc/lsb-release |\ | 81 remote_sh "cat /etc/lsb-release |\ |
| 82 grep -v CHROMEOS_RELEASE_VERSION > /etc/lsb-release~;\ | 82 grep -v CHROMEOS_RELEASE_VERSION > /etc/lsb-release~;\ |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 fi | 224 fi |
| 225 | 225 |
| 226 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" | 226 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" |
| 227 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) | 227 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) |
| 228 echo "Update was successful and rebooted to $release_description" | 228 echo "Update was successful and rebooted to $release_description" |
| 229 | 229 |
| 230 return 0 | 230 return 0 |
| 231 } | 231 } |
| 232 | 232 |
| 233 main $@ | 233 main $@ |
| OLD | NEW |