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

Unified Diff: client/site_tests/factory_Wipe/src/switch_partitions.sh

Issue 3440011: Force success (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Created 10 years, 3 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: client/site_tests/factory_Wipe/src/switch_partitions.sh
diff --git a/client/site_tests/factory_Wipe/src/switch_partitions.sh b/client/site_tests/factory_Wipe/src/switch_partitions.sh
index 4563fa634d4dbf71ea207a6d09d417ea05c64188..cf5216644a4348ef043bbc56e1cc4d675a6c0ee4 100755
--- a/client/site_tests/factory_Wipe/src/switch_partitions.sh
+++ b/client/site_tests/factory_Wipe/src/switch_partitions.sh
@@ -18,6 +18,7 @@ fi
DEV=${ROOT_DEV%[0-9]}
# Note: this works only for single digit partition numbers.
ROOT_PART=$(echo "${ROOT_DEV}" | sed -e 's/^.*\([0-9]\)$/\1/')
+OTHER_ROOT_PART=$(echo "${OTHER_ROOT_DEV}" | sed -e 's/^.*\([0-9]\)$/\1/')
# Successfully being able to mount the other partition
# and run postinst guarantees that there is a real partition there.
@@ -33,8 +34,12 @@ rmdir "$MOUNTPOINT"
# Destroy this root partition if we've successfully switched.
if [ "${POSTINST_RETURN_CODE}" = "0" ]; then
cgpt add -i "$((${ROOT_PART} - 1))" -P 0 -S 0 -T 0 "${DEV}"
- RC=$?
- if [ "${RC}" != "0" ]; then
+ if [ "$?" != "0" ]; then
+ echo "Failed to run cgpt"
+ return 1
+ fi
+ cgpt add -i "$((${OTHER_ROOT_PART} - 1))" -P 3 -S 1 -T 0 "${DEV}"
+ if [ "$?" != "0" ]; then
echo "Failed to run cgpt"
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