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

Side by Side Diff: scripts/image_signing/sign_firmware.sh

Issue 6698014: Add wrapper script for easy signing of firmware (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: review fixes 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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
(Empty)
1 #!/bin/bash
2
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
5 # found in the LICENSE file.
6
7 # Wrapper script for re-signing a firmware image.
8
9 # Determine script directory
10 SCRIPT_DIR=$(dirname $0)
11
12 # Abort on error.
13 set -e
14
15 FIRMWARE_VERSION=1
16
17 if [ $# -ne 3 ]; then
18 cat<<EOF
19 Usage: $0 <input_firmware> <key_dir> <output_firmware>
20
21 Signs <input_firmware> with keys in <key_dir> and outputs signed firmware to
22 <output_firmware>.
23 EOF
24 exit 1
25 fi
26
27 IN_FIRMWARE=$1
28 KEY_DIR=$2
29 OUT_FIRMWARE=$3
30
31 temp_fw=$(mktemp)
32 trap "rm ${temp_fw}" EXIT
33
34 # Replace the root and recovery key in the Google Binary Block of the firmware.
35 gbb_utility -s \
36 --rootkey=${KEY_DIR}/root_key.vbpubk \
37 --recoverykey=${KEY_DIR}/recovery_key.vbpubk \
38 ${IN_FIRMWARE} ${temp_fw}
39
40 # Resign the firmware with new keys
41 ${SCRIPT_DIR}/resign_firmwarefd.sh ${temp_fw} ${OUT_FIRMWARE} \
42 ${KEY_DIR}/firmware_data_key.vbprivk \
43 ${KEY_DIR}/firmware.keyblock \
44 ${KEY_DIR}/dev_firmware_data_key.vbprivk \
45 ${KEY_DIR}/dev_firmware.keyblock \
46 ${KEY_DIR}/kernel_subkey.vbpubk \
47 ${FIRMWARE_VERSION}
OLDNEW
« 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