* [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval
@ 2025-01-10 3:08 Daniel Chaves
2025-01-10 7:43 ` [yocto] " Alexandre Belloni
2025-01-10 14:22 ` Richard Purdie
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Chaves @ 2025-01-10 3:08 UTC (permalink / raw)
To: yocto; +Cc: Daniel Chaves
Kernel packages may not always use the kernel-module- prefix. However,
those listed in DEPENDS will consistently add Module.symvers to the
STAGING_INCDIR.
Signed-off-by: Daniel Chaves <dchvs11@gmail.com>
---
meta/classes-recipe/module.bbclass | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
index f2f0b25a2d..0f16522866 100644
--- a/meta/classes-recipe/module.bbclass
+++ b/meta/classes-recipe/module.bbclass
@@ -11,13 +11,13 @@ EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
MODULES_INSTALL_TARGET ?= "modules_install"
MODULES_MODULE_SYMVERS_LOCATION ?= ""
-python __anonymous () {
- depends = d.getVar('DEPENDS')
- extra_symbols = []
- for dep in depends.split():
- if dep.startswith("kernel-module-"):
- extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
- d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
+python () {
+ import glob
+
+ extra_symbols = glob.glob(d.getVar('STAGING_INCDIR') + "/*/Module.symvers")
+
+ d.setVar('KBUILD_EXTRA_SYMBOLS', d.getVar('KBUILD_EXTRA_SYMBOLS') + " " + \
+ " ".join(extra_symbols))
}
python do_package:prepend () {
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [yocto] [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval
2025-01-10 3:08 [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval Daniel Chaves
@ 2025-01-10 7:43 ` Alexandre Belloni
2025-01-10 14:22 ` Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-01-10 7:43 UTC (permalink / raw)
To: yocto, dchvs11
Hello,
This should be sent to the oe-core mailing list, see README.OE-Core.md.
On 10/01/2025 03:08:47+0000, Daniel via lists.yoctoproject.org wrote:
> Kernel packages may not always use the kernel-module- prefix. However,
> those listed in DEPENDS will consistently add Module.symvers to the
> STAGING_INCDIR.
>
> Signed-off-by: Daniel Chaves <dchvs11@gmail.com>
> ---
> meta/classes-recipe/module.bbclass | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
> index f2f0b25a2d..0f16522866 100644
> --- a/meta/classes-recipe/module.bbclass
> +++ b/meta/classes-recipe/module.bbclass
> @@ -11,13 +11,13 @@ EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
> MODULES_INSTALL_TARGET ?= "modules_install"
> MODULES_MODULE_SYMVERS_LOCATION ?= ""
>
> -python __anonymous () {
> - depends = d.getVar('DEPENDS')
> - extra_symbols = []
> - for dep in depends.split():
> - if dep.startswith("kernel-module-"):
> - extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
> - d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
> +python () {
Why did you remove __anonymous?
> + import glob
> +
> + extra_symbols = glob.glob(d.getVar('STAGING_INCDIR') + "/*/Module.symvers")
> +
> + d.setVar('KBUILD_EXTRA_SYMBOLS', d.getVar('KBUILD_EXTRA_SYMBOLS') + " " + \
> + " ".join(extra_symbols))
> }
>
> python do_package:prepend () {
> --
> 2.40.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#64525): https://lists.yoctoproject.org/g/yocto/message/64525
> Mute This Topic: https://lists.yoctoproject.org/mt/110529511/3617179
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [yocto] [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval
2025-01-10 3:08 [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval Daniel Chaves
2025-01-10 7:43 ` [yocto] " Alexandre Belloni
@ 2025-01-10 14:22 ` Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2025-01-10 14:22 UTC (permalink / raw)
To: yocto, dchvs11; +Cc: Bruce Ashfield
On Fri, 2025-01-10 at 03:08 +0000, Daniel via lists.yoctoproject.org wrote:
> Kernel packages may not always use the kernel-module- prefix. However,
> those listed in DEPENDS will consistently add Module.symvers to the
> STAGING_INCDIR.
>
> Signed-off-by: Daniel Chaves <dchvs11@gmail.com>
> ---
> meta/classes-recipe/module.bbclass | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
> index f2f0b25a2d..0f16522866 100644
> --- a/meta/classes-recipe/module.bbclass
> +++ b/meta/classes-recipe/module.bbclass
> @@ -11,13 +11,13 @@ EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
> MODULES_INSTALL_TARGET ?= "modules_install"
> MODULES_MODULE_SYMVERS_LOCATION ?= ""
>
> -python __anonymous () {
> - depends = d.getVar('DEPENDS')
> - extra_symbols = []
> - for dep in depends.split():
> - if dep.startswith("kernel-module-"):
> - extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
> - d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
> +python () {
> + import glob
> +
> + extra_symbols = glob.glob(d.getVar('STAGING_INCDIR') + "/*/Module.symvers")
> +
> + d.setVar('KBUILD_EXTRA_SYMBOLS', d.getVar('KBUILD_EXTRA_SYMBOLS') + " " + \
> + " ".join(extra_symbols))
> }
>
> python do_package:prepend () {
This is going to lead to non-determinism since STAGING_INCDIR may or
may not exist (e.g. at parsing time before the build) and the value
will therefore change.
If we really want/need to do that I'd at least expect an explanation of
why the changes don't matter and how they don't affect task checksums.
As Alexandre mentions, this also needs to be submitted to the OE-Core
list.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-10 14:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 3:08 [linux-yocto][poky][master][PATCH] module.bbclass: enhance KBUILD_EXTRA_SYMBOLS retrieval Daniel Chaves
2025-01-10 7:43 ` [yocto] " Alexandre Belloni
2025-01-10 14:22 ` Richard Purdie
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.