On 20/07/2020 08:41, Richard Purdie via lists.openembedded.org wrote:
On Fri, 2020-07-17 at 15:19 +0100, Usama Arif wrote:
This patch adds support for adding default config node even
when dtb is not part of the FIT image. The conf options are
therefore changed to point to kernel ID rather than dtb
ID when dtb does not exist.
Signed-off-by: Usama Arif <usama.a...@arm.com>
---
meta/classes/kernel-fitimage.bbclass | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
I keep asking someone to start providing tests for kernel-fitimage but
nobody does. Its near impossible to tell whether this is a good change
or one that could cause someone else problems as we have little
documented behaviour and no tests.
Could someone please start looking at adding some (and documentation)?
Cheers,
Richard >
Hi,
Thanks for the reply.
There are different components that can be added to a FIT image. This
include kernel, ramdisk, dtb, etc. However, it is not necessary for any
individual component to be part of the FIT image. In reality, you can
have 0-N (0 to N) kernels and/or 0-N ramdisks and/or 0-N dtbs.
However, kernel-fitimage.bbclass currently only supports limited
usescases: adding 1 (no more or less) kernel with 1-N dtbs and 0-1
ramdisks.
Before support was added for multiple dtbs, the configuration of FIT
image without any dtbs was supported.
This patchset adds back the original support to kernel-fitimage.bbclass
for building a FIT image when no dtbs are present. i.e. adds support for
1 kernel with 0-N dtbs. It doesnot affect the existing usecases, but
adds back support for a usecase (0 dtb) that originally existed and was
removed as a mistake.
I have submitted a v2 of this patch which better documents the code I
have submitted so that hopefully its not blocked on the testing and
documentation of the entire kernel-fitimage. It also always creates a
configuration for FIT image.
I guess i have spent some time debugging kernel-fitimage so am happy to
help with the documentation. I guess you would like a high level
description of kernel-fitimage at the top of this file as a seperate patch?
I havent worked with the test framework for oe-core so not sure how
helpful i could be on that. I tried to look for example test cases that
would test any of the existing meta/classes/kernel*.bbclass but couldnt
find any.
Hopefully the extra documentation in v2 and the explanation would be
useful in understanding and progressing this patch.
Thanks,
Usama
diff --git a/meta/classes/kernel-fitimage.bbclass
b/meta/classes/kernel-fitimage.bbclass
index 72b05ff8d1..6f4530fc3b 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -257,6 +257,7 @@ fitimage_emit_section_config() {
# Test if we have any DTBs at all
sep=""
conf_desc=""
+ conf_node="conf@"
kernel_line=""
fdt_line=""
ramdisk_line=""
@@ -287,12 +288,18 @@ fitimage_emit_section_config() {
fi
if [ "${6}" = "1" ]; then
- default_line="default = \"conf@${3}\";"
+ if [ -n "${3}" ]; then
+ default_line="default = \"conf@${3}\";"
+ conf_node=$conf_node${3}
+ else
+ default_line="default = \"conf@${2}\";"
+ conf_node=$conf_node${2}
+ fi
fi
cat << EOF >> ${1}
${default_line}
- conf@${3} {
+ $conf_node {
description = "${6} ${conf_desc}";
${kernel_line}
${fdt_line}
@@ -445,6 +452,9 @@ fitimage_assemble() {
fi
i=`expr ${i} + 1`
done
+ else
+ defaultconfigcount=1
+ fitimage_emit_section_config ${1} "${kernelcount}" ""
"${ramdiskcount}" "${setupcount}" "${defaultconfigcount}"
fi
fitimage_emit_section_maint ${1} sectend
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#140811):
https://lists.openembedded.org/g/openembedded-core/message/140811
Mute This Topic: https://lists.openembedded.org/mt/75612723/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-