| 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 can change key (usually developer keys) in a firmware binary | 7 # This script can change key (usually developer keys) in a firmware binary |
| 8 # image or system live firmware (EEPROM), and assign proper HWID, BMPFV as well. | 8 # image or system live firmware (EEPROM), and assign proper HWID, BMPFV as well. |
| 9 | 9 |
| 10 SCRIPT_BASE="$(dirname "$0")" | 10 SCRIPT_BASE="$(dirname "$0")" |
| 11 . "$SCRIPT_BASE/common.sh" | 11 . "$SCRIPT_BASE/common_minimal.sh" |
| 12 load_shflags || exit 1 | 12 load_shflags || exit 1 |
| 13 | 13 |
| 14 # Constants used by DEFINE_* | 14 # Constants used by DEFINE_* |
| 15 VBOOT_BASE='/usr/share/vboot' | 15 VBOOT_BASE='/usr/share/vboot' |
| 16 DEFAULT_KEYS_FOLDER="$VBOOT_BASE/devkeys" | 16 DEFAULT_KEYS_FOLDER="$VBOOT_BASE/devkeys" |
| 17 DEFAULT_BMPFV_FILE="$DEFAULT_KEYS_FOLDER/firmware_bmpfv.bin" | 17 DEFAULT_BMPFV_FILE="$DEFAULT_KEYS_FOLDER/firmware_bmpfv.bin" |
| 18 DEFAULT_BACKUP_FOLDER='/mnt/stateful_partition/backups' | 18 DEFAULT_BACKUP_FOLDER='/mnt/stateful_partition/backups' |
| 19 | 19 |
| 20 # DEFINE_string name default_value description flag | 20 # DEFINE_string name default_value description flag |
| 21 DEFINE_string from "" "Path of input file (empty for system live firmware)" "f" | 21 DEFINE_string from "" "Path of input file (empty for system live firmware)" "f" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 debug_msg "Complete." | 237 debug_msg "Complete." |
| 238 if [ -z "$FLAGS_to" ]; then | 238 if [ -z "$FLAGS_to" ]; then |
| 239 echo "Successfully changed firmware to Developer Keys. New HWID: $new_hwid" | 239 echo "Successfully changed firmware to Developer Keys. New HWID: $new_hwid" |
| 240 else | 240 else |
| 241 echo "Firmware '$FLAGS_to' now uses Developer Keys. New HWID: $new_hwid" | 241 echo "Firmware '$FLAGS_to' now uses Developer Keys. New HWID: $new_hwid" |
| 242 fi | 242 fi |
| 243 } | 243 } |
| 244 | 244 |
| 245 main | 245 main |
| OLD | NEW |