| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Version information. Please keep this in head of the updater. | 6 # Version information. Please keep this in head of the updater. |
| 7 SHELLBALL_FWVERSION="REPLACE_FWVERSION" | 7 SHELLBALL_FWVERSION="REPLACE_FWVERSION" |
| 8 SHELLBALL_ECVERSION="REPLACE_ECVERSION" | 8 SHELLBALL_ECVERSION="REPLACE_ECVERSION" |
| 9 | 9 |
| 10 # All scripts should die on error unless commands are specifically excepted | 10 # All scripts should die on error unless commands are specifically excepted |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 root shell: | 142 root shell: |
| 143 | 143 |
| 144 sudo chromeos-firmwareupdate --mode=recovery | 144 sudo chromeos-firmwareupdate --mode=recovery |
| 145 " | 145 " |
| 146 fi | 146 fi |
| 147 | 147 |
| 148 # TODO(hungte) add some info here to tell user how to update firmware | 148 # TODO(hungte) add some info here to tell user how to update firmware |
| 149 exit 0 | 149 exit 0 |
| 150 ;; | 150 ;; |
| 151 --mode=autoupdate) | 151 --mode=autoupdate) |
| 152 # This command is inside the stub for quick launch. | 152 PLATFORM="$(/usr/sbin/mosys platform name 2>/dev/null || true)" |
| 153 fw_version="$(crossystem fwid)" | 153 # Mario uses the old updater. |
| 154 ec_info="$(mosys -k ec info 2>/dev/null)" || ec_info="" | 154 if [ "$PLATFORM" != "Mario" ] && |
| 155 ec_version="$(eval "$ec_info"; echo "$fw_version")" | 155 [ "$PLATFORM" != "ZGA" ]; then |
| 156 notify_update=0 | 156 # This command is inside the stub for quick launch. |
| 157 verbose_message "ec_version: $ec_version ; ec_info: $ec_info" | 157 fw_version="$(crossystem fwid)" |
| 158 if [ "$SHELLBALL_FWVERSION" != "$fw_version" ] && | 158 ec_info="$(mosys -k ec info 2>/dev/null)" || ec_info="" |
| 159 [ "$SHELLBALL_FWVERSION" != "IGNORE" ]; then | 159 ec_version="$(eval "$ec_info"; echo "$fw_version")" |
| 160 echo "System firmware update available: [$SHELLBALL_FWVERSION]" | 160 notify_update=0 |
| 161 echo "Currently installed system firmware: [$fw_version]" | 161 verbose_message "ec_version: $ec_version ; ec_info: $ec_info" |
| 162 notify_update=1 | 162 if [ "$SHELLBALL_FWVERSION" != "$fw_version" ] && |
| 163 fi | 163 [ "$SHELLBALL_FWVERSION" != "IGNORE" ]; then |
| 164 if [ "$SHELLBALL_ECVERSION" != "$ec_version" ] && | 164 echo "System firmware update available: [$SHELLBALL_FWVERSION]" |
| 165 [ "$SHELLBALL_ECVERSION" != "IGNORE" ]; then | 165 echo "Currently installed system firmware: [$fw_version]" |
| 166 echo "EC firmware update available: [$SHELLBALL_ECVERSION]" | 166 notify_update=1 |
| 167 echo "Currently installed EC firmware: [$ec_version]" | 167 fi |
| 168 notify_update=1 | 168 if [ "$SHELLBALL_ECVERSION" != "$ec_version" ] && |
| 169 fi | 169 [ "$SHELLBALL_ECVERSION" != "IGNORE" ]; then |
| 170 if [ $notify_update -eq 0 ]; then | 170 echo "EC firmware update available: [$SHELLBALL_ECVERSION]" |
| 171 echo " | 171 echo "Currently installed EC firmware: [$ec_version]" |
| 172 No firmware auto update is available. Returning gracefully. | 172 notify_update=1 |
| 173 " | 173 fi |
| 174 exit 0 | 174 if [ $notify_update -eq 0 ]; then |
| 175 echo " |
| 176 No firmware auto update is available. Returning gracefully. |
| 177 " |
| 178 exit 0 |
| 179 fi |
| 175 fi | 180 fi |
| 176 break | 181 break |
| 177 ;; | 182 ;; |
| 178 --force) | 183 --force) |
| 179 force_flag=1 | 184 force_flag=1 |
| 180 shift | 185 shift |
| 181 ;; | 186 ;; |
| 182 -h|"-?"|--help) | 187 -h|"-?"|--help) |
| 183 echo "Shellball -- self-extract and install" | 188 echo "Shellball -- self-extract and install" |
| 184 echo "" | 189 echo "" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 fi | 265 fi |
| 261 fi | 266 fi |
| 262 | 267 |
| 263 verbose_message "Run built-in script ($SCRIPT) ..." | 268 verbose_message "Run built-in script ($SCRIPT) ..." |
| 264 if ! $SCRIPT "$@"; then | 269 if ! $SCRIPT "$@"; then |
| 265 error_exit "ERROR: $SCRIPT failed." | 270 error_exit "ERROR: $SCRIPT failed." |
| 266 fi | 271 fi |
| 267 exit 0 | 272 exit 0 |
| 268 | 273 |
| 269 # Below are uuencoded blob. Don't put code behind exit 0. | 274 # Below are uuencoded blob. Don't put code behind exit 0. |
| OLD | NEW |