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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 echo 'CHROMEOS_DEVSERVER=${devserver_url}' >> /etc/lsb-release" | 92 echo 'CHROMEOS_DEVSERVER=${devserver_url}' >> /etc/lsb-release" |
93 fi | 93 fi |
94 } | 94 } |
95 | 95 |
96 function run_auto_update { | 96 function run_auto_update { |
97 echo "Starting update" | 97 echo "Starting update" |
98 local update_file=/var/log/softwareupdate.log | 98 local update_file=/var/log/softwareupdate.log |
99 # Clear it out so we don't see a prior run and make sure it | 99 # Clear it out so we don't see a prior run and make sure it |
100 # exists so the first tail below can't fail if it races the | 100 # exists so the first tail below can't fail if it races the |
101 # memento updater first write and wins. | 101 # memento updater first write and wins. |
102 remote_sh "rm -f ${update_file}; touch ${update_file}; \ | 102 remote_sh "rm -f /tmp/memento_autoupdate_completed; rm -f ${update_file}; \ |
103 /opt/google/memento_updater/memento_updater.sh</dev/null>&/dev/null&" | 103 touch ${update_file}; \ |
| 104 /opt/google/memento_updater/memento_updater.sh --force_update < /dev/null\ |
| 105 >&/dev/null&" |
104 | 106 |
105 local update_error | 107 local update_error |
106 local output_file | 108 local output_file |
107 local progress | 109 local progress |
108 | 110 |
109 update_error=1 | 111 update_error=1 |
110 output_file="${TMP}/output" | 112 output_file="${TMP}/output" |
111 | 113 |
112 while true; do | 114 while true; do |
113 # The softwareupdate.log gets pretty bit with download progress | 115 # The softwareupdate.log gets pretty bit with download progress |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 fi | 213 fi |
212 | 214 |
213 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" | 215 remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" |
214 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) | 216 local release_description=$(echo $REMOTE_OUT | cut -d '=' -f 2) |
215 echo "Update was successful and rebooted to $release_description" | 217 echo "Update was successful and rebooted to $release_description" |
216 | 218 |
217 return 0 | 219 return 0 |
218 } | 220 } |
219 | 221 |
220 main $@ | 222 main $@ |
OLD | NEW |