python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / board / chromebook / snow / sign.sh
blob39005ed6359b4fc44ba3f28ebe081722acc4ec60
1 #!/bin/sh
3 # This script creates u-boot FIT image containing the kernel and the DT,
4 # then signs it using futility from vboot-utils.
5 # The resulting file is called uImage.kpart.
7 BOARD_DIR=$(dirname $0)
8 mkimage=$HOST_DIR/usr/bin/mkimage
9 futility=$HOST_DIR/usr/bin/futility
10 devkeys=$HOST_DIR/usr/share/vboot/devkeys
12 run() { echo "$@"; "$@"; }
13 die() { echo "$@" >&2; exit 1; }
14 test -f $BINARIES_DIR/zImage || \
15 die "No kernel image found"
16 test -x $mkimage || \
17 die "No mkimage found (host-uboot-tools has not been built?)"
18 test -x $futility || \
19 die "No futility found (host-vboot-utils has not been built?)"
21 # kernel.its references zImage and exynos5250-snow.dtb, and all three
22 # files must be in current directory for mkimage.
23 run cp $BOARD_DIR/kernel.its $BINARIES_DIR/kernel.its || exit 1
24 echo "# entering $BINARIES_DIR for the next command"
25 (cd $BINARIES_DIR && run $mkimage -f kernel.its uImage.itb) || exit 1
27 # futility requires non-empty file to be supplied with --bootloader
28 # even if it does not make sense for the target platform.
29 echo > $BINARIES_DIR/dummy.txt
31 run $futility vbutil_kernel \
32 --keyblock $devkeys/kernel.keyblock \
33 --signprivate $devkeys/kernel_data_key.vbprivk \
34 --arch arm \
35 --version 1 \
36 --config $BOARD_DIR/kernel.args \
37 --vmlinuz $BINARIES_DIR/uImage.itb \
38 --bootloader $BINARIES_DIR/dummy.txt \
39 --pack $BINARIES_DIR/uImage.kpart || exit 1
41 rm -f $BINARIES_DIR/kernel.its $BINARIES_DIR/dummy.txt