All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files
@ 2023-01-04 22:09 Sandeep Gundlupet Raju
  2023-01-04 22:09 ` [OE-core][PATCH v2 2/2] kernel-fitimage: Allow user to select dtb when multiple dtb exists Sandeep Gundlupet Raju
  2023-01-05  9:12 ` [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Michael Opdenacker
  0 siblings, 2 replies; 5+ messages in thread
From: Sandeep Gundlupet Raju @ 2023-01-04 22:09 UTC (permalink / raw)
  To: openembedded-core, bruce.ashfield; +Cc: mark.hatle, Sandeep Gundlupet Raju

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.

  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 <sandeep.gundlupet-raju@amd.com>
---

Changes in v2:
 - Remove 2 loops and use single loop for dtb and dtbo with same logic.

---
 meta/classes-recipe/kernel-fitimage.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index 7980910aa8..92e236a0a4 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -590,8 +590,9 @@ 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
-			# Skip DTB if we've picked it up previously
+		for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb' -printf '%P\n' | sort) \
+		$(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtbo' -printf '%P\n' | sort); do
+			# Skip DTB/DTBO if we've picked it up previously
 			echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
 
 			DTBS="$DTBS $DTB"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [OE-core][PATCH v2 2/2] kernel-fitimage: Allow user to select dtb when multiple dtb exists
  2023-01-04 22:09 [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Sandeep Gundlupet Raju
@ 2023-01-04 22:09 ` Sandeep Gundlupet Raju
  2023-01-05  9:12 ` [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Michael Opdenacker
  1 sibling, 0 replies; 5+ messages in thread
From: Sandeep Gundlupet Raju @ 2023-01-04 22:09 UTC (permalink / raw)
  To: openembedded-core, bruce.ashfield; +Cc: mark.hatle, Sandeep Gundlupet Raju

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.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
---

Changes in v2:
 - Add check condition if FIT_CONF_DEFAULT_DTB file doesn't exists
   and fallback to avaialable dtb in EXTERNAL_KERNEL_DEVICETREE
   path.

---
 meta/classes-recipe/kernel-fitimage.bbclass | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

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"
 
 FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
 
+# Allow user to select the default DTB for FIT image when multiple dtb's exists.
+FIT_CONF_DEFAULT_DTB ?= ""
+
 # Keys used to sign individually image nodes.
 # The keys to sign image nodes must be different from those used to sign
 # configuration nodes, otherwise the "required" property, from
@@ -412,6 +415,7 @@ fitimage_emit_section_config() {
 	bootscr_line=""
 	setup_line=""
 	default_line=""
+	default_dtb_image="${FIT_CONF_DEFAULT_DTB}"
 
 	dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}")
 	if [ -z "$dtb_image_sect" ]; then
@@ -462,7 +466,17 @@ fitimage_emit_section_config() {
 		# default node is selected based on dtb ID if it is present,
 		# otherwise its selected based on kernel ID
 		if [ -n "$dtb_image" ]; then
-			default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
+		        # Select default node as user specified dtb when
+		        # multiple dtb exists.
+		        if [ -n "$default_dtb_image" ]; then
+			        if [ -s "${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image" ]; then
+			                default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
+			        else
+			                bbwarn "Couldn't find a valid user specified dtb in ${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image"
+			        fi
+		        else
+			        default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
+		        fi
 		else
 			default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
 		fi
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files
  2023-01-04 22:09 [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Sandeep Gundlupet Raju
  2023-01-04 22:09 ` [OE-core][PATCH v2 2/2] kernel-fitimage: Allow user to select dtb when multiple dtb exists Sandeep Gundlupet Raju
@ 2023-01-05  9:12 ` Michael Opdenacker
  2023-01-05 15:12   ` Gundlupet Raju, Sandeep
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Opdenacker @ 2023-01-05  9:12 UTC (permalink / raw)
  To: sandeep.gundlupet-raju; +Cc: mark.hatle, openembedded-core, bruce.ashfield

Hi Sandeep

Am 04.01.23 um 23:09 schrieb Sandeep Gundlupet Raju via 
lists.openembedded.org:
> The dtb files must be before the dtbo files, otherwise the overlays may
> not be applied correctly.

...

Thanks for the patch updates!

There's a problem with the way your patches are received on the Yocto 
Project mailing lists though. I used to have it too.

If I apply your patch through "git am", the author of the commit will be:
Sandeep Gundlupet Raju via lists.openembedded.org 
<sandeep.gundlupet-raju=amd.com@lists.openembedded.org>
instead of
Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>

That's because of the configuration of the Yocto Project mailing lists, 
if I understood correctly.

Because of this issue, the maintainer has to manually fix this field 
when accepting your patch. Worse, if he doesn't catch this, that's 
harder to fix afterwards.

You should be able to fix this by running:
git config --global sendemail.from "sandeep.gundlupet-raju@amd.com"

This should add a "From" field to the sent patch which "git am" should 
be able to match with your name.
At least this worked for me. See 
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Sending_using_git-send-email

Could you try to send an update (don't hesitate to send a private one to 
me first)?

Thanks in advance
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files
  2023-01-05  9:12 ` [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Michael Opdenacker
@ 2023-01-05 15:12   ` Gundlupet Raju, Sandeep
  0 siblings, 0 replies; 5+ messages in thread
From: Gundlupet Raju, Sandeep @ 2023-01-05 15:12 UTC (permalink / raw)
  To: Michael Opdenacker; +Cc: mark.hatle, openembedded-core, bruce.ashfield

Hi Michael,

On 1/5/2023 2:12 AM, Michael Opdenacker wrote:
> Hi Sandeep
>
> Am 04.01.23 um 23:09 schrieb Sandeep Gundlupet Raju via
> lists.openembedded.org:
>> The dtb files must be before the dtbo files, otherwise the overlays may
>> not be applied correctly.
> ...
>
> Thanks for the patch updates!
>
> There's a problem with the way your patches are received on the Yocto
> Project mailing lists though. I used to have it too.
>
> If I apply your patch through "git am", the author of the commit will be:
> Sandeep Gundlupet Raju via lists.openembedded.org
> <sandeep.gundlupet-raju=amd.com@lists.openembedded.org>
> instead of
> Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>

[Sandeep]: Even I was wondering why I'm receiving multiple copy of patch 
when I sent, Interesting I didn't face this issue with other mailing list.

MAIL FROM:<sandeep.gundlupet-raju@amd.com>
RCPT TO:<openembedded-core@lists.openembedded.org>
RCPT TO:<bruce.ashfield@gmail.com>
RCPT TO:<mark.hatle@kernel.crashing.org>
RCPT TO:<sandeep.gundlupet-raju@amd.com>
From: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
To: openembedded-core@lists.openembedded.org,
         bruce.ashfield@gmail.com
Cc: mark.hatle@kernel.crashing.org,
         Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
Subject: [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of 
dtb/dtbo files
Date: Wed,  4 Jan 2023 15:09:01 -0700
Message-Id: <20230104220902.1530659-1-sandeep.gundlupet-raju@amd.com>

> That's because of the configuration of the Yocto Project mailing lists,
> if I understood correctly.
>
> Because of this issue, the maintainer has to manually fix this field
> when accepting your patch. Worse, if he doesn't catch this, that's
> harder to fix afterwards.
>
> You should be able to fix this by running:
> git config --global sendemail.from "sandeep.gundlupet-raju@amd.com"
[Sandeep]: I just checked with ~/.gitconfig and it was still using my 
xilinx id sandeep.gundlupet-raju@xilinx.com, Now I've fixed it.
>
> This should add a "From" field to the sent patch which "git am" should
> be able to match with your name.
> At least this worked for me. See
> https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded#Sending_using_git-send-email
>
> Could you try to send an update (don't hesitate to send a private one to
> me first)?
[Sandeep]: Sure I sent a private one, if everything looks ok then will 
send it to mailing list.
>
> Thanks in advance
> Michael.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files
@ 2023-01-08 17:24 sandeep.gundlupet-raju
  0 siblings, 0 replies; 5+ messages in thread
From: sandeep.gundlupet-raju @ 2023-01-08 17:24 UTC (permalink / raw)
  To: openembedded-core, michael.opdenacker, bruce.ashfield
  Cc: mark.hatle, Sandeep Gundlupet Raju

From: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>

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.

  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 <sandeep.gundlupet-raju@amd.com>
---

Changes in v2:
 - Remove 2 loops and use single loop for dtb and dtbo with same logic.

---
 meta/classes-recipe/kernel-fitimage.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index 7980910aa8..92e236a0a4 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -590,8 +590,9 @@ 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
-			# Skip DTB if we've picked it up previously
+		for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb' -printf '%P\n' | sort) \
+		$(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtbo' -printf '%P\n' | sort); do
+			# Skip DTB/DTBO if we've picked it up previously
 			echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
 
 			DTBS="$DTBS $DTB"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-08 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 22:09 [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Sandeep Gundlupet Raju
2023-01-04 22:09 ` [OE-core][PATCH v2 2/2] kernel-fitimage: Allow user to select dtb when multiple dtb exists Sandeep Gundlupet Raju
2023-01-05  9:12 ` [OE-core][PATCH v2 1/2] kernel-fitimage: Adjust order of dtb/dtbo files Michael Opdenacker
2023-01-05 15:12   ` Gundlupet Raju, Sandeep
2023-01-08 17:24 sandeep.gundlupet-raju

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.