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

Unified Diff: src/platform/installer/chromeos-postinst

Issue 1881001: AU: Many minor cleanup changes (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 8 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 | src/platform/update_engine/download_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/installer/chromeos-postinst
diff --git a/src/platform/installer/chromeos-postinst b/src/platform/installer/chromeos-postinst
index b6e409e1af6f19c99c9871c08780909ef7446c66..151743806b89dc896e1ea3dfacb49d75835ea3c6 100755
--- a/src/platform/installer/chromeos-postinst
+++ b/src/platform/installer/chromeos-postinst
@@ -12,11 +12,27 @@
# Update /boot/extlinux.conf.
INSTALL_ROOT=`dirname "$0"`
INSTALL_DEV="$1"
+POSTCOMMIT="$2"
+
+if [ "$POSTCOMMIT" != "--postcommit" ]; then
+ # Pre-commit. Returning an error here will prevent ever booting into the
+ # installed system.
+
+ # 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
+
+else
+ # Post-commit. At this point an unexpected reboot may boot the installed
+ # system, but returning an error here will cause the updater to try to
+ # not boot the installed system, instead keeping the existing system.
-# 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
- sed -i "{ s:HDROOT:$INSTALL_DEV: }" "$INSTALL_ROOT"/boot/extlinux.conf
fi
+
« no previous file with comments | « no previous file | src/platform/update_engine/download_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698