-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·68 lines (56 loc) · 1.37 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -e
TOP=$(pwd)
SCRIPTS=${TOP}/scripts
export CROSS_COMPILE=arm-linux-gnueabihf-
export DTC=${SCRIPTS}/dtc
export PATH=${SCRIPTS}:$PATH
TEXT_START=$(grep CONFIG_SYS_TEXT_BASE include/configs/exynos5-common.h | awk '{ print $3 }')
NV_NAME=nv_uboot-snow
UIMAGE=${NV_NAME}.uimage
KPART=${NV_NAME}.kpart
# cleanup previous build binaries
rm -f ${NV_NAME}*
# get the proper dtc version
if [ ! -x ${DTC} ]
then
DTCSRC=${SCRIPTS}/dtc-src
rm -rf ${DTCSRC}
git clone http://git.chromium.org/chromiumos/third_party/dtc.git ${DTCSRC}
cd ${DTCSRC}
make -j4
cp dtc ${DTC}
cd ${TOP}
rm -rf ${DTCSRC}
fi
# clean, configure and build
make distclean
make snow_config
make -j4 all
# Make it look like an image U-Boot will like:
# The "-a" and "-e" here are the "CONFIG_SYS_TEXT_BASE" from
# include/configs/exynos5-common.h
tools/mkimage \
-A arm \
-O linux \
-T kernel \
-C none \
-a "${TEXT_START}" -e "${TEXT_START}" \
-n "Non-verified u-boot" \
-d u-boot-dtb.bin ${UIMAGE}
# Sign the uimage
echo dummy > dummy.txt
vbutil_kernel \
--pack ${KPART} \
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--version 1 \
--vmlinuz ${UIMAGE} \
--bootloader dummy.txt \
--config dummy.txt \
--arch arm
# clean unneeded uimage
rm -f ${UIMAGE} dummy.txt
echo " "
echo "Now run:"
echo "sudo dd if=${KPART} of=/dev/<sd_card_part_1>"