| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # | 2 # |
| 3 # Copyright (c) 2010 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 script converts a Chrome OS device to a pre-factory-install state: | 7 # This script converts a Chrome OS device to a pre-factory-install state: |
| 8 # * Firmware write protect disabled | 8 # * Firmware write protect disabled |
| 9 # * H2O BIOS, with RO VPD area copied from the current BIOS | 9 # * H2O BIOS, with RO VPD area copied from the current BIOS |
| 10 # * Original EC firmware | 10 # * Original EC firmware |
| 11 # * Blank SSD (no GPT) | 11 # * Blank SSD (no GPT) |
| 12 # | 12 # |
| 13 # Minimal usage: | 13 # Minimal usage: |
| 14 # tofactory.sh -b H2OBIOS.bin -e ec_shellball.sh | 14 # tofactory.sh -b H2OBIOS.bin -e ec_shellball.sh |
| 15 | 15 |
| 16 SCRIPT_BASE="$(dirname "$0")" | 16 SCRIPT_BASE="$(dirname "$0")" |
| 17 . "$SCRIPT_BASE/common.sh" | 17 . "$SCRIPT_BASE/common_minimal.sh" |
| 18 load_shflags || exit 1 | 18 load_shflags || exit 1 |
| 19 | 19 |
| 20 # Constants used by DEFINE_* | 20 # Constants used by DEFINE_* |
| 21 VBOOT_BASE='/usr/share/vboot' | 21 VBOOT_BASE='/usr/share/vboot' |
| 22 | 22 |
| 23 # DEFINE_string name default_value description flag | 23 # DEFINE_string name default_value description flag |
| 24 DEFINE_string bios "" "Path of system firmware (BIOS) binary to write" "b" | 24 DEFINE_string bios "" "Path of system firmware (BIOS) binary to write" "b" |
| 25 DEFINE_string ec "" "Path of EC shellball to execute" "e" | 25 DEFINE_string ec "" "Path of EC shellball to execute" "e" |
| 26 DEFINE_string backup_dir "" "Path of directory in whoch to store backups" "k" | 26 DEFINE_string backup_dir "" "Path of directory in whoch to store backups" "k" |
| 27 DEFINE_string asset_tag "unspecified_tag" \ | 27 DEFINE_string asset_tag "unspecified_tag" \ |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 debug_msg "Wiping SSD" | 176 debug_msg "Wiping SSD" |
| 177 $NOTHING cgpt create -z "$FLAGS_ssd" || err_die "Unable to wipe SSD" | 177 $NOTHING cgpt create -z "$FLAGS_ssd" || err_die "Unable to wipe SSD" |
| 178 fi | 178 fi |
| 179 | 179 |
| 180 # Leave the update engine stopped. We've mucked with the firmware | 180 # Leave the update engine stopped. We've mucked with the firmware |
| 181 # and SSD contents, so we shouldn't be attempting an autoupdate this | 181 # and SSD contents, so we shouldn't be attempting an autoupdate this |
| 182 # boot anyway. | 182 # boot anyway. |
| 183 } | 183 } |
| 184 | 184 |
| 185 main | 185 main |
| OLD | NEW |