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

Unified Diff: stateful_update

Issue 6626028: Modify stateful update clobber logic to write to different file. (Closed) Base URL: http://git.chromium.org/git/dev-util.git@master
Patch Set: Created 9 years, 10 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: stateful_update
diff --git a/stateful_update b/stateful_update
index 0c1bd004ede529ac3f8398c11b51ace174066b40..ac7fdc50aa342a72d7e24cce0be2c86d36b69b03 100755
--- a/stateful_update
+++ b/stateful_update
@@ -34,7 +34,7 @@ update_dev_image () {
else
if [ -f "${STATEFUL_DIR}${LSB_RELEASE}" ]; then
DEVSERVER_URL=$(grep CHROMEOS_DEVSERVER ${STATEFUL_DIR}${LSB_RELEASE} | \
petkov 2011/03/04 23:31:57 no need for trailing \
- cut -f 2 -d '=')
+ cut -f 2 -d '=')
fi
if [ -z "${DEVSERVER_URL}" ]; then
DEVSERVER_URL=$(grep CHROMEOS_DEVSERVER ${LSB_RELEASE} | cut -f 2 -d '=')
@@ -56,33 +56,35 @@ update_dev_image () {
tar --ignore-command-error --overwrite --directory=${STATEFUL_DIR} -xz
echo >&2 "Successfully downloaded update"
- if [ -d "${STATEFUL_DIR}/var_new" ] && [ -d "${STATEFUL_DIR}/dev_image_new" ]
- then
- echo >&2 "Notifying startup that an update is available"
- touch "${STATEFUL_DIR}/.update_available"
- else
- echo >&2 "No update available"
+ if [ ! -d "${STATEFUL_DIR}/var_new" ] || \
petkov 2011/03/04 23:31:57 no need for trailing \
+ [ ! -d "${STATEFUL_DIR}/dev_image_new" ]; then
+ echo >&2 "Missing var or dev_image in stateful payload."
+ return 1
fi
}
update_old_state () {
echo >&2 "Performing standard stateful update."
+ touch "${STATEFUL_DIR}/.update_available"
petkov 2011/03/04 23:31:57 echo -n "" > .update_available
}
update_clean_state () {
echo >&2 "Restoring state to factory_install with dev_image."
- echo "fast test" > "/mnt/stateful_partition/factory_install_reset"
+ echo "clobber" > "${STATEFUL_DIR}/.update_available"
}
main () {
- update_dev_image
- if [ "${FLAGS_stateful_change}" = "${OLD_STATE}" ]; then
- update_old_state
- elif [ "${FLAGS_stateful_change}" = "${CLEAN_STATE}" ]; then
- update_clean_state
+ if update_dev_image; then
+ if [ "${FLAGS_stateful_change}" = "${OLD_STATE}" ]; then
+ update_old_state
+ elif [ "${FLAGS_stateful_change}" = "${CLEAN_STATE}" ]; then
+ update_clean_state
+ else
+ echo >&2 "Invalid state given to stateful update. Aborting..."
+ return 1
+ fi
else
- echo >&2 "Invalid state given to stateful update. Aborting..."
- exit 1
+ return 1
fi
}
« 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