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

Side by Side 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: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« factory_install.sh ('K') | « factory_install.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh -x 1 #!/bin/sh -x
2 2
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This runs from the factory install/reset shim. This MUST be run 7 # This runs from the factory install/reset shim. This MUST be run
8 # from USB, in developer mode. This script will wipe OQC activity and 8 # from USB, in developer mode. This script will wipe OQC activity and
9 # put the system back into factory fresh/shippable state. 9 # put the system back into factory fresh/shippable state.
10 echo "Factory reset" 10 echo "Factory reset"
11 11
12 # TODO: How do we know what this is for the general case? 12 # TODO: How do we know what this is for the general case?
13 if [ -b /dev/sda ]; then 13 if [ -b /dev/sda ]; then
14 STATE_DEV="/dev/sda1" 14 STATE_DEV="/dev/sda1"
15 elif [ -b /dev/mmcblk0 ]; then 15 elif [ -b /dev/mmcblk0 ]; then
16 STATE_DEV="/dev/mmcblk01" 16 STATE_DEV="/dev/mmcblk0p1"
17 else 17 else
18 echo "Failed to find root SSD." 18 echo "Failed to find root SSD."
19 exit 1 19 exit 1
20 fi 20 fi
21 21
22 # Tcsd will bring up the tpm and de-own it, 22 # Tcsd will bring up the tpm and de-own it,
23 # as we are in developer/recovery mode. 23 # as we are in developer/recovery mode.
24 start tcsd 24 start tcsd
25 25
26 # Just wipe the start of the partition and remake the fs on 26 # Just wipe the start of the partition and remake the fs on
27 # the stateful partition. 27 # the stateful partition.
28 dd bs=4M count=1 if=/dev/zero of=${STATE_DEV} 28 dd bs=4M count=1 if=/dev/zero of=${STATE_DEV}
29 /sbin/mkfs.ext3 "$STATE_DEV" 29 /sbin/mkfs.ext3 "$STATE_DEV"
30 30
31 # Do any board specific resetting here. 31 # Do any board specific resetting here.
32 # board_factory_reset.sh will be installed by the board overlay if necessary. 32 # board_factory_reset.sh will be installed by the board overlay if necessary.
33 BOARD_RESET=/usr/sbin/board_factory_reset.sh 33 BOARD_RESET=/usr/sbin/board_factory_reset.sh
34 if [ -x "${BOARD_RESET}" ]; then 34 if [ -x "${BOARD_RESET}" ]; then
35 echo "Running board specific factory reset: ${BOARD_RESET}" 35 echo "Running board specific factory reset: ${BOARD_RESET}"
36 ${BOARD_RESET} || exit 1 36 ${BOARD_RESET} || exit 1
37 fi 37 fi
38 38
39 echo "Done" 39 echo "Done"
OLDNEW
« factory_install.sh ('K') | « factory_install.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698