All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
@ 2020-11-13  6:32 Bruce Ashfield
  2020-11-13 17:53 ` [OE-core] " Scott Branden
  2020-11-13 18:09 ` Khem Raj
  0 siblings, 2 replies; 9+ messages in thread
From: Bruce Ashfield @ 2020-11-13  6:32 UTC (permalink / raw)
  To: richard.purdie; +Cc: lili.li, openembedded-core

From: Bruce Ashfield <bruce.ashfield@gmail.com>

The upstream commit 596b0474d3d [kbuild: preprocess module linker
script], adds a dependency on module.lds for external module
building.

Since module.lds is generated as part of 'modules_prepare', we
must make it available with the other kernel artifacts in the
kernel shared workdir, otherwise out of tree builds fail.

This fixes errors like:

    | make[4]: *** No rule to make target 'scripts/module.lds', needed by
        'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
        Stop.
    | make[4]: *** Waiting for unfinished jobs....

We also ensure that kernel-devsrc has a copy to support on
target module builds that are often prepared with 'make scripts
prepare'. Those targets won't regenerate it, so the build fails.
If 'make modules_prepare' is used, the file will be regenerated
and overwrite our copy (as expected).

Signed-off-by: Pan, Kris <kris.pan@intel.com>
Signed-off-by: Lili Li <lili.li@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/classes/kernel.bbclass                | 1 +
 meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index be93a258f6..ccd74e61e8 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -494,6 +494,7 @@ do_shared_workdir () {
 	# Copy files required for module builds
 	cp System.map $kerneldir/System.map-${KERNEL_VERSION}
 	[ -e Module.symvers ] && cp Module.symvers $kerneldir/
+	[ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
 	cp .config $kerneldir/
 	mkdir -p $kerneldir/include/config
 	cp include/config/kernel.release $kerneldir/include/config/kernel.release
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 81b1e36041..5f0dedbdf7 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -100,6 +100,12 @@ do_install() {
 	# be dealt with.
 	# cp -a scripts $kerneldir/build
 
+	# although module.lds can be regenerated on target via 'make modules_prepare'
+	# there are several places where 'makes scripts prepare' is done, and that won't
+	# regenerate the file. So we copy it onto the target as a migration to using
+	# modules_prepare
+	cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
+
         if [ -d arch/${ARCH}/scripts ]; then
 	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
 	fi
-- 
2.19.1


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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-13  6:32 [PATCH] kernel: provide module.lds for out of tree builds in v5.10+ Bruce Ashfield
@ 2020-11-13 17:53 ` Scott Branden
  2020-11-14  4:18   ` Scott Branden
  2020-11-13 18:09 ` Khem Raj
  1 sibling, 1 reply; 9+ messages in thread
From: Scott Branden @ 2020-11-13 17:53 UTC (permalink / raw)
  To: Bruce Ashfield, richard.purdie; +Cc: lili.li, openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 2938 bytes --]

Thanks, works for me building external kernel modules.

On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> The upstream commit 596b0474d3d [kbuild: preprocess module linker
> script], adds a dependency on module.lds for external module
> building.
>
> Since module.lds is generated as part of 'modules_prepare', we
> must make it available with the other kernel artifacts in the
> kernel shared workdir, otherwise out of tree builds fail.
>
> This fixes errors like:
>
>     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
>         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
>         Stop.
>     | make[4]: *** Waiting for unfinished jobs....
>
> We also ensure that kernel-devsrc has a copy to support on
> target module builds that are often prepared with 'make scripts
> prepare'. Those targets won't regenerate it, so the build fails.
> If 'make modules_prepare' is used, the file will be regenerated
> and overwrite our copy (as expected).
>
> Signed-off-by: Pan, Kris <kris.pan@intel.com>
> Signed-off-by: Lili Li <lili.li@intel.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Tested-by: Scott Branden <scott.branden@broadcom.com>
> ---
>  meta/classes/kernel.bbclass                | 1 +
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index be93a258f6..ccd74e61e8 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -494,6 +494,7 @@ do_shared_workdir () {
>  	# Copy files required for module builds
>  	cp System.map $kerneldir/System.map-${KERNEL_VERSION}
>  	[ -e Module.symvers ] && cp Module.symvers $kerneldir/
> +	[ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
>  	cp .config $kerneldir/
>  	mkdir -p $kerneldir/include/config
>  	cp include/config/kernel.release $kerneldir/include/config/kernel.release
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 81b1e36041..5f0dedbdf7 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -100,6 +100,12 @@ do_install() {
>  	# be dealt with.
>  	# cp -a scripts $kerneldir/build
>  
> +	# although module.lds can be regenerated on target via 'make modules_prepare'
> +	# there are several places where 'makes scripts prepare' is done, and that won't
> +	# regenerate the file. So we copy it onto the target as a migration to using
> +	# modules_prepare
> +	cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> +
>          if [ -d arch/${ARCH}/scripts ]; then
>  	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>  	fi
>
> 
>


[-- Attachment #1.2: Type: text/html, Size: 3904 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4169 bytes --]

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-13  6:32 [PATCH] kernel: provide module.lds for out of tree builds in v5.10+ Bruce Ashfield
  2020-11-13 17:53 ` [OE-core] " Scott Branden
@ 2020-11-13 18:09 ` Khem Raj
  2020-11-13 19:55   ` Bruce Ashfield
  1 sibling, 1 reply; 9+ messages in thread
From: Khem Raj @ 2020-11-13 18:09 UTC (permalink / raw)
  To: Bruce Ashfield
  Cc: Richard Purdie, lili.li, Patches and discussions about the oe-core layer

On Thu, Nov 12, 2020 at 10:32 PM Bruce Ashfield
<bruce.ashfield@gmail.com> wrote:
>
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> The upstream commit 596b0474d3d [kbuild: preprocess module linker
> script], adds a dependency on module.lds for external module
> building.
>
> Since module.lds is generated as part of 'modules_prepare', we
> must make it available with the other kernel artifacts in the
> kernel shared workdir, otherwise out of tree builds fail.
>
> This fixes errors like:
>
>     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
>         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
>         Stop.
>     | make[4]: *** Waiting for unfinished jobs....
>
> We also ensure that kernel-devsrc has a copy to support on
> target module builds that are often prepared with 'make scripts
> prepare'. Those targets won't regenerate it, so the build fails.
> If 'make modules_prepare' is used, the file will be regenerated
> and overwrite our copy (as expected).
>
> Signed-off-by: Pan, Kris <kris.pan@intel.com>
> Signed-off-by: Lili Li <lili.li@intel.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>  meta/classes/kernel.bbclass                | 1 +
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index be93a258f6..ccd74e61e8 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -494,6 +494,7 @@ do_shared_workdir () {
>         # Copy files required for module builds
>         cp System.map $kerneldir/System.map-${KERNEL_VERSION}
>         [ -e Module.symvers ] && cp Module.symvers $kerneldir/
> +       [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
>         cp .config $kerneldir/
>         mkdir -p $kerneldir/include/config
>         cp include/config/kernel.release $kerneldir/include/config/kernel.release
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 81b1e36041..5f0dedbdf7 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -100,6 +100,12 @@ do_install() {
>         # be dealt with.
>         # cp -a scripts $kerneldir/build
>
> +       # although module.lds can be regenerated on target via 'make modules_prepare'
> +       # there are several places where 'makes scripts prepare' is done, and that won't
> +       # regenerate the file. So we copy it onto the target as a migration to using
> +       # modules_prepare
> +       cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> +

I see there are more occurrence of cp -a in this recipe but I thought
I will mention it
cp -a could be perhaps made more portable with cp --preserve=mode,timestamps -R

>          if [ -d arch/${ARCH}/scripts ]; then
>             cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>         fi
> --
> 2.19.1
>
>
> 
>

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-13 18:09 ` Khem Raj
@ 2020-11-13 19:55   ` Bruce Ashfield
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Ashfield @ 2020-11-13 19:55 UTC (permalink / raw)
  To: Khem Raj
  Cc: Richard Purdie, Lili Li, Patches and discussions about the oe-core layer

On Fri, Nov 13, 2020 at 1:10 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Thu, Nov 12, 2020 at 10:32 PM Bruce Ashfield
> <bruce.ashfield@gmail.com> wrote:
> >
> > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> >
> > The upstream commit 596b0474d3d [kbuild: preprocess module linker
> > script], adds a dependency on module.lds for external module
> > building.
> >
> > Since module.lds is generated as part of 'modules_prepare', we
> > must make it available with the other kernel artifacts in the
> > kernel shared workdir, otherwise out of tree builds fail.
> >
> > This fixes errors like:
> >
> >     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
> >         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
> >         Stop.
> >     | make[4]: *** Waiting for unfinished jobs....
> >
> > We also ensure that kernel-devsrc has a copy to support on
> > target module builds that are often prepared with 'make scripts
> > prepare'. Those targets won't regenerate it, so the build fails.
> > If 'make modules_prepare' is used, the file will be regenerated
> > and overwrite our copy (as expected).
> >
> > Signed-off-by: Pan, Kris <kris.pan@intel.com>
> > Signed-off-by: Lili Li <lili.li@intel.com>
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > ---
> >  meta/classes/kernel.bbclass                | 1 +
> >  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > index be93a258f6..ccd74e61e8 100644
> > --- a/meta/classes/kernel.bbclass
> > +++ b/meta/classes/kernel.bbclass
> > @@ -494,6 +494,7 @@ do_shared_workdir () {
> >         # Copy files required for module builds
> >         cp System.map $kerneldir/System.map-${KERNEL_VERSION}
> >         [ -e Module.symvers ] && cp Module.symvers $kerneldir/
> > +       [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
> >         cp .config $kerneldir/
> >         mkdir -p $kerneldir/include/config
> >         cp include/config/kernel.release $kerneldir/include/config/kernel.release
> > diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > index 81b1e36041..5f0dedbdf7 100644
> > --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> > +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > @@ -100,6 +100,12 @@ do_install() {
> >         # be dealt with.
> >         # cp -a scripts $kerneldir/build
> >
> > +       # although module.lds can be regenerated on target via 'make modules_prepare'
> > +       # there are several places where 'makes scripts prepare' is done, and that won't
> > +       # regenerate the file. So we copy it onto the target as a migration to using
> > +       # modules_prepare
> > +       cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> > +
>
> I see there are more occurrence of cp -a in this recipe but I thought
> I will mention it
> cp -a could be perhaps made more portable with cp --preserve=mode,timestamps -R

They've been there since the beginning.

But I'll keep it in mind next time I'm doing a bigger update to the devsrc!

Bruce

>
> >          if [ -d arch/${ARCH}/scripts ]; then
> >             cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
> >         fi
> > --
> > 2.19.1
> >
> >
> > 
> >



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-13 17:53 ` [OE-core] " Scott Branden
@ 2020-11-14  4:18   ` Scott Branden
  2020-11-14  4:27     ` Bruce Ashfield
       [not found]     ` <1647455857E467AB.30187@lists.openembedded.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Scott Branden @ 2020-11-14  4:18 UTC (permalink / raw)
  To: Bruce Ashfield, richard.purdie; +Cc: lili.li, openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 3131 bytes --]

Sorry, spoke too soon.  Doesn't seem to work from a clean build now.

On 2020-11-13 9:53 a.m., Scott Branden wrote:
> Thanks, works for me building external kernel modules.
>
> On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
>> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>>
>> The upstream commit 596b0474d3d [kbuild: preprocess module linker
>> script], adds a dependency on module.lds for external module
>> building.
>>
>> Since module.lds is generated as part of 'modules_prepare', we
>> must make it available with the other kernel artifacts in the
>> kernel shared workdir, otherwise out of tree builds fail.
>>
>> This fixes errors like:
>>
>>     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
>>         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
>>         Stop.
>>     | make[4]: *** Waiting for unfinished jobs....
>>
>> We also ensure that kernel-devsrc has a copy to support on
>> target module builds that are often prepared with 'make scripts
>> prepare'. Those targets won't regenerate it, so the build fails.
>> If 'make modules_prepare' is used, the file will be regenerated
>> and overwrite our copy (as expected).
>>
>> Signed-off-by: Pan, Kris <kris.pan@intel.com>
>> Signed-off-by: Lili Li <lili.li@intel.com>
>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> Tested-by: Scott Branden <scott.branden@broadcom.com>
>> ---
>>  meta/classes/kernel.bbclass                | 1 +
>>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>>  2 files changed, 7 insertions(+)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index be93a258f6..ccd74e61e8 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -494,6 +494,7 @@ do_shared_workdir () {
>>  	# Copy files required for module builds
>>  	cp System.map $kerneldir/System.map-${KERNEL_VERSION}
>>  	[ -e Module.symvers ] && cp Module.symvers $kerneldir/
>> +	[ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
>>  	cp .config $kerneldir/
>>  	mkdir -p $kerneldir/include/config
>>  	cp include/config/kernel.release $kerneldir/include/config/kernel.release
>> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> index 81b1e36041..5f0dedbdf7 100644
>> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
>> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
>> @@ -100,6 +100,12 @@ do_install() {
>>  	# be dealt with.
>>  	# cp -a scripts $kerneldir/build
>>  
>> +	# although module.lds can be regenerated on target via 'make modules_prepare'
>> +	# there are several places where 'makes scripts prepare' is done, and that won't
>> +	# regenerate the file. So we copy it onto the target as a migration to using
>> +	# modules_prepare
>> +	cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
>> +
>>          if [ -d arch/${ARCH}/scripts ]; then
>>  	    cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>>  	fi
>>
>> 
>>
>


[-- Attachment #1.2: Type: text/html, Size: 4454 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4169 bytes --]

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-14  4:18   ` Scott Branden
@ 2020-11-14  4:27     ` Bruce Ashfield
       [not found]     ` <1647455857E467AB.30187@lists.openembedded.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Bruce Ashfield @ 2020-11-14  4:27 UTC (permalink / raw)
  To: Scott Branden
  Cc: Richard Purdie, Lili Li, Patches and discussions about the oe-core layer

On Fri, Nov 13, 2020 at 11:19 PM Scott Branden
<scott.branden@broadcom.com> wrote:
>
> Sorry, spoke too soon.  Doesn't seem to work from a clean build now.
>

How so ? Works on repeated clean builds here. For 5.4/5.8 and 5.10

Bruce

> On 2020-11-13 9:53 a.m., Scott Branden wrote:
>
> Thanks, works for me building external kernel modules.
>
> On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
>
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> The upstream commit 596b0474d3d [kbuild: preprocess module linker
> script], adds a dependency on module.lds for external module
> building.
>
> Since module.lds is generated as part of 'modules_prepare', we
> must make it available with the other kernel artifacts in the
> kernel shared workdir, otherwise out of tree builds fail.
>
> This fixes errors like:
>
>     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
>         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
>         Stop.
>     | make[4]: *** Waiting for unfinished jobs....
>
> We also ensure that kernel-devsrc has a copy to support on
> target module builds that are often prepared with 'make scripts
> prepare'. Those targets won't regenerate it, so the build fails.
> If 'make modules_prepare' is used, the file will be regenerated
> and overwrite our copy (as expected).
>
> Signed-off-by: Pan, Kris <kris.pan@intel.com>
> Signed-off-by: Lili Li <lili.li@intel.com>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
>
> Tested-by: Scott Branden <scott.branden@broadcom.com>
>
> ---
>  meta/classes/kernel.bbclass                | 1 +
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index be93a258f6..ccd74e61e8 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -494,6 +494,7 @@ do_shared_workdir () {
>   # Copy files required for module builds
>   cp System.map $kerneldir/System.map-${KERNEL_VERSION}
>   [ -e Module.symvers ] && cp Module.symvers $kerneldir/
> + [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
>   cp .config $kerneldir/
>   mkdir -p $kerneldir/include/config
>   cp include/config/kernel.release $kerneldir/include/config/kernel.release
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 81b1e36041..5f0dedbdf7 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -100,6 +100,12 @@ do_install() {
>   # be dealt with.
>   # cp -a scripts $kerneldir/build
>
> + # although module.lds can be regenerated on target via 'make modules_prepare'
> + # there are several places where 'makes scripts prepare' is done, and that won't
> + # regenerate the file. So we copy it onto the target as a migration to using
> + # modules_prepare
> + cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> +
>          if [ -d arch/${ARCH}/scripts ]; then
>      cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>   fi
>
>
> 
>
>
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
       [not found]     ` <1647455857E467AB.30187@lists.openembedded.org>
@ 2020-11-14  4:40       ` Bruce Ashfield
       [not found]       ` <16474616B7B2F983.30187@lists.openembedded.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Bruce Ashfield @ 2020-11-14  4:40 UTC (permalink / raw)
  To: Bruce Ashfield
  Cc: Scott Branden, Richard Purdie, Lili Li,
	Patches and discussions about the oe-core layer

On Fri, Nov 13, 2020 at 11:27 PM Bruce Ashfield via
lists.openembedded.org
<bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>
> On Fri, Nov 13, 2020 at 11:19 PM Scott Branden
> <scott.branden@broadcom.com> wrote:
> >
> > Sorry, spoke too soon.  Doesn't seem to work from a clean build now.
> >
>
> How so ? Works on repeated clean builds here. For 5.4/5.8 and 5.10
>

I have a theory on this. Did you directly bitbake your external module
? versus building the kernel first and then the module ?

I'll see what I can come up with.

Bruce

> Bruce
>
> > On 2020-11-13 9:53 a.m., Scott Branden wrote:
> >
> > Thanks, works for me building external kernel modules.
> >
> > On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
> >
> > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> >
> > The upstream commit 596b0474d3d [kbuild: preprocess module linker
> > script], adds a dependency on module.lds for external module
> > building.
> >
> > Since module.lds is generated as part of 'modules_prepare', we
> > must make it available with the other kernel artifacts in the
> > kernel shared workdir, otherwise out of tree builds fail.
> >
> > This fixes errors like:
> >
> >     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
> >         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
> >         Stop.
> >     | make[4]: *** Waiting for unfinished jobs....
> >
> > We also ensure that kernel-devsrc has a copy to support on
> > target module builds that are often prepared with 'make scripts
> > prepare'. Those targets won't regenerate it, so the build fails.
> > If 'make modules_prepare' is used, the file will be regenerated
> > and overwrite our copy (as expected).
> >
> > Signed-off-by: Pan, Kris <kris.pan@intel.com>
> > Signed-off-by: Lili Li <lili.li@intel.com>
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> >
> > Tested-by: Scott Branden <scott.branden@broadcom.com>
> >
> > ---
> >  meta/classes/kernel.bbclass                | 1 +
> >  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > index be93a258f6..ccd74e61e8 100644
> > --- a/meta/classes/kernel.bbclass
> > +++ b/meta/classes/kernel.bbclass
> > @@ -494,6 +494,7 @@ do_shared_workdir () {
> >   # Copy files required for module builds
> >   cp System.map $kerneldir/System.map-${KERNEL_VERSION}
> >   [ -e Module.symvers ] && cp Module.symvers $kerneldir/
> > + [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
> >   cp .config $kerneldir/
> >   mkdir -p $kerneldir/include/config
> >   cp include/config/kernel.release $kerneldir/include/config/kernel.release
> > diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > index 81b1e36041..5f0dedbdf7 100644
> > --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> > +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > @@ -100,6 +100,12 @@ do_install() {
> >   # be dealt with.
> >   # cp -a scripts $kerneldir/build
> >
> > + # although module.lds can be regenerated on target via 'make modules_prepare'
> > + # there are several places where 'makes scripts prepare' is done, and that won't
> > + # regenerate the file. So we copy it onto the target as a migration to using
> > + # modules_prepare
> > + cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> > +
> >          if [ -d arch/${ARCH}/scripts ]; then
> >      cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
> >   fi
> >
> >
> >
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
       [not found]       ` <16474616B7B2F983.30187@lists.openembedded.org>
@ 2020-11-14  5:09         ` Bruce Ashfield
  2020-11-16 18:05           ` Scott Branden
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Ashfield @ 2020-11-14  5:09 UTC (permalink / raw)
  To: Bruce Ashfield
  Cc: Scott Branden, Richard Purdie, Lili Li,
	Patches and discussions about the oe-core layer

On Fri, Nov 13, 2020 at 11:41 PM Bruce Ashfield via
lists.openembedded.org
<bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>
> On Fri, Nov 13, 2020 at 11:27 PM Bruce Ashfield via
> lists.openembedded.org
> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
> >
> > On Fri, Nov 13, 2020 at 11:19 PM Scott Branden
> > <scott.branden@broadcom.com> wrote:
> > >
> > > Sorry, spoke too soon.  Doesn't seem to work from a clean build now.
> > >
> >
> > How so ? Works on repeated clean builds here. For 5.4/5.8 and 5.10
> >
>
> I have a theory on this. Did you directly bitbake your external module
> ? versus building the kernel first and then the module ?
>
> I'll see what I can come up with.

Confirmed.

I have it sorted now. Doing one more clean build and will send a v2.

Thanks for the follow up!!

Bruce

>
> Bruce
>
> > Bruce
> >
> > > On 2020-11-13 9:53 a.m., Scott Branden wrote:
> > >
> > > Thanks, works for me building external kernel modules.
> > >
> > > On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
> > >
> > > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> > >
> > > The upstream commit 596b0474d3d [kbuild: preprocess module linker
> > > script], adds a dependency on module.lds for external module
> > > building.
> > >
> > > Since module.lds is generated as part of 'modules_prepare', we
> > > must make it available with the other kernel artifacts in the
> > > kernel shared workdir, otherwise out of tree builds fail.
> > >
> > > This fixes errors like:
> > >
> > >     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
> > >         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
> > >         Stop.
> > >     | make[4]: *** Waiting for unfinished jobs....
> > >
> > > We also ensure that kernel-devsrc has a copy to support on
> > > target module builds that are often prepared with 'make scripts
> > > prepare'. Those targets won't regenerate it, so the build fails.
> > > If 'make modules_prepare' is used, the file will be regenerated
> > > and overwrite our copy (as expected).
> > >
> > > Signed-off-by: Pan, Kris <kris.pan@intel.com>
> > > Signed-off-by: Lili Li <lili.li@intel.com>
> > > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > >
> > > Tested-by: Scott Branden <scott.branden@broadcom.com>
> > >
> > > ---
> > >  meta/classes/kernel.bbclass                | 1 +
> > >  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
> > >  2 files changed, 7 insertions(+)
> > >
> > > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > > index be93a258f6..ccd74e61e8 100644
> > > --- a/meta/classes/kernel.bbclass
> > > +++ b/meta/classes/kernel.bbclass
> > > @@ -494,6 +494,7 @@ do_shared_workdir () {
> > >   # Copy files required for module builds
> > >   cp System.map $kerneldir/System.map-${KERNEL_VERSION}
> > >   [ -e Module.symvers ] && cp Module.symvers $kerneldir/
> > > + [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
> > >   cp .config $kerneldir/
> > >   mkdir -p $kerneldir/include/config
> > >   cp include/config/kernel.release $kerneldir/include/config/kernel.release
> > > diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > > index 81b1e36041..5f0dedbdf7 100644
> > > --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> > > +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > > @@ -100,6 +100,12 @@ do_install() {
> > >   # be dealt with.
> > >   # cp -a scripts $kerneldir/build
> > >
> > > + # although module.lds can be regenerated on target via 'make modules_prepare'
> > > + # there are several places where 'makes scripts prepare' is done, and that won't
> > > + # regenerate the file. So we copy it onto the target as a migration to using
> > > + # modules_prepare
> > > + cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
> > > +
> > >          if [ -d arch/${ARCH}/scripts ]; then
> > >      cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
> > >   fi
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > - Thou shalt not follow the NULL pointer, for chaos and madness await
> > thee at its end
> > - "Use the force Harry" - Gandalf, Star Trek II
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

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

* Re: [OE-core] [PATCH] kernel: provide module.lds for out of tree builds in v5.10+
  2020-11-14  5:09         ` Bruce Ashfield
@ 2020-11-16 18:05           ` Scott Branden
  0 siblings, 0 replies; 9+ messages in thread
From: Scott Branden @ 2020-11-16 18:05 UTC (permalink / raw)
  To: Bruce Ashfield
  Cc: Richard Purdie, Lili Li, Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 4719 bytes --]



On 2020-11-13 9:09 p.m., Bruce Ashfield wrote:
> On Fri, Nov 13, 2020 at 11:41 PM Bruce Ashfield via
> lists.openembedded.org
> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>> On Fri, Nov 13, 2020 at 11:27 PM Bruce Ashfield via
>> lists.openembedded.org
>> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>>> On Fri, Nov 13, 2020 at 11:19 PM Scott Branden
>>> <scott.branden@broadcom.com> wrote:
>>>> Sorry, spoke too soon.  Doesn't seem to work from a clean build now.
>>>>
>>> How so ? Works on repeated clean builds here. For 5.4/5.8 and 5.10
>>>
>> I have a theory on this. Did you directly bitbake your external module
>> ? versus building the kernel first and then the module ?
Yes, I was doing a direct bitbake of the external module.
>>
>> I'll see what I can come up with.
> Confirmed.
>
> I have it sorted now. Doing one more clean build and will send a v2.
Glad you were able to reproduce.
>
> Thanks for the follow up!!
Looks to be merged to master now.
Will pickup the latest and if anything still not working let you know.
>
> Bruce
>
>> Bruce
>>
>>> Bruce
>>>
>>>> On 2020-11-13 9:53 a.m., Scott Branden wrote:
>>>>
>>>> Thanks, works for me building external kernel modules.
>>>>
>>>> On 2020-11-12 10:32 p.m., Bruce Ashfield wrote:
>>>>
>>>> From: Bruce Ashfield <bruce.ashfield@gmail.com>
>>>>
>>>> The upstream commit 596b0474d3d [kbuild: preprocess module linker
>>>> script], adds a dependency on module.lds for external module
>>>> building.
>>>>
>>>> Since module.lds is generated as part of 'modules_prepare', we
>>>> must make it available with the other kernel artifacts in the
>>>> kernel shared workdir, otherwise out of tree builds fail.
>>>>
>>>> This fixes errors like:
>>>>
>>>>     | make[4]: *** No rule to make target 'scripts/module.lds', needed by
>>>>         'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
>>>>         Stop.
>>>>     | make[4]: *** Waiting for unfinished jobs....
>>>>
>>>> We also ensure that kernel-devsrc has a copy to support on
>>>> target module builds that are often prepared with 'make scripts
>>>> prepare'. Those targets won't regenerate it, so the build fails.
>>>> If 'make modules_prepare' is used, the file will be regenerated
>>>> and overwrite our copy (as expected).
>>>>
>>>> Signed-off-by: Pan, Kris <kris.pan@intel.com>
>>>> Signed-off-by: Lili Li <lili.li@intel.com>
>>>> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
>>>>
>>>> Tested-by: Scott Branden <scott.branden@broadcom.com>
>>>>
>>>> ---
>>>>  meta/classes/kernel.bbclass                | 1 +
>>>>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>>>>  2 files changed, 7 insertions(+)
>>>>
>>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>>> index be93a258f6..ccd74e61e8 100644
>>>> --- a/meta/classes/kernel.bbclass
>>>> +++ b/meta/classes/kernel.bbclass
>>>> @@ -494,6 +494,7 @@ do_shared_workdir () {
>>>>   # Copy files required for module builds
>>>>   cp System.map $kerneldir/System.map-${KERNEL_VERSION}
>>>>   [ -e Module.symvers ] && cp Module.symvers $kerneldir/
>>>> + [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
>>>>   cp .config $kerneldir/
>>>>   mkdir -p $kerneldir/include/config
>>>>   cp include/config/kernel.release $kerneldir/include/config/kernel.release
>>>> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
>>>> index 81b1e36041..5f0dedbdf7 100644
>>>> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
>>>> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
>>>> @@ -100,6 +100,12 @@ do_install() {
>>>>   # be dealt with.
>>>>   # cp -a scripts $kerneldir/build
>>>>
>>>> + # although module.lds can be regenerated on target via 'make modules_prepare'
>>>> + # there are several places where 'makes scripts prepare' is done, and that won't
>>>> + # regenerate the file. So we copy it onto the target as a migration to using
>>>> + # modules_prepare
>>>> + cp -a --parents scripts/module.lds $kerneldir/build/ 2>/dev/null || :
>>>> +
>>>>          if [ -d arch/${ARCH}/scripts ]; then
>>>>      cp -a arch/${ARCH}/scripts $kerneldir/build/arch/${ARCH}
>>>>   fi
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>>> thee at its end
>>> - "Use the force Harry" - Gandalf, Star Trek II
>>>
>>>
>>>
>>
>> --
>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end
>> - "Use the force Harry" - Gandalf, Star Trek II
>>
>> 
>>
>


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4169 bytes --]

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

end of thread, other threads:[~2020-11-16 18:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  6:32 [PATCH] kernel: provide module.lds for out of tree builds in v5.10+ Bruce Ashfield
2020-11-13 17:53 ` [OE-core] " Scott Branden
2020-11-14  4:18   ` Scott Branden
2020-11-14  4:27     ` Bruce Ashfield
     [not found]     ` <1647455857E467AB.30187@lists.openembedded.org>
2020-11-14  4:40       ` Bruce Ashfield
     [not found]       ` <16474616B7B2F983.30187@lists.openembedded.org>
2020-11-14  5:09         ` Bruce Ashfield
2020-11-16 18:05           ` Scott Branden
2020-11-13 18:09 ` Khem Raj
2020-11-13 19:55   ` Bruce Ashfield

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.