summaryrefslogtreecommitdiffstats
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:37:05 +0000
commit738cb2a73536fdc2736efe516604bfcd4510dcc2 (patch)
treeaf2419c91f81d71e68cb3a9f88a0c59ec00385c2
parent3edd7714c1b948f5fb4102b1881c2bb26a20a64c (diff)
downloadpoky-738cb2a73536fdc2736efe516604bfcd4510dcc2.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: 678ad9458a17d9feebb2ea897be4b9bc0daf3391) Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit cd397284fa5f17de7e0a0d4b6b26fb8b56c3cd48) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-fitimage.bbclass16
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 3cd4a45bbe..27e17db951 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -67,6 +67,9 @@ FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
67 67
68FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" 68FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
69 69
70# Allow user to select the default DTB for FIT image when multiple dtb's exists.
71FIT_CONF_DEFAULT_DTB ?= ""
72
70# Keys used to sign individually image nodes. 73# Keys used to sign individually image nodes.
71# The keys to sign image nodes must be different from those used to sign 74# The keys to sign image nodes must be different from those used to sign
72# configuration nodes, otherwise the "required" property, from 75# configuration nodes, otherwise the "required" property, from
@@ -369,6 +372,7 @@ fitimage_emit_section_config() {
369 bootscr_line="" 372 bootscr_line=""
370 setup_line="" 373 setup_line=""
371 default_line="" 374 default_line=""
375 default_dtb_image="${FIT_CONF_DEFAULT_DTB}"
372 376
373 # conf node name is selected based on dtb ID if it is present, 377 # conf node name is selected based on dtb ID if it is present,
374 # otherwise its selected based on kernel ID 378 # otherwise its selected based on kernel ID
@@ -411,7 +415,17 @@ fitimage_emit_section_config() {
411 # default node is selected based on dtb ID if it is present, 415 # default node is selected based on dtb ID if it is present,
412 # otherwise its selected based on kernel ID 416 # otherwise its selected based on kernel ID
413 if [ -n "$dtb_image" ]; then 417 if [ -n "$dtb_image" ]; then
414 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" 418 # Select default node as user specified dtb when
419 # multiple dtb exists.
420 if [ -n "$default_dtb_image" ]; then
421 if [ -s "${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image" ]; then
422 default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
423 else
424 bbwarn "Couldn't find a valid user specified dtb in ${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image"
425 fi
426 else
427 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
428 fi
415 else 429 else
416 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" 430 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
417 fi 431 fi