Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chromeos-postinst

Issue 6691012: check whether we are running on mario before executing mario specific workarounds. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/installer.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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" -a -n "${RECHECK_AFTER_UPDATE}" ]; then
Bill Richardson 2011/03/14 19:23:28 I'd suggest using if [ expr1 ] && [ expr2 ]; th
131 echo "Check for kernel subkey changes" 131 echo "Check for kernel subkey changes"
132 # FIXME(wfrichar): This is a platform-specific workaround for 132 # FIXME(wfrichar): This is a platform-specific workaround for
133 # chrome-os-partner:1654. It should probably go into the firmware 133 # 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 134 # update script instead of here, but that script doesn't have all the
135 # tools available to make the necessary changes. 135 # tools available to make the necessary changes.
136 SCRATCHDIR=$(mktemp -d /tmp/XXXXXX) 136 SCRATCHDIR=$(mktemp -d /tmp/XXXXXX)
137 cd $SCRATCHDIR 137 cd $SCRATCHDIR
138 # Note: This code only runs when we're autoupdating, so we know that 138 # 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 139 # we're running from the newly updated partition. We need to use the
140 # various firmware utilities from that partition too. 140 # various firmware utilities from that partition too.
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 echo "marking part $LEGACY_PART_NUM bootable (new)" 395 echo "marking part $LEGACY_PART_NUM bootable (new)"
396 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1 396 "${INSTALL_ROOT}"/usr/bin/cgpt boot -i $LEGACY_PART_NUM ${ROOT_DEV} 2>&1
397 else 397 else
398 # The old gpt tool requires a -b arg to specify the PMBR bootcode. We don't 398 # 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. 399 # 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 400 dd if=${ROOT_DEV} bs=512 count=1 of=/tmp/oldpmbr.bin
401 echo "marking part $LEGACY_PART_NUM bootable (old)" 401 echo "marking part $LEGACY_PART_NUM bootable (old)"
402 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1 402 gpt -S boot -i $LEGACY_PART_NUM -b /tmp/oldpmbr.bin ${ROOT_DEV} 2>&1
403 fi 403 fi
404 fi 404 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698