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

Unified Diff: chromeos-postinst

Issue 2742009: Modify postinstall to avoid x86-specific dependencies. (Closed) Base URL: http://src.chromium.org/git/installer.git
Patch Set: Rebase Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos-postinst
diff --git a/chromeos-postinst b/chromeos-postinst
index e183247ab9c24ba9f46ed953b704212d00987534..6504e4e17f7acfade27ab1fd8b367c72d388c5ed 100755
--- a/chromeos-postinst
+++ b/chromeos-postinst
@@ -14,7 +14,7 @@ INSTALL_ROOT=`dirname "$0"`
INSTALL_DEV="$1"
POSTCOMMIT="$2"
# Find whole disk device.
-ROOT_DEV=${INSTALL_DEV%%[0-9]*}
+ROOT_DEV=$(get_block_dev_from_partition_dev ${INSTALL_DEV})
NEW_PART_NUM=${INSTALL_DEV##*/*[a-z]}
case ${NEW_PART_NUM} in
@@ -39,17 +39,20 @@ if [ "$POSTCOMMIT" != "--postcommit" ]; then
echo " Set boot target to ${INSTALL_DEV}: \
Partition ${NEW_PART_NUM}, Slot ${BOOT_SLOT}"
- echo "Updating /boot/extlinux.conf target"
- # If the mount-point is read-write, update the bootloader
- # Only update extlinux.conf if $1 is non-empty
- if [ -n "$INSTALL_DEV" ]; then
- # Set default label to chromeos-hd.
- sed -i 's/^DEFAULT .*/DEFAULT chromeos-hd/' \
- "$INSTALL_ROOT"/boot/extlinux.conf || true
- sed -i "{ s:HDROOT:$INSTALL_DEV: }" \
- "$INSTALL_ROOT"/boot/extlinux.conf || true
+ if [ -f /boot/extlinux.conf ]; then
+ echo "Updating /boot/extlinux.conf target"
+ # If the mount-point is read-write, update the bootloader
+ # Only update extlinux.conf if $1 is non-empty
+ if [ -n "$INSTALL_DEV" ]; then
+ # Set default label to chromeos-hd.
+ sed -i 's/^DEFAULT .*/DEFAULT chromeos-hd/' \
+ "$INSTALL_ROOT"/boot/extlinux.conf || true
+ sed -i "{ s:HDROOT:$INSTALL_DEV: }" \
+ "$INSTALL_ROOT"/boot/extlinux.conf || true
+ fi
fi
+
echo "Updating grub target for EFI BIOS"
# Set up grub.cfg
${INSTALL_ROOT}/usr/sbin/chromeos-setimage ${BOOT_SLOT} \
@@ -60,6 +63,7 @@ Partition ${NEW_PART_NUM}, Slot ${BOOT_SLOT}"
sync
echo 3 > /proc/sys/vm/drop_caches
+
echo "Updating gpt PMBR target for legacy BIOS"
# Configure the PMBR to boot the new image.
#
« 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