summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/kernel-fitimage.bbclass
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-01-04 15:09:02 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-12 23:08:51 +0000
commit8b77cb3a8272ed6ceefa8c0970298d57b2915adc (patch)
tree24be2d50127ad3fd9913bc4bee1c45b1c63e377a /meta/classes-recipe/kernel-fitimage.bbclass
parente6cb132072d086ecc458a259a5c5425431f4697c (diff)
downloadpoky-8b77cb3a8272ed6ceefa8c0970298d57b2915adc.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: 160f2c58d68a049a87ddc7aedb2055152ac6ff4e) Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.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/kernel-fitimage.bbclass')
-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 92e236a0a4..b77747404f 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -89,6 +89,9 @@ FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
89 89
90FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" 90FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
91 91
92# Allow user to select the default DTB for FIT image when multiple dtb's exists.
93FIT_CONF_DEFAULT_DTB ?= ""
94
92# Keys used to sign individually image nodes. 95# Keys used to sign individually image nodes.
93# The keys to sign image nodes must be different from those used to sign 96# The keys to sign image nodes must be different from those used to sign
94# configuration nodes, otherwise the "required" property, from 97# configuration nodes, otherwise the "required" property, from
@@ -412,6 +415,7 @@ fitimage_emit_section_config() {
412 bootscr_line="" 415 bootscr_line=""
413 setup_line="" 416 setup_line=""
414 default_line="" 417 default_line=""
418 default_dtb_image="${FIT_CONF_DEFAULT_DTB}"
415 419
416 dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}") 420 dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}")
417 if [ -z "$dtb_image_sect" ]; then 421 if [ -z "$dtb_image_sect" ]; then
@@ -462,7 +466,17 @@ fitimage_emit_section_config() {
462 # default node is selected based on dtb ID if it is present, 466 # default node is selected based on dtb ID if it is present,
463 # otherwise its selected based on kernel ID 467 # otherwise its selected based on kernel ID
464 if [ -n "$dtb_image" ]; then 468 if [ -n "$dtb_image" ]; then
465 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" 469 # Select default node as user specified dtb when
470 # multiple dtb exists.
471 if [ -n "$default_dtb_image" ]; then
472 if [ -s "${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image" ]; then
473 default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
474 else
475 bbwarn "Couldn't find a valid user specified dtb in ${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image"
476 fi
477 else
478 default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
479 fi
466 else 480 else
467 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" 481 default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
468 fi 482 fi