Skip to contentSkip to conversation

devicetree.bbclass: fix setting S

PATCH In review [email protected] 2 participants 3 messages Jun 25, 2024 – Jul 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devicetree.bbclass: fix setting S

From: Max Krummenacher <[email protected]>

When a user of devicetree.bbclass overrides setting S, e.g. to git/overlays then having UNPACKDIR set to S results in that git repo unpacked inside UNPACKDIR. Thus the sources are actually in git/overlays/git/overlays rather than the expected git/overlays.

Change the logic, so that S by default is set to UNPACKDIR, but a user can change S to point to were the sources actually will be.

Fixes 7a06069a041a ("devicetree.bbclass: switch away from S = WORKDIR")
---
 meta/classes-recipe/devicetree.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/devicetree.bbclass +2 -2
index 1806cb62cbf7..e5dbd9a85714 100644
@@ -40,8 +40,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 SYSROOT_DIRS += "/boot/devicetree"
 FILES:${PN} = "/boot/devicetree/*.dtb /boot/devicetree/*.dtbo"
 
-S = "${WORKDIR}/sources"
-UNPACKDIR = "${S}"
+UNPACKDIR = "${WORKDIR}/sources"
+S = "${UNPACKDIR}"
 B = "${WORKDIR}/build"
 
 # Default kernel includes, these represent what are normally used for in-kernel
Signature · 1 line
2.42.0
#1 lore raw

Hello

Quoted 7 lines · On Tue, Jun 25, 2024 at 08:30:46PM +0200, [email protected] wrote:

From: Max Krummenacher <[email protected]>

When a user of devicetree.bbclass overrides setting S, e.g. to git/overlays then having UNPACKDIR set to S results in that git repo unpacked inside UNPACKDIR. Thus the sources are actually in git/overlays/git/overlays rather than the expected git/overlays.

Quoted 5 lines

Change the logic, so that S by default is set to UNPACKDIR, but a user can change S to point to were the sources actually will be.

Fixes 7a06069a041a ("devicetree.bbclass: switch away from S = WORKDIR")

Gentle ping.

Any comments on this commit?
For me the referenced commit causes a regression. If I understand it correctly it will do so for any user which uses the devicetree.bbclass and did set S to anything other than WORKDIR.

I think this should be fixed here rather than any recipe which sets S also setting UNPACKDIR.

Thanks.
Max

Quoted 24 lines
---
 meta/classes-recipe/devicetree.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/devicetree.bbclass +2 -2
index 1806cb62cbf7..e5dbd9a85714 100644
@@ -40,8 +40,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 SYSROOT_DIRS += "/boot/devicetree"
 FILES:${PN} = "/boot/devicetree/*.dtb /boot/devicetree/*.dtbo"
 
-S = "${WORKDIR}/sources"
-UNPACKDIR = "${S}"
+UNPACKDIR = "${WORKDIR}/sources"
+S = "${UNPACKDIR}"
 B = "${WORKDIR}/build"
 
 # Default kernel includes, these represent what are normally used for in-kernel
Signature · 1 line
2.42.0
#2 lore raw
In reply to [email protected]
Quoted 31 lines · Max Krummenacher via lists.openembedded.org

From: Max Krummenacher <[email protected]>

When a user of devicetree.bbclass overrides setting S, e.g. to git/overlays then having UNPACKDIR set to S results in that git repo unpacked inside UNPACKDIR. Thus the sources are actually in git/overlays/git/overlays rather than the expected git/overlays.

Change the logic, so that S by default is set to UNPACKDIR, but a user can change S to point to were the sources actually will be.

Fixes 7a06069a041a ("devicetree.bbclass: switch away from S =

WORKDIR")

---
 meta/classes-recipe/devicetree.bbclass | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes- renamed from meta/classes-recipe/devicetree.bbclass +0 -0

recipe/devicetree.bbclass
index 1806cb62cbf7..e5dbd9a85714 100644

meta/classes-recipe/devicetree.bbclass +0 -0
@@ -40,8 +40,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"

 SYSROOT_DIRS += "/boot/devicetree"
 FILES:${PN} = "/boot/devicetree/*.dtb /boot/devicetree/*.dtbo"

meta/classes-recipe/devicetree.bbclass +2 -2
-S = "${WORKDIR}/sources"
-UNPACKDIR = "${S}"
+UNPACKDIR = "${WORKDIR}/sources"
+S = "${UNPACKDIR}"
Quoted 4 lines

 B = "${WORKDIR}/build"

 # Default kernel includes, these represent what are normally used for in-kernel

This doesn't seem to be the right thing to do to me. These settings are really closely related to SRC_URI so I think they probably shouldn't be in the class at all but in the recipes alongside SRC_URI?

Cheers,

Richard