summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-01-08 10:25:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-26 23:39:06 +0000
commit4ad9222d092aaf0777712883f7c3e4836989f6de (patch)
treec02efc4a295b31df3389dd8b7b434ea2c842d5b5 /meta
parent7a23e13b251bf8b4121635d7d2752580ab7861a2 (diff)
downloadpoky-4ad9222d092aaf0777712883f7c3e4836989f6de.tar.gz
kernel-fitimage: Allow user to select dtb when multiple dtb exists
Allow user to select the default DTB for FIT image when multiple dtb's exists. From machine.conf or local.conf user can specify the default dtb for FIT image as shown below. FIT_CONF_DEFAULT_DTB = "board-default.dtb" Also fallback to avaialable dtb when FIT_CONF_DEFAULT_DTB doesn't exits or empty. (From OE-Core rev: 43926dfc527d865f1051299b2dd688770e149b23) Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-recipe/kernel-fitimage.bbclass16
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index 06cdc4f1ec..f6d82ce061 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -73,6 +73,9 @@ FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
73 73
74FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" 74FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
75 75
76# Allow user to select the default DTB for FIT image when multiple dtb's exists.
77FIT_CONF_DEFAULT_DTB ?= ""
78
76# Keys used to sign individually image nodes. 79# Keys used to sign individually image nodes.
77# The keys to sign image nodes must be different from those used to sign 80# The keys to sign image nodes must be different from those used to sign
78# configuration nodes, otherwise the "required" property, from 81# configuration nodes, otherwise the "required" property, from
@@ -375,6 +378,7 @@ fitimage_emit_section_config() {
375 bootscr_line="" 378 bootscr_line=""
376 setup_line="" 379 setup_line=""
377 default_line="" 380 default_line=""
381 default_dtb_image="${FIT_CONF_DEFAULT_DTB}"
378 382
379 # conf node name is selected based on dtb ID if it is present, 383 # conf node name is selected based on dtb ID if it is present,
380 # otherwise its selected based on kernel ID 384 # otherwise its selected based on kernel ID
@@ -417,7 +421,17 @@ fitimage_emit_section_config() {
417 # default node is selected based on dtb ID if it is present, 421 # default node is selected based on dtb ID if it is present,
418 # otherwise its selected based on kernel ID 422 # otherwise its selected based on kernel ID
419 if [ -n "$dtb_image" ]; then 423 if [ -n "$dtb_image" ]; then
420 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" 424 # Select default node as user specified dtb when
425 # multiple dtb exists.
426 if [ -n "$default_dtb_image" ]; then
427 if [ -s "${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image" ]; then
428 default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
429 else
430 bbwarn "Couldn't find a valid user specified dtb in ${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image"
431 fi
432 else
433 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
434 fi
421 else 435 else
422 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" 436 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
423 fi 437 fi