From: Andrea Adami <hidden> Date: 2021-06-22 22:18:22
As exposed in the ML
https://lists.openembedded.org/g/openembedded-core/message/153000
up to commit 86142da in Gatesgarth it was possible to build a second mini-kernel w/out
modules to be just deployed and collected by other recipes.
These kernels use special care to avoid packaging:
inherit nopackages
PACKAGES = ""
PROVIDES = ""
Now the change in kernel.bblass calls a packaging routine:
do_deploy[prefuncs] += "read_subpackage_metadata"
As a result the kernel build fails.
Fix this using bb.data.inherits_class() to verify the
possible previous inherit of nopackages.bbclass.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -771,8 +771,8 @@ kernel_do_deploy() { } # We deploy to filenames that include PKGV and PKGR, read the saved data to-# ensure we get the right values for both-do_deploy[prefuncs] += "read_subpackage_metadata"+# ensure we get the right values for both. Do this only if packaging is enabled.+do_deploy[prefuncs] += "${@ '' if bb.data.inherits_class('nopackages', d) else 'read_subpackage_metadata' }" addtask deploy after do_populate_sysroot do_packagedata
From: Andrea Adami <hidden> Date: 2021-06-22 22:18:22
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Richard Purdie <hidden> Date: 2021-06-22 22:52:09
On Wed, 2021-06-23 at 00:18 +0200, Andrea Adami wrote:
quoted hunk
As exposed in the ML
https://lists.openembedded.org/g/openembedded-core/message/153000
up to commit 86142da in Gatesgarth it was possible to build a second mini-kernel w/out
modules to be just deployed and collected by other recipes.
These kernels use special care to avoid packaging:
inherit nopackages
PACKAGES = ""
PROVIDES = ""
Now the change in kernel.bblass calls a packaging routine:
do_deploy[prefuncs] += "read_subpackage_metadata"
As a result the kernel build fails.
Fix this using bb.data.inherits_class() to verify the
possible previous inherit of nopackages.bbclass.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
}
# We deploy to filenames that include PKGV and PKGR, read the saved data to
-# ensure we get the right values for both
-do_deploy[prefuncs] += "read_subpackage_metadata"
+# ensure we get the right values for both. Do this only if packaging is enabled.
+do_deploy[prefuncs] += "${@ '' if bb.data.inherits_class('nopackages', d) else 'read_subpackage_metadata' }"
addtask deploy after do_populate_sysroot do_packagedata
I'm not convinced this is the right fix. Which values is that function
finding and reading which cause problems? It sounds like there is a deeper
issue here that should be fixed instead...
Is there a simple reproducer for this on master?
Cheers,
Richard
From: Andrea Adami <hidden> Date: 2021-06-22 22:59:37
On Wed, Jun 23, 2021 at 12:52 AM Richard Purdie
[off-list ref] wrote:
On Wed, 2021-06-23 at 00:18 +0200, Andrea Adami wrote:
quoted
As exposed in the ML
https://lists.openembedded.org/g/openembedded-core/message/153000
up to commit 86142da in Gatesgarth it was possible to build a second mini-kernel w/out
modules to be just deployed and collected by other recipes.
These kernels use special care to avoid packaging:
inherit nopackages
PACKAGES = ""
PROVIDES = ""
Now the change in kernel.bblass calls a packaging routine:
do_deploy[prefuncs] += "read_subpackage_metadata"
As a result the kernel build fails.
Fix this using bb.data.inherits_class() to verify the
possible previous inherit of nopackages.bbclass.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -771,8 +771,8 @@ kernel_do_deploy() { } # We deploy to filenames that include PKGV and PKGR, read the saved data to-# ensure we get the right values for both-do_deploy[prefuncs] += "read_subpackage_metadata"+# ensure we get the right values for both. Do this only if packaging is enabled.+do_deploy[prefuncs] += "${@ '' if bb.data.inherits_class('nopackages', d) else 'read_subpackage_metadata' }" addtask deploy after do_populate_sysroot do_packagedata
I'm not convinced this is the right fix. Which values is that function
finding and reading which cause problems? It sounds like there is a deeper
issue here that should be fixed instead...
Is there a simple reproducer for this on master?
From: Peter Kjellerstedt <hidden> Date: 2021-06-23 09:32:20
quoted hunk
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Andrea Adami <hidden> Date: 2021-06-23 13:13:03
On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
[off-list ref] wrote:
quoted
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
do_packagedata
EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
-inherit kernel-devicetree
+inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
That doesn't look correct. Don't you mean something like this:
inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
As you prefer, I don't think bitbake has likely/unlikely optimization.
I took the style-example from line 6 where it reads
KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
"kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
I am for any option providing a guard.
Cheers
A.A.
Hello Andrea,
On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami [off-list ref] wrote:
On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
[off-list ref] wrote:
quoted
quoted
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
do_packagedata
EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
-inherit kernel-devicetree
+inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
That doesn't look correct. Don't you mean something like this:
inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
As you prefer, I don't think bitbake has likely/unlikely optimization.
I took the style-example from line 6 where it reads
KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
"kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
I am for any option providing a guard.
I guess you've missed the closing bracket in your statement, please
take a look at the comparison operator.
As yet another option, maybe even something like this:
inherit ${@oe.utils.ifelse(d.getVar('KERNEL_DEVICETREE') == '', '',
'kernel-devicetree')}
However, I'm not sure what would happened if KERNEL_DEVICETREE is
undefined, as in this case bitbake should return "None" according to
the documentation.
From: Andrea Adami <hidden> Date: 2021-06-23 15:22:34
On Wed, Jun 23, 2021 at 3:51 PM Andrey Zhizhikin [off-list ref] wrote:
Hello Andrea,
On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami [off-list ref] wrote:
quoted
On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
[off-list ref] wrote:
quoted
quoted
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
do_packagedata
EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
-inherit kernel-devicetree
+inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
That doesn't look correct. Don't you mean something like this:
inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
As you prefer, I don't think bitbake has likely/unlikely optimization.
I took the style-example from line 6 where it reads
KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
"kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
I am for any option providing a guard.
I guess you've missed the closing bracket in your statement, please
take a look at the comparison operator.
The code as it is doesn't raise any parse error.
There is opening bracket and closing bracket, what more?
We can discuss about the form, someone suggested anonymous python for
both patches.
Thanks for reviewing
A.A.
As yet another option, maybe even something like this:
inherit ${@oe.utils.ifelse(d.getVar('KERNEL_DEVICETREE') == '', '',
'kernel-devicetree')}
However, I'm not sure what would happened if KERNEL_DEVICETREE is
undefined, as in this case bitbake should return "None" according to
the documentation.
From: Martin Jansa <hidden> Date: 2021-06-23 16:02:26
On Wed, Jun 23, 2021 at 05:22:21PM +0200, Andrea Adami wrote:
On Wed, Jun 23, 2021 at 3:51 PM Andrey Zhizhikin [off-list ref] wrote:
quoted
Hello Andrea,
On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami [off-list ref] wrote:
quoted
On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
[off-list ref] wrote:
quoted
quoted
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
do_packagedata
EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
-inherit kernel-devicetree
+inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
That doesn't look correct. Don't you mean something like this:
inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
As you prefer, I don't think bitbake has likely/unlikely optimization.
I took the style-example from line 6 where it reads
KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
"kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
I am for any option providing a guard.
I guess you've missed the closing bracket in your statement, please
take a look at the comparison operator.
The code as it is doesn't raise any parse error.
There is opening bracket and closing bracket, what more?
d.getVar("KERNEL_DEVICETREE" == "")
vs
d.getVar("KERNEL_DEVICETREE") == ""
We can discuss about the form, someone suggested anonymous python for
both patches.
Thanks for reviewing
A.A.
quoted
As yet another option, maybe even something like this:
inherit ${@oe.utils.ifelse(d.getVar('KERNEL_DEVICETREE') == '', '',
'kernel-devicetree')}
However, I'm not sure what would happened if KERNEL_DEVICETREE is
undefined, as in this case bitbake should return "None" according to
the documentation.
From: Andrea Adami <hidden> Date: 2021-06-23 19:27:04
Thank you, I'll send v2.
I am waiting RP comments about the other patch of the series for
kernel.bbclass which exposed this one issue.
Martin, I tried to remove the patch from patchwork but all stops end 2020.
Am I missing something? New links?
Thanks all
A.A.
On Wed, Jun 23, 2021 at 6:02 PM Martin Jansa [off-list ref] wrote:
On Wed, Jun 23, 2021 at 05:22:21PM +0200, Andrea Adami wrote:
quoted
On Wed, Jun 23, 2021 at 3:51 PM Andrey Zhizhikin [off-list ref] wrote:
quoted
Hello Andrea,
On Wed, Jun 23, 2021 at 3:16 PM Andrea Adami [off-list ref] wrote:
quoted
On Wed, Jun 23, 2021 at 11:32 AM Peter Kjellerstedt
[off-list ref] wrote:
quoted
quoted
-----Original Message-----
From: openembedded-core@lists.openembedded.org <openembedded-
core@lists.openembedded.org> On Behalf Of Andrea Adami
Sent: den 23 juni 2021 00:18
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH 2/2] kernel.bbclass: inherit kernel_devicetree
only if KERNEL_DEVICETREE is set
Now it unconditionally tries to create package kernel-devicetre even for
legacy devices w/out DT.
Signed-off-by: Andrea Adami <redacted>
---
meta/classes/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -779,4 +779,4 @@ addtask deploy after do_populate_sysroot
do_packagedata
EXPORT_FUNCTIONS do_deploy
# Add using Device Tree support
-inherit kernel-devicetree
+inherit ${@ "" if d.getVar("KERNEL_DEVICETREE" == "") else "kernel-devicetree" }
That doesn't look correct. Don't you mean something like this:
inherit ${@ "kernel-devicetree" if d.getVar("KERNEL_DEVICETREE") else "" }
As you prefer, I don't think bitbake has likely/unlikely optimization.
I took the style-example from line 6 where it reads
KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") ==
"kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
I am for any option providing a guard.
I guess you've missed the closing bracket in your statement, please
take a look at the comparison operator.
The code as it is doesn't raise any parse error.
There is opening bracket and closing bracket, what more?
d.getVar("KERNEL_DEVICETREE" == "")
vs
d.getVar("KERNEL_DEVICETREE") == ""
quoted
We can discuss about the form, someone suggested anonymous python for
both patches.
Thanks for reviewing
A.A.
quoted
As yet another option, maybe even something like this:
inherit ${@oe.utils.ifelse(d.getVar('KERNEL_DEVICETREE') == '', '',
'kernel-devicetree')}
However, I'm not sure what would happened if KERNEL_DEVICETREE is
undefined, as in this case bitbake should return "None" according to
the documentation.