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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/image_signing/sign_firmware.sh
diff --git a/scripts/image_signing/sign_firmware.sh b/scripts/image_signing/sign_firmware.sh
new file mode 100755
index 0000000000000000000000000000000000000000..1d20e10cf089f4a7326f319c205b4b69a2cbdbea
--- /dev/null
+++ b/scripts/image_signing/sign_firmware.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Wrapper script for re-signing a firmware image.
+
+# Determine script directory
+SCRIPT_DIR=$(dirname $0)
+
+# Abort on error.
+set -e
+
+FIRMWARE_VERSION=1
+
+if [ $# -ne 3 ]; then
+ cat<<EOF
+Usage: $0 <input_firmware> <key_dir> <output_firmware>
+
+Signs <input_firmware> with keys in <key_dir> and outputs signed firmware to
+<output_firmware>.
+EOF
+ exit 1
+fi
+
+IN_FIRMWARE=$1
+KEY_DIR=$2
+OUT_FIRMWARE=$3
+
+temp_fw=$(mktemp)
+trap "rm ${temp_fw}" EXIT
+
+# Replace the root and recovery key in the Google Binary Block of the firmware.
+gbb_utility -s \
+ --rootkey=${KEY_DIR}/root_key.vbpubk \
+ --recoverykey=${KEY_DIR}/recovery_key.vbpubk \
+ ${IN_FIRMWARE} ${temp_fw}
+
+# Resign the firmware with new keys
+${SCRIPT_DIR}/resign_firmwarefd.sh ${temp_fw} ${OUT_FIRMWARE} \
+ ${KEY_DIR}/firmware_data_key.vbprivk \
+ ${KEY_DIR}/firmware.keyblock \
+ ${KEY_DIR}/dev_firmware_data_key.vbprivk \
+ ${KEY_DIR}/dev_firmware.keyblock \
+ ${KEY_DIR}/kernel_subkey.vbpubk \
+ ${FIRMWARE_VERSION}
« 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