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

Unified Diff: scripts/image_signing/resign_kernel_partition.sh

Issue 3020023: Add a script that will generate a new vblock given a kernel partition. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: use parens Created 10 years, 5 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/resign_kernel_partition.sh
diff --git a/scripts/image_signing/resign_kernel_partition.sh b/scripts/image_signing/resign_kernel_partition.sh
new file mode 100755
index 0000000000000000000000000000000000000000..1b88cb2b473ff5eaf091f718f6884a8eae1306cd
--- /dev/null
+++ b/scripts/image_signing/resign_kernel_partition.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Copyright (c) 2010 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.
+
+# Script that just takes in a kernel partition and outputs a new vblock
+# signed with the specific keys. For use on signing servers.
+
+# vbutil_kernel must be in the system path.
+
+# Abort on error
+set -e
+
+# Check arguments
+if [ $# -ne 4 ] ; then
+ echo "usage: $0 src_kpart dst_vblock kernel_datakey kernel_keyblock"
+ exit 1
+fi
+
+# Make sure the tools we need are available.
+type -P vbutil_kernel &>/dev/null || \
+ ( echo "vbutil_kernel tool not found."; exit 1; )
+
+src_kpart=$1
+dst_vblock=$2
+kernel_datakey=$3
+kernel_keyblock=$4
+
+vbutil_kernel \
+ --repack "${dst_vblock}" \
+ --vblockonly \
+ --keyblock "${kernel_keyblock}" \
+ --signprivate "${kernel_datakey}" \
+ --oldblob "${src_kpart}"
+
+echo "New kernel vblock was output to ${dst_vblock}"
+
« 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