| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 echo "" | 54 echo "" |
| 55 } | 55 } |
| 56 | 56 |
| 57 # Copys stateful update script which fetches the newest stateful update | 57 # Copys stateful update script which fetches the newest stateful update |
| 58 # from the dev server and prepares the update. chromeos_startup finishes | 58 # from the dev server and prepares the update. chromeos_startup finishes |
| 59 # the update on next boot. | 59 # the update on next boot. |
| 60 function copy_stateful_update { | 60 function copy_stateful_update { |
| 61 echo "Starting stateful update." | 61 echo "Starting stateful update." |
| 62 local dev_dir="$(dirname $0)/../platform/dev" | 62 local dev_dir="$(dirname $0)/../platform/dev" |
| 63 | 63 |
| 64 # Copy over tar files. | 64 # Copy over update script and run update. |
| 65 remote_cp "$dev_dir/stateful_update.sh" "/tmp" | 65 remote_cp "$dev_dir/stateful_update" "/tmp" |
| 66 remote_sh "/tmp/stateful_update.sh" | 66 remote_sh "/tmp/stateful_update" |
| 67 } | 67 } |
| 68 | 68 |
| 69 function prepare_update_metadata { | 69 function prepare_update_metadata { |
| 70 remote_sh "mount -norw,remount /" | 70 remote_sh "mount -norw,remount /" |
| 71 | 71 |
| 72 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then | 72 if [[ ${FLAGS_ignore_version} -eq ${FLAGS_TRUE} ]]; then |
| 73 echo "Forcing update independent of the current version" | 73 echo "Forcing update independent of the current version" |
| 74 remote_sh "cat /etc/lsb-release |\ | 74 remote_sh "cat /etc/lsb-release |\ |
| 75 grep -v CHROMEOS_RELEASE_VERSION > /etc/lsb-release~;\ | 75 grep -v CHROMEOS_RELEASE_VERSION > /etc/lsb-release~;\ |
| 76 mv /etc/lsb-release~ /etc/lsb-release; \ | 76 mv /etc/lsb-release~ /etc/lsb-release; \ |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 fi | 207 fi |
| 208 | 208 |
| 209 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" | 209 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" |
| 210 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) | 210 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) |
| 211 echo "Update was successful and rebooted to $release_description" | 211 echo "Update was successful and rebooted to $release_description" |
| 212 | 212 |
| 213 return 0 | 213 return 0 |
| 214 } | 214 } |
| 215 | 215 |
| 216 main $@ | 216 main $@ |
| OLD | NEW |