summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-fitimage.bbclass
diff options
context:
space:
mode:
authorAyoub Zaki <ayoub.zaki@embexus.com>2017-11-02 16:48:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-19 12:46:44 +0100
commit5a0f3b18b2643a70ab543cbf49c2c3fa489988be (patch)
tree2f038c5be3ec4d21748c2d759c3294b6e3846196 /meta/classes/kernel-fitimage.bbclass
parentffdd54954b40881f73a600cf941dfc38c428d9f0 (diff)
downloadpoky-5a0f3b18b2643a70ab543cbf49c2c3fa489988be.tar.gz
kernel-fitimage: introduce FIT_HASH_ALG
sanitize fitImage hash algorithm selection with FIT_HASH_ALG switch default hash algorithm from sha1 to sha256 (From OE-Core rev: 8c9d5d59cb1575fac17c461090937df4cbb3d3b5) Signed-off-by: Ayoub Zaki <ayoub.zaki@embexus.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r--meta/classes/kernel-fitimage.bbclass13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 9e224daf05..b51882dce4 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -50,6 +50,9 @@ python __anonymous () {
50# Options for the device tree compiler passed to mkimage '-D' feature: 50# Options for the device tree compiler passed to mkimage '-D' feature:
51UBOOT_MKIMAGE_DTCOPTS ??= "" 51UBOOT_MKIMAGE_DTCOPTS ??= ""
52 52
53# fitImage Hash Algo
54FIT_HASH_ALG ?= "sha256"
55
53# 56#
54# Emit the fitImage ITS header 57# Emit the fitImage ITS header
55# 58#
@@ -109,7 +112,7 @@ EOF
109# $4 ... Compression type 112# $4 ... Compression type
110fitimage_emit_section_kernel() { 113fitimage_emit_section_kernel() {
111 114
112 kernel_csum="sha1" 115 kernel_csum="${FIT_HASH_ALG}"
113 116
114 ENTRYPOINT="${UBOOT_ENTRYPOINT}" 117 ENTRYPOINT="${UBOOT_ENTRYPOINT}"
115 if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then 118 if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
@@ -142,7 +145,7 @@ EOF
142# $3 ... Path to DTB image 145# $3 ... Path to DTB image
143fitimage_emit_section_dtb() { 146fitimage_emit_section_dtb() {
144 147
145 dtb_csum="sha1" 148 dtb_csum="${FIT_HASH_ALG}"
146 149
147 dtb_loadline="" 150 dtb_loadline=""
148 dtb_ext=${DTB##*.} 151 dtb_ext=${DTB##*.}
@@ -176,7 +179,7 @@ EOF
176# $3 ... Path to setup image 179# $3 ... Path to setup image
177fitimage_emit_section_setup() { 180fitimage_emit_section_setup() {
178 181
179 setup_csum="sha1" 182 setup_csum="${FIT_HASH_ALG}"
180 183
181 cat << EOF >> ${1} 184 cat << EOF >> ${1}
182 setup@${2} { 185 setup@${2} {
@@ -203,7 +206,7 @@ EOF
203# $3 ... Path to ramdisk image 206# $3 ... Path to ramdisk image
204fitimage_emit_section_ramdisk() { 207fitimage_emit_section_ramdisk() {
205 208
206 ramdisk_csum="sha1" 209 ramdisk_csum="${FIT_HASH_ALG}"
207 ramdisk_ctype="none" 210 ramdisk_ctype="none"
208 ramdisk_loadline="" 211 ramdisk_loadline=""
209 ramdisk_entryline="" 212 ramdisk_entryline=""
@@ -261,7 +264,7 @@ EOF
261# $6 ... default flag 264# $6 ... default flag
262fitimage_emit_section_config() { 265fitimage_emit_section_config() {
263 266
264 conf_csum="sha1" 267 conf_csum="${FIT_HASH_ALG}"
265 if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then 268 if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then
266 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" 269 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
267 fi 270 fi