| OLD | NEW |
| (Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Copyright (c) 2010 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 # Script that just takes in a kernel partition and outputs a new vblock |
| 8 # signed with the specific keys. For use on signing servers. |
| 9 |
| 10 # vbutil_kernel must be in the system path. |
| 11 |
| 12 # Abort on error |
| 13 set -e |
| 14 |
| 15 # Check arguments |
| 16 if [ $# -ne 4 ] ; then |
| 17 echo "usage: $0 src_kpart dst_vblock kernel_datakey kernel_keyblock" |
| 18 exit 1 |
| 19 fi |
| 20 |
| 21 # Make sure the tools we need are available. |
| 22 type -P vbutil_kernel &>/dev/null || \ |
| 23 ( echo "vbutil_kernel tool not found."; exit 1; ) |
| 24 |
| 25 src_kpart=$1 |
| 26 dst_vblock=$2 |
| 27 kernel_datakey=$3 |
| 28 kernel_keyblock=$4 |
| 29 |
| 30 vbutil_kernel \ |
| 31 --repack "${dst_vblock}" \ |
| 32 --vblockonly \ |
| 33 --keyblock "${kernel_keyblock}" \ |
| 34 --signprivate "${kernel_datakey}" \ |
| 35 --oldblob "${src_kpart}" |
| 36 |
| 37 echo "New kernel vblock was output to ${dst_vblock}" |
| 38 |
| OLD | NEW |