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

Unified Diff: factory_reset.sh

Issue 6708106: Fix factory installer for ARM platforms (Closed) Base URL: ssh://gitrw.chromium.org:9222/factory_installer.git@master
Patch Set: Code review Created 9 years, 9 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 | « factory_install.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: factory_reset.sh
diff --git a/factory_reset.sh b/factory_reset.sh
index 3d5e66c16eaddf2bc4a204366b69f278006e80fe..a507904d59dbfc53e1fa451376856f8b8404acf5 100644
--- a/factory_reset.sh
+++ b/factory_reset.sh
@@ -9,12 +9,26 @@
# put the system back into factory fresh/shippable state.
echo "Factory reset"
-# TODO: How do we know what this is for the general case?
-if [ -b /dev/sda ]; then
+# TODO(crosbug:10680): replace arch detection with crossystem?
+if uname -m | grep -q "^i.86\$"; then
+ ARCH="INTEL"
+elif [ $(uname -m ) = "x86_64" ]; then
+ ARCH="INTEL"
+elif [ $(uname -m ) = "armv7l" ]; then
+ ARCH="ARM"
+else
+ echo "Failed to auto detect architecture"
+ exit 1
+fi
+
+if [ "$ARCH" = "INTEL" ]; then
STATE_DEV="/dev/sda1"
-elif [ -b /dev/mmcblk0 ]; then
- STATE_DEV="/dev/mmcblk01"
+elif [ "$ARCH" = "ARM" ]; then
+ STATE_DEV="/dev/mmcblk0p1"
else
+ STATE_DEV=""
+fi
+if [ ! -b "$STATE_DEV" ]; then
echo "Failed to find root SSD."
exit 1
fi
« no previous file with comments | « factory_install.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698