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

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

Issue 3329005: Update wipe to work with verified rootfs (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 4 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 858deb7ca3435634aed1a68036e0a031e97a77a7..f6158f08d760bc2642071d44ee627db0c46532eb 100755
--- a/client/site_tests/factory_Wipe/src/switch_partitions.sh
+++ b/client/site_tests/factory_Wipe/src/switch_partitions.sh
@@ -6,7 +6,7 @@
# This script can be called to switch from kernel slot A / sda3
# to kernel slot B / sda5 and vice versa.
-ROOT_DEV=$(rootdev)
+ROOT_DEV=$(rootdev -s)
OTHER_ROOT_DEV=$(echo $ROOT_DEV | tr '35' '53')
if [ "${ROOT_DEV}" = "${OTHER_ROOT_DEV}" ]
@@ -18,9 +18,9 @@ fi
# Successfully being able to mount the other partition
# and run postinst guarantees that there is a real partition there.
echo "Running postinst on $OTHER_ROOT_DEV"
-MOUNTPOINT=/tmp/newpart
+MOUNTPOINT=$(mktemp -d)
mkdir -p "$MOUNTPOINT"
-mount "$OTHER_ROOT_DEV" "$MOUNTPOINT"
+mount -o ro "$OTHER_ROOT_DEV" "$MOUNTPOINT"
"$MOUNTPOINT"/postinst "$OTHER_ROOT_DEV"
POSTINST_RETURN_CODE=$?
umount "$MOUNTPOINT"
« 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