Hi Quentin,
Thanks for the review.
On 1/4/2023 4:36 AM, Quentin Schulz wrote:
Hi Sandeep,
On 1/4/23 03:53, Sandeep Gundlupet Raju via lists.openembedded.org wrote:
The dtb files must be before the dtbo files, otherwise the overlays may
not be applied correctly.
From Bruce Ashfield:
We can split between dtbs and dtbos, they just need to be sorted
for reproducibility reasons. Two loops versus one, would be
fine, with not too much duplicated code.
Of course, this was only working by luck previously (before the
sort), since it has always been gathering dtbs and dtbo's with
find, depending on filesystem ordering for the order in the
fitimage).
Signed-off-by: Sandeep Gundlupet Raju <[email protected]>
---
meta/classes-recipe/kernel-fitimage.bbclass | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass
b/meta/classes-recipe/kernel-fitimage.bbclass
index 7980910aa8..cb6635a673 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -590,7 +590,7 @@ fitimage_assemble() {
if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then
dtbcount=1
- for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name
'*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
+ for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb'
-printf '%P\n' | sort); do
I believe you could have
for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb' -printf
'%P\n' | sort) $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtbo'
-printf '%P\n' | sort); do
would make sure dtbs appear before dtbos in the fitimage sections but
still use the same logic within the loop without going for code duplication.
[Sandeep]: Good thought I echo you on this one, I'll send a v2 patch
with changes.
I believe the issue is the content of the DTBS variable, which might
start with a dtbo file.
When this happens, the default configuration for the fitimage takes the
dtbo only and I guess this is your bug.
[Sandeep]: Yes that correct, it fitimage picked the dtb based on sorting
files in alphabetical order and in our case it looks like below, Where
it picked up default.dtbo as default which caused boot issue.
-rw-r--r-- 8 sandeepg boulder 480 Jan 3 11:33 default.dtbo
-rw-r--r-- 8 sandeepg boulder 29K Jan 3 11:33 system-default.dtb
-rw-r--r-- 8 sandeepg boulder 33K Jan 3 11:33 system-top.dtb
-rw-r--r-- 8 sandeepg boulder 29K Jan 3 11:33 system-vck190-rev1.dtb
-rw-r--r-- 8 sandeepg boulder 435 Jan 3 11:33 vck190-rev1.dtbo
We could also decide to have the original loop but have two variables:
DTBS for dtbs only, matched on file extension
and DTBOS for dtbos only
Then you'd iterate over DTBS for fitimage_emit_section_config first and
then DTBOS.
I'm also not sure we need to create fit configuration nodes for dtbos
only? but maybe there's something specific to security here?
[Sandeep]: I will defer this question to Bruce Ashfield and Mark Hatle.
Cheers,
Quentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#175505):
https://lists.openembedded.org/g/openembedded-core/message/175505
Mute This Topic: https://lists.openembedded.org/mt/96043776/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-