| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 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 # This script is called after an AutoUpdate or USB install. The first argument | 7 # This script is called after an AutoUpdate or USB install. The first argument |
| 8 # is the partition where the new rootfs is installed or empty. If non-empty | 8 # is the partition where the new rootfs is installed or empty. If non-empty |
| 9 # the rootfs should be updated w/ the new bootloader config. If empty, the | 9 # the rootfs should be updated w/ the new bootloader config. If empty, the |
| 10 # rootfs is mounted-read only and should not be updated. | 10 # rootfs is mounted-read only and should not be updated. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 fi | 120 fi |
| 121 FIRMWARE_UPDATE_ARGS=" $FIRMWARE_UPDATE_MODE " | 121 FIRMWARE_UPDATE_ARGS=" $FIRMWARE_UPDATE_MODE " |
| 122 echo "Updating firmware ($FIRMWARE_UPDATE_ARGS)" | 122 echo "Updating firmware ($FIRMWARE_UPDATE_ARGS)" |
| 123 env INSTALL_ROOT="${INSTALL_ROOT}" \ | 123 env INSTALL_ROOT="${INSTALL_ROOT}" \ |
| 124 "${FIRMWARE_UPDATE_SCRIPT}" ${FIRMWARE_UPDATE_ARGS} | 124 "${FIRMWARE_UPDATE_SCRIPT}" ${FIRMWARE_UPDATE_ARGS} |
| 125 # Next step after postinst may take a lot of time (eg, disk wiping) | 125 # Next step after postinst may take a lot of time (eg, disk wiping) |
| 126 # and people may confuse that as 'firmware update takes a long wait', | 126 # and people may confuse that as 'firmware update takes a long wait', |
| 127 # we explicitly prompt here. | 127 # we explicitly prompt here. |
| 128 if [ "$?" -eq 0 ]; then | 128 if [ "$?" -eq 0 ]; then |
| 129 echo "Firmware update complete." | 129 echo "Firmware update complete." |
| 130 if [ -n "${RECHECK_AFTER_UPDATE}" ]; then | 130 if [ "$(mosys platform name)" = "Mario" ] && |
| 131 [ -n "${RECHECK_AFTER_UPDATE}" ]; then |
| 131 echo "Check for kernel subkey changes" | 132 echo "Check for kernel subkey changes" |
| 132 # FIXME(wfrichar): This is a platform-specific workaround for | 133 # FIXME(wfrichar): This is a platform-specific workaround for |
| 133 # chrome-os-partner:1654. It should probably go into the firmware | 134 # chrome-os-partner:1654. It should probably go into the firmware |
| 134 # update script instead of here, but that script doesn't have all the | 135 # update script instead of here, but that script doesn't have all the |
| 135 # tools available to make the necessary changes. | 136 # tools available to make the necessary changes. |
| 136 SCRATCHDIR=$(mktemp -d /tmp/XXXXXX) | 137 SCRATCHDIR=$(mktemp -d /tmp/XXXXXX) |
| 137 cd $SCRATCHDIR | 138 cd $SCRATCHDIR |
| 138 # Note: This code only runs when we're autoupdating, so we know that | 139 # Note: This code only runs when we're autoupdating, so we know that |
| 139 # we're running from the newly updated partition. We need to use the | 140 # we're running from the newly updated partition. We need to use the |
| 140 # various firmware utilities from that partition too. | 141 # various firmware utilities from that partition too. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 echo "marking part $LEGACY_PART_NUM bootable (new)" | 396 echo "marking part $LEGACY_PART_NUM bootable (new)" |
| 396 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1 | 397 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1 |
| 397 else | 398 else |
| 398 # The old gpt tool requires a -b arg to specify the PMBR bootcode. We don't | 399 # The old gpt tool requires a -b arg to specify the PMBR bootcode. We don't |
| 399 # want to change the code, so we have to extract it, then put it back. | 400 # want to change the code, so we have to extract it, then put it back. |
| 400 dd if=${ROOT_DEV} bs=512 count=1 of=/tmp/oldpmbr.bin | 401 dd if=${ROOT_DEV} bs=512 count=1 of=/tmp/oldpmbr.bin |
| 401 echo "marking part $LEGACY_PART_NUM bootable (old)" | 402 echo "marking part $LEGACY_PART_NUM bootable (old)" |
| 402 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 | 403 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 |
| 403 fi | 404 fi |
| 404 fi | 405 fi |
| OLD | NEW |