summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorJamin Lin <jamin_lin@aspeedtech.com>2024-01-19 14:19:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-08 17:54:47 +0000
commit06aab81591bcf0dda8a34c38dc87a722532bdc86 (patch)
tree708fa67fbc11279f7de5a207a1c43e0af76e7002 /meta/classes-recipe
parent338a96e7c317e2b32dc8d59a1900566c670b7347 (diff)
downloadpoky-06aab81591bcf0dda8a34c38dc87a722532bdc86.tar.gz
u-boot-sign:uboot-config: support to verify signed FIT image
It does not verify the signed FIT image of kernel and uboot. To catch the unexpected errors as far as possible at the build time, add uboot-fit-check-sign tool which is provided by u-boot to verify the signed FIT image. (From OE-Core rev: 17d3c8315e7a7adbe27183e11e1b6d588c1a1784) Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/uboot-config.bbclass3
-rw-r--r--meta/classes-recipe/uboot-sign.bbclass10
2 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index 9be1d64d3e..0c579e8861 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -94,6 +94,9 @@ SPL_MKIMAGE_SIGN_ARGS ?= ""
94UBOOT_DTB ?= "" 94UBOOT_DTB ?= ""
95UBOOT_DTB_BINARY ??= "" 95UBOOT_DTB_BINARY ??= ""
96 96
97# uboot-fit_check_sign command
98UBOOT_FIT_CHECK_SIGN ?= "uboot-fit_check_sign"
99
97python () { 100python () {
98 ubootmachine = d.getVar("UBOOT_MACHINE") 101 ubootmachine = d.getVar("UBOOT_MACHINE")
99 ubootconfigflags = d.getVarFlags('UBOOT_CONFIG') 102 ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index 4b462698f9..7a0b8047e4 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -112,6 +112,10 @@ concat_dtb() {
112 -K "${UBOOT_DTB_BINARY}" \ 112 -K "${UBOOT_DTB_BINARY}" \
113 -r ${B}/fitImage-linux \ 113 -r ${B}/fitImage-linux \
114 ${UBOOT_MKIMAGE_SIGN_ARGS} 114 ${UBOOT_MKIMAGE_SIGN_ARGS}
115 # Verify the kernel image and u-boot dtb
116 ${UBOOT_FIT_CHECK_SIGN} \
117 -k "${UBOOT_DTB_BINARY}" \
118 -f ${B}/fitImage-linux
115 cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED} 119 cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED}
116 fi 120 fi
117 121
@@ -316,6 +320,12 @@ EOF
316 -K "${SPL_DIR}/${SPL_DTB_BINARY}" \ 320 -K "${SPL_DIR}/${SPL_DTB_BINARY}" \
317 -r ${UBOOT_FITIMAGE_BINARY} \ 321 -r ${UBOOT_FITIMAGE_BINARY} \
318 ${SPL_MKIMAGE_SIGN_ARGS} 322 ${SPL_MKIMAGE_SIGN_ARGS}
323 #
324 # Verify the U-boot FIT image and SPL dtb
325 #
326 ${UBOOT_FIT_CHECK_SIGN} \
327 -k "${SPL_DIR}/${SPL_DTB_BINARY}" \
328 -f ${UBOOT_FITIMAGE_BINARY}
319 fi 329 fi
320 330
321 if [ -e "${SPL_DIR}/${SPL_DTB_BINARY}" ]; then 331 if [ -e "${SPL_DIR}/${SPL_DTB_BINARY}" ]; then