All of lore.kernel.org
 help / color / mirror / Atom feed
* openssl-native.rm_work runs before kernel-module.install -> no signature
@ 2023-10-25  8:57 Jörg Sommer
  2023-10-25 11:40 ` [oe] " Jose Quaresma
       [not found] ` <179156E1429869C6.11247@lists.openembedded.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Jörg Sommer @ 2023-10-25  8:57 UTC (permalink / raw)
  To: openembedded-devel

Hi,

I'm having an odd problem building the external kernel module
kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
enabled.

[1]  https://layers.openembedded.org/layerindex/recipe/40267/

The module builds fine, but the install step contains the module signing
which **silently** fails with *libcrypto.so.3* not found:

```
| make -C /build/tmp/work-shared/ziborium/kernel-source
M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
modules_install
| make[1]: Entering directory '/build/tmp/work-shared/machine/kernel-source'
| make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
/build/tmp/work-shared/machine/kernel-source/Makefile modules_install
| make[2]: Entering directory
'/build/tmp/work-shared/machine/kernel-build-artifacts'
| test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
(		\
| echo >&2;							\
| echo >&2 "  ERROR: Kernel configuration is invalid.";		\
| echo >&2 "         include/generated/autoconf.h or
include/config/auto.conf are missing.";\
| echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
to fix it.";	\
| echo >&2 ;							\
| /bin/false)
| make -f
/build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
|   mkdir -p
/build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
cp
/build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
/build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
|   :
|   scripts/sign-file "sha1" "certs/signing_key.pem"
certs/signing_key.x509
/build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
|| true
| scripts/sign-file: error while loading shared libraries:
libcrypto.so.3: cannot open shared object file: No such file or directory
|   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
echo 5.15.60-imx8mm+g343e81c0e39e
| Warning: modules_install: missing 'System.map' file. Skipping depmod.
| make[2]: Leaving directory
'/build/tmp/work-shared/machine/kernel-build-artifacts'
| make[1]: Leaving directory '/build/tmp/work-shared/machine/kernel-source'
```

I noticed that there are special dependency definitions in make-mod-scripts

```
do_configure[depends] += "virtual/kernel:do_shared_workdir
openssl-native:do_populate_sysroot"
do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
```

and module-base.bbclass (inherited by module.bbclass)

```
# We do the dependency this way because the output is not preserved
# in sstate, so we must force do_compile to run (once).
do_configure[depends] += "make-mod-scripts:do_compile"
```

Is there an additional dependency needed to address rm_work?

Kind regards

Jörg Sommer
-- 
Navimatix GmbH
Tatzendpromenade 2
D-07745 Jena
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480


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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-25  8:57 openssl-native.rm_work runs before kernel-module.install -> no signature Jörg Sommer
@ 2023-10-25 11:40 ` Jose Quaresma
  2023-10-25 14:45   ` Bruce Ashfield
       [not found] ` <179156E1429869C6.11247@lists.openembedded.org>
  1 sibling, 1 reply; 16+ messages in thread
From: Jose Quaresma @ 2023-10-25 11:40 UTC (permalink / raw)
  To: joerg.sommer; +Cc: openembedded-devel, Bruce Ashfield

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

Hi Joerg,

This topic has already been discussed previously in
https://lists.openembedded.org/g/openembedded-core/topic/98296212

Bruce even sent a patch but it was never integrated, probably because it
was a very invasive change.
https://lists.openembedded.org/g/openembedded-core/message/182024

Anyway you can solve this problem with:
RM_WORK_EXCLUDE += "make-mod-scripts"

Jose

Jörg Sommer via lists.openembedded.org <joerg.sommer=
navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023
à(s) 09:57:

> Hi,
>
> I'm having an odd problem building the external kernel module
> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
> enabled.
>
> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
>
> The module builds fine, but the install step contains the module signing
> which **silently** fails with *libcrypto.so.3* not found:
>
> ```
> | make -C /build/tmp/work-shared/ziborium/kernel-source
>
> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
> modules_install
> | make[1]: Entering directory
> '/build/tmp/work-shared/machine/kernel-source'
> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
> | make[2]: Entering directory
> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> | test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
> (               \
> | echo >&2;                                                     \
> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
> | echo >&2 "         include/generated/autoconf.h or
> include/config/auto.conf are missing.";\
> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
> to fix it.";    \
> | echo >&2 ;                                                    \
> | /bin/false)
> | make -f
> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
> |   mkdir -p
>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
> cp
>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> |   :
> |   scripts/sign-file "sha1" "certs/signing_key.pem"
> certs/signing_key.x509
>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> || true
> | scripts/sign-file: error while loading shared libraries:
> libcrypto.so.3: cannot open shared object file: No such file or directory
> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
> echo 5.15.60-imx8mm+g343e81c0e39e
> | Warning: modules_install: missing 'System.map' file. Skipping depmod.
> | make[2]: Leaving directory
> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> | make[1]: Leaving directory '/build/tmp/work-shared/machine/kernel-source'
> ```
>
> I noticed that there are special dependency definitions in make-mod-scripts
>
> ```
> do_configure[depends] += "virtual/kernel:do_shared_workdir
> openssl-native:do_populate_sysroot"
> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> ```
>
> and module-base.bbclass (inherited by module.bbclass)
>
> ```
> # We do the dependency this way because the output is not preserved
> # in sstate, so we must force do_compile to run (once).
> do_configure[depends] += "make-mod-scripts:do_compile"
> ```
>
> Is there an additional dependency needed to address rm_work?
>
> Kind regards
>
> Jörg Sommer
> --
> Navimatix GmbH
> Tatzendpromenade 2
> D-07745 Jena
> Geschäftsführer: Steffen Späthe, Jan Rommeley
> Registergericht: Amtsgericht Jena, HRB 501480
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#105726):
> https://lists.openembedded.org/g/openembedded-devel/message/105726
> Mute This Topic: https://lists.openembedded.org/mt/102174355/5052612
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 6267 bytes --]

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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
       [not found] ` <179156E1429869C6.11247@lists.openembedded.org>
@ 2023-10-25 12:01   ` Jose Quaresma
  0 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2023-10-25 12:01 UTC (permalink / raw)
  To: quaresma.jose; +Cc: joerg.sommer, openembedded-devel, Bruce Ashfield

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

Jose Quaresma via lists.openembedded.org <quaresma.jose=
gmail.com@lists.openembedded.org> escreveu no dia quarta, 25/10/2023 à(s)
12:41:

> Hi Joerg,
>
> This topic has already been discussed previously in
> https://lists.openembedded.org/g/openembedded-core/topic/98296212
>
> Bruce even sent a patch but it was never integrated, probably because it
> was a very invasive change.
> https://lists.openembedded.org/g/openembedded-core/message/182024
>
> Anyway you can solve this problem with:
> RM_WORK_EXCLUDE += "make-mod-scripts"
>

I have proposed a fix for this
https://lists.openembedded.org/g/openembedded-core/message/189675


>
>
> Jose
>
> Jörg Sommer via lists.openembedded.org <joerg.sommer=
> navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023
> à(s) 09:57:
>
>> Hi,
>>
>> I'm having an odd problem building the external kernel module
>> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
>> enabled.
>>
>> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
>>
>> The module builds fine, but the install step contains the module signing
>> which **silently** fails with *libcrypto.so.3* not found:
>>
>> ```
>> | make -C /build/tmp/work-shared/ziborium/kernel-source
>>
>> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
>> modules_install
>> | make[1]: Entering directory
>> '/build/tmp/work-shared/machine/kernel-source'
>> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
>> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
>> | make[2]: Entering directory
>> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> | test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
>> (               \
>> | echo >&2;                                                     \
>> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
>> | echo >&2 "         include/generated/autoconf.h or
>> include/config/auto.conf are missing.";\
>> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
>> to fix it.";    \
>> | echo >&2 ;                                                    \
>> | /bin/false)
>> | make -f
>> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
>> |   mkdir -p
>>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
>> cp
>>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
>>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> |   :
>> |   scripts/sign-file "sha1" "certs/signing_key.pem"
>> certs/signing_key.x509
>>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> || true
>> | scripts/sign-file: error while loading shared libraries:
>> libcrypto.so.3: cannot open shared object file: No such file or directory
>> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
>> echo 5.15.60-imx8mm+g343e81c0e39e
>> | Warning: modules_install: missing 'System.map' file. Skipping depmod.
>> | make[2]: Leaving directory
>> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> | make[1]: Leaving directory
>> '/build/tmp/work-shared/machine/kernel-source'
>> ```
>>
>> I noticed that there are special dependency definitions in
>> make-mod-scripts
>>
>> ```
>> do_configure[depends] += "virtual/kernel:do_shared_workdir
>> openssl-native:do_populate_sysroot"
>> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>> ```
>>
>> and module-base.bbclass (inherited by module.bbclass)
>>
>> ```
>> # We do the dependency this way because the output is not preserved
>> # in sstate, so we must force do_compile to run (once).
>> do_configure[depends] += "make-mod-scripts:do_compile"
>> ```
>>
>> Is there an additional dependency needed to address rm_work?
>>
>> Kind regards
>>
>> Jörg Sommer
>> --
>> Navimatix GmbH
>> Tatzendpromenade 2
>> D-07745 Jena
>> Geschäftsführer: Steffen Späthe, Jan Rommeley
>> Registergericht: Amtsgericht Jena, HRB 501480
>>
>>
>>
>>
>
> --
> Best regards,
>
> José Quaresma
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#105727):
> https://lists.openembedded.org/g/openembedded-devel/message/105727
> Mute This Topic: https://lists.openembedded.org/mt/102174355/5052612
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 7398 bytes --]

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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-25 11:40 ` [oe] " Jose Quaresma
@ 2023-10-25 14:45   ` Bruce Ashfield
  2023-10-25 17:18     ` Khem Raj
  0 siblings, 1 reply; 16+ messages in thread
From: Bruce Ashfield @ 2023-10-25 14:45 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: joerg.sommer, openembedded-devel

On Wed, Oct 25, 2023 at 7:40 AM Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> Hi Joerg,
>
> This topic has already been discussed previously in
> https://lists.openembedded.org/g/openembedded-core/topic/98296212
>
> Bruce even sent a patch but it was never integrated, probably because it was a very invasive change.
> https://lists.openembedded.org/g/openembedded-core/message/182024

Heh. No, that wasn't the reason. The change wasn't invasive, it is
isolated to just the single recipe.

I just didn't have the cycles to chase down host specific issues and
uninative updates.

Clobbering rm_work isn't the right solution IMHO, but it can do the job.

Bruce

>
> Anyway you can solve this problem with:
> RM_WORK_EXCLUDE += "make-mod-scripts"
>
> Jose
>
> Jörg Sommer via lists.openembedded.org <joerg.sommer=navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023 à(s) 09:57:
>>
>> Hi,
>>
>> I'm having an odd problem building the external kernel module
>> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
>> enabled.
>>
>> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
>>
>> The module builds fine, but the install step contains the module signing
>> which **silently** fails with *libcrypto.so.3* not found:
>>
>> ```
>> | make -C /build/tmp/work-shared/ziborium/kernel-source
>> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
>> modules_install
>> | make[1]: Entering directory '/build/tmp/work-shared/machine/kernel-source'
>> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
>> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
>> | make[2]: Entering directory
>> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> | test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
>> (               \
>> | echo >&2;                                                     \
>> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
>> | echo >&2 "         include/generated/autoconf.h or
>> include/config/auto.conf are missing.";\
>> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
>> to fix it.";    \
>> | echo >&2 ;                                                    \
>> | /bin/false)
>> | make -f
>> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
>> |   mkdir -p
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
>> cp
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> |   :
>> |   scripts/sign-file "sha1" "certs/signing_key.pem"
>> certs/signing_key.x509
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> || true
>> | scripts/sign-file: error while loading shared libraries:
>> libcrypto.so.3: cannot open shared object file: No such file or directory
>> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
>> echo 5.15.60-imx8mm+g343e81c0e39e
>> | Warning: modules_install: missing 'System.map' file. Skipping depmod.
>> | make[2]: Leaving directory
>> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> | make[1]: Leaving directory '/build/tmp/work-shared/machine/kernel-source'
>> ```
>>
>> I noticed that there are special dependency definitions in make-mod-scripts
>>
>> ```
>> do_configure[depends] += "virtual/kernel:do_shared_workdir
>> openssl-native:do_populate_sysroot"
>> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>> ```
>>
>> and module-base.bbclass (inherited by module.bbclass)
>>
>> ```
>> # We do the dependency this way because the output is not preserved
>> # in sstate, so we must force do_compile to run (once).
>> do_configure[depends] += "make-mod-scripts:do_compile"
>> ```
>>
>> Is there an additional dependency needed to address rm_work?
>>
>> Kind regards
>>
>> Jörg Sommer
>> --
>> Navimatix GmbH
>> Tatzendpromenade 2
>> D-07745 Jena
>> Geschäftsführer: Steffen Späthe, Jan Rommeley
>> Registergericht: Amtsgericht Jena, HRB 501480
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#105726): https://lists.openembedded.org/g/openembedded-devel/message/105726
>> Mute This Topic: https://lists.openembedded.org/mt/102174355/5052612
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [quaresma.jose@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
>
> --
> Best regards,
>
> José Quaresma



-- 
- 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] 16+ messages in thread

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-25 14:45   ` Bruce Ashfield
@ 2023-10-25 17:18     ` Khem Raj
  2023-10-26  8:34       ` Jose Quaresma
  0 siblings, 1 reply; 16+ messages in thread
From: Khem Raj @ 2023-10-25 17:18 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Jose Quaresma, joerg.sommer, openembedded-devel

I wonder if something like below would help

diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
index 2cff48c39c3..6133721334c 100644
--- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
+++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -12,7 +12,7 @@ S = "${WORKDIR}"

 do_configure[depends] += "virtual/kernel:do_shared_workdir
openssl-native:do_populate_sysroot"
 do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
-
+do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"

 DEPENDS += "bc-native bison-native"
 DEPENDS += "gmp-native"

On Wed, Oct 25, 2023 at 7:45 AM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> On Wed, Oct 25, 2023 at 7:40 AM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> >
> > Hi Joerg,
> >
> > This topic has already been discussed previously in
> > https://lists.openembedded.org/g/openembedded-core/topic/98296212
> >
> > Bruce even sent a patch but it was never integrated, probably because it was a very invasive change.
> > https://lists.openembedded.org/g/openembedded-core/message/182024
>
> Heh. No, that wasn't the reason. The change wasn't invasive, it is
> isolated to just the single recipe.
>
> I just didn't have the cycles to chase down host specific issues and
> uninative updates.
>
> Clobbering rm_work isn't the right solution IMHO, but it can do the job.
>
> Bruce
>
> >
> > Anyway you can solve this problem with:
> > RM_WORK_EXCLUDE += "make-mod-scripts"
> >
> > Jose
> >
> > Jörg Sommer via lists.openembedded.org <joerg.sommer=navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023 à(s) 09:57:
> >>
> >> Hi,
> >>
> >> I'm having an odd problem building the external kernel module
> >> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
> >> enabled.
> >>
> >> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
> >>
> >> The module builds fine, but the install step contains the module signing
> >> which **silently** fails with *libcrypto.so.3* not found:
> >>
> >> ```
> >> | make -C /build/tmp/work-shared/ziborium/kernel-source
> >> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
> >> modules_install
> >> | make[1]: Entering directory '/build/tmp/work-shared/machine/kernel-source'
> >> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
> >> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
> >> | make[2]: Entering directory
> >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> >> | test -e include/generated/autoconf.h -a -e include/config/auto.conf ||
> >> (               \
> >> | echo >&2;                                                     \
> >> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
> >> | echo >&2 "         include/generated/autoconf.h or
> >> include/config/auto.conf are missing.";\
> >> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
> >> to fix it.";    \
> >> | echo >&2 ;                                                    \
> >> | /bin/false)
> >> | make -f
> >> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
> >> |   mkdir -p
> >> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
> >> cp
> >> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
> >> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> >> |   :
> >> |   scripts/sign-file "sha1" "certs/signing_key.pem"
> >> certs/signing_key.x509
> >> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> >> || true
> >> | scripts/sign-file: error while loading shared libraries:
> >> libcrypto.so.3: cannot open shared object file: No such file or directory
> >> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
> >> echo 5.15.60-imx8mm+g343e81c0e39e
> >> | Warning: modules_install: missing 'System.map' file. Skipping depmod.
> >> | make[2]: Leaving directory
> >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> >> | make[1]: Leaving directory '/build/tmp/work-shared/machine/kernel-source'
> >> ```
> >>
> >> I noticed that there are special dependency definitions in make-mod-scripts
> >>
> >> ```
> >> do_configure[depends] += "virtual/kernel:do_shared_workdir
> >> openssl-native:do_populate_sysroot"
> >> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> >> ```
> >>
> >> and module-base.bbclass (inherited by module.bbclass)
> >>
> >> ```
> >> # We do the dependency this way because the output is not preserved
> >> # in sstate, so we must force do_compile to run (once).
> >> do_configure[depends] += "make-mod-scripts:do_compile"
> >> ```
> >>
> >> Is there an additional dependency needed to address rm_work?
> >>
> >> Kind regards
> >>
> >> Jörg Sommer
> >> --
> >> Navimatix GmbH
> >> Tatzendpromenade 2
> >> D-07745 Jena
> >> Geschäftsführer: Steffen Späthe, Jan Rommeley
> >> Registergericht: Amtsgericht Jena, HRB 501480
> >>
> >>
> >>
> >
> >
> > --
> > Best regards,
> >
> > José Quaresma
>
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#105729): https://lists.openembedded.org/g/openembedded-devel/message/105729
> Mute This Topic: https://lists.openembedded.org/mt/102174355/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-25 17:18     ` Khem Raj
@ 2023-10-26  8:34       ` Jose Quaresma
  2023-10-26  8:47         ` Martin Jansa
  2023-10-26 11:16         ` Jörg Sommer
  0 siblings, 2 replies; 16+ messages in thread
From: Jose Quaresma @ 2023-10-26  8:34 UTC (permalink / raw)
  To: Khem Raj; +Cc: Bruce Ashfield, joerg.sommer, openembedded-devel

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

Khem Raj <raj.khem@gmail.com> escreveu no dia quarta, 25/10/2023 à(s) 18:18:

> I wonder if something like below would help
>
> diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> index 2cff48c39c3..6133721334c 100644
> --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> @@ -12,7 +12,7 @@ S = "${WORKDIR}"
>
>  do_configure[depends] += "virtual/kernel:do_shared_workdir
> openssl-native:do_populate_sysroot"
>  do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> -
> +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
>

This doesn't solve the problem because at compile time the openssl is
already there on native sysroot
and this is the reason for the sign-file to be linked with openssl.
The make-mod-script doesn't install anything and only calls make on the
shared staging kernel dir
and the consequence is creating some binaries on the shared staging kernel
builddir.
One of the tools it builds is the sign-file linked dynamically with the
openssl in the native sysroot of
make-mod-script. At the end of make-mod-script the rm_work deletes the
native sysroot
and this will remove the openssl libcrypto.so.3.
Next time the sign-file in the shared staging kernel builddir will run the
libcrypto.so.3 will not be found.
Without using the rm_work class everything works as expected.

Jose


>  DEPENDS += "bc-native bison-native"
>  DEPENDS += "gmp-native"
>
> On Wed, Oct 25, 2023 at 7:45 AM Bruce Ashfield <bruce.ashfield@gmail.com>
> wrote:
> >
> > On Wed, Oct 25, 2023 at 7:40 AM Jose Quaresma <quaresma.jose@gmail.com>
> wrote:
> > >
> > > Hi Joerg,
> > >
> > > This topic has already been discussed previously in
> > > https://lists.openembedded.org/g/openembedded-core/topic/98296212
> > >
> > > Bruce even sent a patch but it was never integrated, probably because
> it was a very invasive change.
> > > https://lists.openembedded.org/g/openembedded-core/message/182024
> >
> > Heh. No, that wasn't the reason. The change wasn't invasive, it is
> > isolated to just the single recipe.
> >
> > I just didn't have the cycles to chase down host specific issues and
> > uninative updates.
> >
> > Clobbering rm_work isn't the right solution IMHO, but it can do the job.
> >
> > Bruce
> >
> > >
> > > Anyway you can solve this problem with:
> > > RM_WORK_EXCLUDE += "make-mod-scripts"
> > >
> > > Jose
> > >
> > > Jörg Sommer via lists.openembedded.org <joerg.sommer=
> navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023
> à(s) 09:57:
> > >>
> > >> Hi,
> > >>
> > >> I'm having an odd problem building the external kernel module
> > >> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
> > >> enabled.
> > >>
> > >> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
> > >>
> > >> The module builds fine, but the install step contains the module
> signing
> > >> which **silently** fails with *libcrypto.so.3* not found:
> > >>
> > >> ```
> > >> | make -C /build/tmp/work-shared/ziborium/kernel-source
> > >>
> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
> > >> modules_install
> > >> | make[1]: Entering directory
> '/build/tmp/work-shared/machine/kernel-source'
> > >> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
> > >> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
> > >> | make[2]: Entering directory
> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> > >> | test -e include/generated/autoconf.h -a -e include/config/auto.conf
> ||
> > >> (               \
> > >> | echo >&2;                                                     \
> > >> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
> > >> | echo >&2 "         include/generated/autoconf.h or
> > >> include/config/auto.conf are missing.";\
> > >> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel
> src
> > >> to fix it.";    \
> > >> | echo >&2 ;                                                    \
> > >> | /bin/false)
> > >> | make -f
> > >> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
> > >> |   mkdir -p
> > >>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
> > >> cp
> > >>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
> > >>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> > >> |   :
> > >> |   scripts/sign-file "sha1" "certs/signing_key.pem"
> > >> certs/signing_key.x509
> > >>
> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
> > >> || true
> > >> | scripts/sign-file: error while loading shared libraries:
> > >> libcrypto.so.3: cannot open shared object file: No such file or
> directory
> > >> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
> > >> echo 5.15.60-imx8mm+g343e81c0e39e
> > >> | Warning: modules_install: missing 'System.map' file. Skipping
> depmod.
> > >> | make[2]: Leaving directory
> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
> > >> | make[1]: Leaving directory
> '/build/tmp/work-shared/machine/kernel-source'
> > >> ```
> > >>
> > >> I noticed that there are special dependency definitions in
> make-mod-scripts
> > >>
> > >> ```
> > >> do_configure[depends] += "virtual/kernel:do_shared_workdir
> > >> openssl-native:do_populate_sysroot"
> > >> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> > >> ```
> > >>
> > >> and module-base.bbclass (inherited by module.bbclass)
> > >>
> > >> ```
> > >> # We do the dependency this way because the output is not preserved
> > >> # in sstate, so we must force do_compile to run (once).
> > >> do_configure[depends] += "make-mod-scripts:do_compile"
> > >> ```
> > >>
> > >> Is there an additional dependency needed to address rm_work?
> > >>
> > >> Kind regards
> > >>
> > >> Jörg Sommer
> > >> --
> > >> Navimatix GmbH
> > >> Tatzendpromenade 2
> > >> D-07745 Jena
> > >> Geschäftsführer: Steffen Späthe, Jan Rommeley
> > >> Registergericht: Amtsgericht Jena, HRB 501480
> > >>
> > >>
> > >>
> > >
> > >
> > > --
> > > Best regards,
> > >
> > > José Quaresma
> >
> >
> >
> > --
> > - Thou shalt not follow the NULL pointer, for chaos and madness await
> > thee at its end
> > - "Use the force Harry" - Gandalf, Star Trek II
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#105729):
> https://lists.openembedded.org/g/openembedded-devel/message/105729
> > Mute This Topic: https://lists.openembedded.org/mt/102174355/1997914
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>


-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 11039 bytes --]

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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26  8:34       ` Jose Quaresma
@ 2023-10-26  8:47         ` Martin Jansa
  2023-10-26  9:13           ` Jose Quaresma
  2023-10-26 11:16         ` Jörg Sommer
  1 sibling, 1 reply; 16+ messages in thread
From: Martin Jansa @ 2023-10-26  8:47 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: Khem Raj, Bruce Ashfield, joerg.sommer, openembedded-devel

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

But something like this inside of the external kernel module should work,
right? If yes, then it could be moved to module.bbclass or something.

At least as long as the RPATH is set correctly, that worked for me with
some old 4.9 kernels in:
https://github.com/shr-distribution/linux/commit/409f7adf4a862e439b5bec04739b67713e08b8ba

On Thu, Oct 26, 2023 at 10:35 AM Jose Quaresma <quaresma.jose@gmail.com>
wrote:

>
>
> Khem Raj <raj.khem@gmail.com> escreveu no dia quarta, 25/10/2023 à(s)
> 18:18:
>
>> I wonder if something like below would help
>>
>> diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>> b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>> index 2cff48c39c3..6133721334c 100644
>> --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>> +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>> @@ -12,7 +12,7 @@ S = "${WORKDIR}"
>>
>>  do_configure[depends] += "virtual/kernel:do_shared_workdir
>> openssl-native:do_populate_sysroot"
>>  do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>> -
>> +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
>>
>
> This doesn't solve the problem because at compile time the openssl is
> already there on native sysroot
> and this is the reason for the sign-file to be linked with openssl.
> The make-mod-script doesn't install anything and only calls make on the
> shared staging kernel dir
> and the consequence is creating some binaries on the shared staging kernel
> builddir.
> One of the tools it builds is the sign-file linked dynamically with the
> openssl in the native sysroot of
> make-mod-script. At the end of make-mod-script the rm_work deletes the
> native sysroot
> and this will remove the openssl libcrypto.so.3.
> Next time the sign-file in the shared staging kernel builddir will run the
> libcrypto.so.3 will not be found.
> Without using the rm_work class everything works as expected.
>
> Jose
>
>
>>  DEPENDS += "bc-native bison-native"
>>  DEPENDS += "gmp-native"
>>
>> On Wed, Oct 25, 2023 at 7:45 AM Bruce Ashfield <bruce.ashfield@gmail.com>
>> wrote:
>> >
>> > On Wed, Oct 25, 2023 at 7:40 AM Jose Quaresma <quaresma.jose@gmail.com>
>> wrote:
>> > >
>> > > Hi Joerg,
>> > >
>> > > This topic has already been discussed previously in
>> > > https://lists.openembedded.org/g/openembedded-core/topic/98296212
>> > >
>> > > Bruce even sent a patch but it was never integrated, probably because
>> it was a very invasive change.
>> > > https://lists.openembedded.org/g/openembedded-core/message/182024
>> >
>> > Heh. No, that wasn't the reason. The change wasn't invasive, it is
>> > isolated to just the single recipe.
>> >
>> > I just didn't have the cycles to chase down host specific issues and
>> > uninative updates.
>> >
>> > Clobbering rm_work isn't the right solution IMHO, but it can do the job.
>> >
>> > Bruce
>> >
>> > >
>> > > Anyway you can solve this problem with:
>> > > RM_WORK_EXCLUDE += "make-mod-scripts"
>> > >
>> > > Jose
>> > >
>> > > Jörg Sommer via lists.openembedded.org <joerg.sommer=
>> navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023
>> à(s) 09:57:
>> > >>
>> > >> Hi,
>> > >>
>> > >> I'm having an odd problem building the external kernel module
>> > >> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
>> > >> enabled.
>> > >>
>> > >> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
>> > >>
>> > >> The module builds fine, but the install step contains the module
>> signing
>> > >> which **silently** fails with *libcrypto.so.3* not found:
>> > >>
>> > >> ```
>> > >> | make -C /build/tmp/work-shared/ziborium/kernel-source
>> > >>
>> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
>> > >> modules_install
>> > >> | make[1]: Entering directory
>> '/build/tmp/work-shared/machine/kernel-source'
>> > >> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
>> > >> /build/tmp/work-shared/machine/kernel-source/Makefile modules_install
>> > >> | make[2]: Entering directory
>> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> > >> | test -e include/generated/autoconf.h -a -e
>> include/config/auto.conf ||
>> > >> (               \
>> > >> | echo >&2;                                                     \
>> > >> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
>> > >> | echo >&2 "         include/generated/autoconf.h or
>> > >> include/config/auto.conf are missing.";\
>> > >> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel
>> src
>> > >> to fix it.";    \
>> > >> | echo >&2 ;                                                    \
>> > >> | /bin/false)
>> > >> | make -f
>> > >> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
>> > >> |   mkdir -p
>> > >>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
>> > >> cp
>> > >>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
>> > >>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> > >> |   :
>> > >> |   scripts/sign-file "sha1" "certs/signing_key.pem"
>> > >> certs/signing_key.x509
>> > >>
>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>> > >> || true
>> > >> | scripts/sign-file: error while loading shared libraries:
>> > >> libcrypto.so.3: cannot open shared object file: No such file or
>> directory
>> > >> |   sh /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
>> > >> echo 5.15.60-imx8mm+g343e81c0e39e
>> > >> | Warning: modules_install: missing 'System.map' file. Skipping
>> depmod.
>> > >> | make[2]: Leaving directory
>> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>> > >> | make[1]: Leaving directory
>> '/build/tmp/work-shared/machine/kernel-source'
>> > >> ```
>> > >>
>> > >> I noticed that there are special dependency definitions in
>> make-mod-scripts
>> > >>
>> > >> ```
>> > >> do_configure[depends] += "virtual/kernel:do_shared_workdir
>> > >> openssl-native:do_populate_sysroot"
>> > >> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>> > >> ```
>> > >>
>> > >> and module-base.bbclass (inherited by module.bbclass)
>> > >>
>> > >> ```
>> > >> # We do the dependency this way because the output is not preserved
>> > >> # in sstate, so we must force do_compile to run (once).
>> > >> do_configure[depends] += "make-mod-scripts:do_compile"
>> > >> ```
>> > >>
>> > >> Is there an additional dependency needed to address rm_work?
>> > >>
>> > >> Kind regards
>> > >>
>> > >> Jörg Sommer
>> > >> --
>> > >> Navimatix GmbH
>> > >> Tatzendpromenade 2
>> > >> D-07745 Jena
>> > >> Geschäftsführer: Steffen Späthe, Jan Rommeley
>> > >> Registergericht: Amtsgericht Jena, HRB 501480
>> > >>
>> > >>
>> > >>
>> > >
>> > >
>> > > --
>> > > Best regards,
>> > >
>> > > José Quaresma
>> >
>> >
>> >
>> > --
>> > - Thou shalt not follow the NULL pointer, for chaos and madness await
>> > thee at its end
>> > - "Use the force Harry" - Gandalf, Star Trek II
>> >
>> >
>> >
>>
>
>
> --
> Best regards,
>
> José Quaresma
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#105731):
> https://lists.openembedded.org/g/openembedded-devel/message/105731
> Mute This Topic: https://lists.openembedded.org/mt/102174355/3617156
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> martin.jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 11892 bytes --]

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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26  8:47         ` Martin Jansa
@ 2023-10-26  9:13           ` Jose Quaresma
  0 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2023-10-26  9:13 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Khem Raj, Bruce Ashfield, joerg.sommer, openembedded-devel

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

Hi Martin

Martin Jansa <martin.jansa@gmail.com> escreveu no dia quinta, 26/10/2023
à(s) 09:47:

> But something like this inside of the external kernel module should work,
> right? If yes, then it could be moved to module.bbclass or something.
>
> At least as long as the RPATH is set correctly, that worked for me with
> some old 4.9 kernels in:
>
> https://github.com/shr-distribution/linux/commit/409f7adf4a862e439b5bec04739b67713e08b8ba
>

If the RPATH was not pointing to the native sysroot of the make-mod-script
it should work
otherwise I think it can fail the same way when the rm_work class is in
place.
Looks like your patch is to choose between the host machine and the oe
native sysroot
and this rm_work is a different issue but I may be misunderstanding the
problem.

Jose


>
>
> On Thu, Oct 26, 2023 at 10:35 AM Jose Quaresma <quaresma.jose@gmail.com>
> wrote:
>
>>
>>
>> Khem Raj <raj.khem@gmail.com> escreveu no dia quarta, 25/10/2023 à(s)
>> 18:18:
>>
>>> I wonder if something like below would help
>>>
>>> diff --git a/meta/recipes-kernel/make-mod-scripts/
>>> make-mod-scripts_1.0.bb
>>> b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>> index 2cff48c39c3..6133721334c 100644
>>> --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>> +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>> @@ -12,7 +12,7 @@ S = "${WORKDIR}"
>>>
>>>  do_configure[depends] += "virtual/kernel:do_shared_workdir
>>> openssl-native:do_populate_sysroot"
>>>  do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>>> -
>>> +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
>>>
>>
>> This doesn't solve the problem because at compile time the openssl is
>> already there on native sysroot
>> and this is the reason for the sign-file to be linked with openssl.
>> The make-mod-script doesn't install anything and only calls make on the
>> shared staging kernel dir
>> and the consequence is creating some binaries on the shared staging
>> kernel builddir.
>> One of the tools it builds is the sign-file linked dynamically with the
>> openssl in the native sysroot of
>> make-mod-script. At the end of make-mod-script the rm_work deletes the
>> native sysroot
>> and this will remove the openssl libcrypto.so.3.
>> Next time the sign-file in the shared staging kernel builddir will run
>> the libcrypto.so.3 will not be found.
>> Without using the rm_work class everything works as expected.
>>
>> Jose
>>
>>
>>>  DEPENDS += "bc-native bison-native"
>>>  DEPENDS += "gmp-native"
>>>
>>> On Wed, Oct 25, 2023 at 7:45 AM Bruce Ashfield <bruce.ashfield@gmail.com>
>>> wrote:
>>> >
>>> > On Wed, Oct 25, 2023 at 7:40 AM Jose Quaresma <quaresma.jose@gmail.com>
>>> wrote:
>>> > >
>>> > > Hi Joerg,
>>> > >
>>> > > This topic has already been discussed previously in
>>> > > https://lists.openembedded.org/g/openembedded-core/topic/98296212
>>> > >
>>> > > Bruce even sent a patch but it was never integrated, probably
>>> because it was a very invasive change.
>>> > > https://lists.openembedded.org/g/openembedded-core/message/182024
>>> >
>>> > Heh. No, that wasn't the reason. The change wasn't invasive, it is
>>> > isolated to just the single recipe.
>>> >
>>> > I just didn't have the cycles to chase down host specific issues and
>>> > uninative updates.
>>> >
>>> > Clobbering rm_work isn't the right solution IMHO, but it can do the
>>> job.
>>> >
>>> > Bruce
>>> >
>>> > >
>>> > > Anyway you can solve this problem with:
>>> > > RM_WORK_EXCLUDE += "make-mod-scripts"
>>> > >
>>> > > Jose
>>> > >
>>> > > Jörg Sommer via lists.openembedded.org <joerg.sommer=
>>> navimatix.de@lists.openembedded.org> escreveu no dia quarta, 25/10/2023
>>> à(s) 09:57:
>>> > >>
>>> > >> Hi,
>>> > >>
>>> > >> I'm having an odd problem building the external kernel module
>>> > >> kernel-module-imx-gpu-viv [1]. I'm using kirkstone and have rm_work
>>> > >> enabled.
>>> > >>
>>> > >> [1]  https://layers.openembedded.org/layerindex/recipe/40267/
>>> > >>
>>> > >> The module builds fine, but the install step contains the module
>>> signing
>>> > >> which **silently** fails with *libcrypto.so.3* not found:
>>> > >>
>>> > >> ```
>>> > >> | make -C /build/tmp/work-shared/ziborium/kernel-source
>>> > >>
>>> M=/build/tmp/work/machine-pyxis-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src
>>> > >> modules_install
>>> > >> | make[1]: Entering directory
>>> '/build/tmp/work-shared/machine/kernel-source'
>>> > >> | make -C /build/tmp/work-shared/machine/kernel-build-artifacts -f
>>> > >> /build/tmp/work-shared/machine/kernel-source/Makefile
>>> modules_install
>>> > >> | make[2]: Entering directory
>>> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>>> > >> | test -e include/generated/autoconf.h -a -e
>>> include/config/auto.conf ||
>>> > >> (               \
>>> > >> | echo >&2;                                                     \
>>> > >> | echo >&2 "  ERROR: Kernel configuration is invalid.";         \
>>> > >> | echo >&2 "         include/generated/autoconf.h or
>>> > >> include/config/auto.conf are missing.";\
>>> > >> | echo >&2 "         Run 'make oldconfig && make prepare' on kernel
>>> src
>>> > >> to fix it.";    \
>>> > >> | echo >&2 ;                                                    \
>>> > >> | /bin/false)
>>> > >> | make -f
>>> > >>
>>> /build/tmp/work-shared/machine/kernel-source/scripts/Makefile.modinst
>>> > >> |   mkdir -p
>>> > >>
>>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/;
>>> > >> cp
>>> > >>
>>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/git/src/galcore.ko
>>> > >>
>>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>>> > >> |   :
>>> > >> |   scripts/sign-file "sha1" "certs/signing_key.pem"
>>> > >> certs/signing_key.x509
>>> > >>
>>> /build/tmp/work/machine-dist-linux/kernel-module-imx-gpu-viv/6.4.3.p4.2-r0/image/usr/lib/modules/5.15.60-imx8mm+g343e81c0e39e/extra/galcore.ko
>>> > >> || true
>>> > >> | scripts/sign-file: error while loading shared libraries:
>>> > >> libcrypto.so.3: cannot open shared object file: No such file or
>>> directory
>>> > >> |   sh
>>> /build/tmp/work-shared/machine/kernel-source/scripts/depmod.sh
>>> > >> echo 5.15.60-imx8mm+g343e81c0e39e
>>> > >> | Warning: modules_install: missing 'System.map' file. Skipping
>>> depmod.
>>> > >> | make[2]: Leaving directory
>>> > >> '/build/tmp/work-shared/machine/kernel-build-artifacts'
>>> > >> | make[1]: Leaving directory
>>> '/build/tmp/work-shared/machine/kernel-source'
>>> > >> ```
>>> > >>
>>> > >> I noticed that there are special dependency definitions in
>>> make-mod-scripts
>>> > >>
>>> > >> ```
>>> > >> do_configure[depends] += "virtual/kernel:do_shared_workdir
>>> > >> openssl-native:do_populate_sysroot"
>>> > >> do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>>> > >> ```
>>> > >>
>>> > >> and module-base.bbclass (inherited by module.bbclass)
>>> > >>
>>> > >> ```
>>> > >> # We do the dependency this way because the output is not preserved
>>> > >> # in sstate, so we must force do_compile to run (once).
>>> > >> do_configure[depends] += "make-mod-scripts:do_compile"
>>> > >> ```
>>> > >>
>>> > >> Is there an additional dependency needed to address rm_work?
>>> > >>
>>> > >> Kind regards
>>> > >>
>>> > >> Jörg Sommer
>>> > >> --
>>> > >> Navimatix GmbH
>>> > >> Tatzendpromenade 2
>>> > >> D-07745 Jena
>>> > >> Geschäftsführer: Steffen Späthe, Jan Rommeley
>>> > >> Registergericht: Amtsgericht Jena, HRB 501480
>>> > >>
>>> > >>
>>> > >>
>>> > >
>>> > >
>>> > > --
>>> > > Best regards,
>>> > >
>>> > > José Quaresma
>>> >
>>> >
>>> >
>>> > --
>>> > - Thou shalt not follow the NULL pointer, for chaos and madness await
>>> > thee at its end
>>> > - "Use the force Harry" - Gandalf, Star Trek II
>>> >
>>> >
>>> >
>>>
>>
>>
>> --
>> Best regards,
>>
>> José Quaresma
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#105731):
>> https://lists.openembedded.org/g/openembedded-devel/message/105731
>> Mute This Topic: https://lists.openembedded.org/mt/102174355/3617156
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
>> martin.jansa@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>

-- 
Best regards,

José Quaresma

[-- Attachment #2: Type: text/html, Size: 13057 bytes --]

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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26  8:34       ` Jose Quaresma
  2023-10-26  8:47         ` Martin Jansa
@ 2023-10-26 11:16         ` Jörg Sommer
  2023-10-26 15:25           ` Bruce Ashfield
  1 sibling, 1 reply; 16+ messages in thread
From: Jörg Sommer @ 2023-10-26 11:16 UTC (permalink / raw)
  To: Jose Quaresma, Khem Raj; +Cc: Bruce Ashfield, openembedded-devel

On 26.10.23 10:34, Jose Quaresma wrote:
> 
> 
> Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> escreveu no
> dia quarta, 25/10/2023 à(s) 18:18:
> 
>     I wonder if something like below would help
> 
>     diff --git
>     a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>     <http://make-mod-scripts_1.0.bb>
>     b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>     <http://make-mod-scripts_1.0.bb>
>     index 2cff48c39c3..6133721334c 100644
>     --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>     <http://make-mod-scripts_1.0.bb>
>     +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>     <http://make-mod-scripts_1.0.bb>
>     @@ -12,7 +12,7 @@ S = "${WORKDIR}"
> 
>      do_configure[depends] += "virtual/kernel:do_shared_workdir
>     openssl-native:do_populate_sysroot"
>      do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>     -
>     +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
> 
> 
> This doesn't solve the problem because at compile time the openssl is
> already there on native sysroot

How about a patch like this:

```
diff --git i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
index 0e420a25d9..182abd0233 100644
--- i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
+++ w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -18,6 +18,10 @@ RDEPENDS:${PN}-dev = ""
 DEPENDS += "bc-native bison-native"
 DEPENDS += "gmp-native"
 
+BUILD_LDFLAGS =+ "-L /build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
+       -Wl,-rpath-link,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
+       -Wl,-rpath,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib"
+
 EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
 EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}"
 
```

Regards

Jörg Sommer
-- 
Navimatix GmbH
Tatzendpromenade 2
D-07745 Jena  
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480



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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26 11:16         ` Jörg Sommer
@ 2023-10-26 15:25           ` Bruce Ashfield
  2023-10-26 16:10             ` Khem Raj
  2023-10-30  8:40             ` Jörg Sommer
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ashfield @ 2023-10-26 15:25 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On Thu, Oct 26, 2023 at 7:16 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>
> On 26.10.23 10:34, Jose Quaresma wrote:
> >
> >
> > Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> escreveu no
> > dia quarta, 25/10/2023 à(s) 18:18:
> >
> >     I wonder if something like below would help
> >
> >     diff --git
> >     a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >     <http://make-mod-scripts_1.0.bb>
> >     b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >     <http://make-mod-scripts_1.0.bb>
> >     index 2cff48c39c3..6133721334c 100644
> >     --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >     <http://make-mod-scripts_1.0.bb>
> >     +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >     <http://make-mod-scripts_1.0.bb>
> >     @@ -12,7 +12,7 @@ S = "${WORKDIR}"
> >
> >      do_configure[depends] += "virtual/kernel:do_shared_workdir
> >     openssl-native:do_populate_sysroot"
> >      do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> >     -
> >     +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
> >
> >
> > This doesn't solve the problem because at compile time the openssl is
> > already there on native sysroot
>
> How about a patch like this:
>

I proposed something similar in the earlier threads on this topic (it
has been around for quite some time, and is in bugzilla for oe-core)/

I ran into issues with some kernel versions, but we may have moved on
far enough that it is no longer an issue.

static linking is another option, but it runs into some autobuilder
issues with distros that don't have a static libc.

Bruce

> ```
> diff --git i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> index 0e420a25d9..182abd0233 100644
> --- i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> +++ w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> @@ -18,6 +18,10 @@ RDEPENDS:${PN}-dev = ""
>  DEPENDS += "bc-native bison-native"
>  DEPENDS += "gmp-native"
>
> +BUILD_LDFLAGS =+ "-L /build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
> +       -Wl,-rpath-link,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
> +       -Wl,-rpath,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib"
> +
>  EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
>  EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}"
>
> ```
>
> Regards
>
> Jörg Sommer
> --
> Navimatix GmbH
> Tatzendpromenade 2
> D-07745 Jena
> Geschäftsführer: Steffen Späthe, Jan Rommeley
> Registergericht: Amtsgericht Jena, HRB 501480
>


-- 
- 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] 16+ messages in thread

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26 15:25           ` Bruce Ashfield
@ 2023-10-26 16:10             ` Khem Raj
  2023-10-30  8:40             ` Jörg Sommer
  1 sibling, 0 replies; 16+ messages in thread
From: Khem Raj @ 2023-10-26 16:10 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Jörg Sommer, Jose Quaresma, openembedded-devel

On Thu, Oct 26, 2023 at 8:26 AM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> On Thu, Oct 26, 2023 at 7:16 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
> >
> > On 26.10.23 10:34, Jose Quaresma wrote:
> > >
> > >
> > > Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> escreveu no
> > > dia quarta, 25/10/2023 à(s) 18:18:
> > >
> > >     I wonder if something like below would help
> > >
> > >     diff --git
> > >     a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > >     <http://make-mod-scripts_1.0.bb>
> > >     b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > >     <http://make-mod-scripts_1.0.bb>
> > >     index 2cff48c39c3..6133721334c 100644
> > >     --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > >     <http://make-mod-scripts_1.0.bb>
> > >     +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > >     <http://make-mod-scripts_1.0.bb>
> > >     @@ -12,7 +12,7 @@ S = "${WORKDIR}"
> > >
> > >      do_configure[depends] += "virtual/kernel:do_shared_workdir
> > >     openssl-native:do_populate_sysroot"
> > >      do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> > >     -
> > >     +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
> > >
> > >
> > > This doesn't solve the problem because at compile time the openssl is
> > > already there on native sysroot
> >
> > How about a patch like this:
> >
>
> I proposed something similar in the earlier threads on this topic (it
> has been around for quite some time, and is in bugzilla for oe-core)/
>
> I ran into issues with some kernel versions, but we may have moved on
> far enough that it is no longer an issue.
>
> static linking is another option, but it runs into some autobuilder
> issues with distros that don't have a static libc.

right, I do like the idea of static linking sadly it does add a host
dependency of this nature.
unless you add a dependency on native glibc but it gets heavier on
dependency tree

>
> Bruce
>
> > ```
> > diff --git i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > index 0e420a25d9..182abd0233 100644
> > --- i/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > +++ w/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> > @@ -18,6 +18,10 @@ RDEPENDS:${PN}-dev = ""
> >  DEPENDS += "bc-native bison-native"
> >  DEPENDS += "gmp-native"
> >
> > +BUILD_LDFLAGS =+ "-L /build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
> > +       -Wl,-rpath-link,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib \
> > +       -Wl,-rpath,/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib"
> > +
> >  EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
> >  EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}"
> >
> > ```
> >
> > Regards
> >
> > Jörg Sommer
> > --
> > Navimatix GmbH
> > Tatzendpromenade 2
> > D-07745 Jena
> > Geschäftsführer: Steffen Späthe, Jan Rommeley
> > Registergericht: Amtsgericht Jena, HRB 501480
> >
>
>
> --
> - 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] 16+ messages in thread

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-26 15:25           ` Bruce Ashfield
  2023-10-26 16:10             ` Khem Raj
@ 2023-10-30  8:40             ` Jörg Sommer
  2023-10-30 12:29               ` Bruce Ashfield
  1 sibling, 1 reply; 16+ messages in thread
From: Jörg Sommer @ 2023-10-30  8:40 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On 26.10.23 17:25, Bruce Ashfield wrote:
> On Thu, Oct 26, 2023 at 7:16 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>>
>> On 26.10.23 10:34, Jose Quaresma wrote:
>>>
>>>
>>> Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> escreveu no
>>> dia quarta, 25/10/2023 à(s) 18:18:
>>>
>>>     I wonder if something like below would help
>>>
>>>     diff --git
>>>     a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>>     <http://make-mod-scripts_1.0.bb>
>>>     b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>>     <http://make-mod-scripts_1.0.bb>
>>>     index 2cff48c39c3..6133721334c 100644
>>>     --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>>     <http://make-mod-scripts_1.0.bb>
>>>     +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
>>>     <http://make-mod-scripts_1.0.bb>
>>>     @@ -12,7 +12,7 @@ S = "${WORKDIR}"
>>>
>>>      do_configure[depends] += "virtual/kernel:do_shared_workdir
>>>     openssl-native:do_populate_sysroot"
>>>      do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
>>>     -
>>>     +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
>>>
>>>
>>> This doesn't solve the problem because at compile time the openssl is
>>> already there on native sysroot
>>
>> How about a patch like this:
>>
> 
> I proposed something similar in the earlier threads on this topic (it
> has been around for quite some time, and is in bugzilla for oe-core)/

Can you give me a link to the bugzilla entry? I didn't found it.

> I ran into issues with some kernel versions, but we may have moved on
> far enough that it is no longer an issue.

Do you remember what kind of issues these were? Possibly I can check if
they still exist.

Kind regards

Jörg Sommer
-- 
Navimatix GmbH
Tatzendpromenade 2
D-07745 Jena
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480



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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-30  8:40             ` Jörg Sommer
@ 2023-10-30 12:29               ` Bruce Ashfield
  2023-10-30 13:24                 ` Jörg Sommer
       [not found]                 ` <1792E56CCC9D9F4D.20486@lists.openembedded.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Bruce Ashfield @ 2023-10-30 12:29 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On Mon, Oct 30, 2023 at 4:40 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>
> On 26.10.23 17:25, Bruce Ashfield wrote:
> > On Thu, Oct 26, 2023 at 7:16 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
> >>
> >> On 26.10.23 10:34, Jose Quaresma wrote:
> >>>
> >>>
> >>> Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> escreveu no
> >>> dia quarta, 25/10/2023 à(s) 18:18:
> >>>
> >>>     I wonder if something like below would help
> >>>
> >>>     diff --git
> >>>     a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >>>     <http://make-mod-scripts_1.0.bb>
> >>>     b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >>>     <http://make-mod-scripts_1.0.bb>
> >>>     index 2cff48c39c3..6133721334c 100644
> >>>     --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >>>     <http://make-mod-scripts_1.0.bb>
> >>>     +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> >>>     <http://make-mod-scripts_1.0.bb>
> >>>     @@ -12,7 +12,7 @@ S = "${WORKDIR}"
> >>>
> >>>      do_configure[depends] += "virtual/kernel:do_shared_workdir
> >>>     openssl-native:do_populate_sysroot"
> >>>      do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
> >>>     -
> >>>     +do_populate_sysroot[depends] += "openssl-native:do_populate_sysroot"
> >>>
> >>>
> >>> This doesn't solve the problem because at compile time the openssl is
> >>> already there on native sysroot
> >>
> >> How about a patch like this:
> >>
> >
> > I proposed something similar in the earlier threads on this topic (it
> > has been around for quite some time, and is in bugzilla for oe-core)/
>
> Can you give me a link to the bugzilla entry? I didn't found it.

It seems like I've managed to archive, or otherwise misfile the old entry,
I also may have been mixing up my other long running scripts bugs.

Since I can't find the bug (or imagined it), the main reference on the
previous efforts are the oe-core threads that Jose pointed out.

>
> > I ran into issues with some kernel versions, but we may have moved on
> > far enough that it is no longer an issue.
>
> Do you remember what kind of issues these were? Possibly I can check if
> they still exist.

It was kernels older than 5.10 failing to take the r-path changes and
hence failing when doing the signing step.

But testing against the oldest reference kernel in any branch that
might be a target for a change like this should be enough (testing
via: normal build, a SDK build, and signing).

Bruce

>
> Kind regards
>
> Jörg Sommer
> --
> Navimatix GmbH
> Tatzendpromenade 2
> D-07745 Jena
> Geschäftsführer: Steffen Späthe, Jan Rommeley
> Registergericht: Amtsgericht Jena, HRB 501480
>


-- 
- 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] 16+ messages in thread

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-10-30 12:29               ` Bruce Ashfield
@ 2023-10-30 13:24                 ` Jörg Sommer
       [not found]                 ` <1792E56CCC9D9F4D.20486@lists.openembedded.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Jörg Sommer @ 2023-10-30 13:24 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On 30.10.23 13:29, Bruce Ashfield wrote:
> On Mon, Oct 30, 2023 at 4:40 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>> On 26.10.23 17:25, Bruce Ashfield wrote:

>>> I ran into issues with some kernel versions, but we may have moved on
>>> far enough that it is no longer an issue.
>>
>> Do you remember what kind of issues these were? Possibly I can check if
>> they still exist.
> 
> It was kernels older than 5.10 failing to take the r-path changes and
> hence failing when doing the signing step.

This could be solved by setting LD_LIBRARY_PATH. Would this be okay?

```
diff --git i/meta/classes/module.bbclass w/meta/classes/module.bbclass
index a09ec3ed1e..38e1c95216 100644
--- i/meta/classes/module.bbclass
+++ w/meta/classes/module.bbclass
@@ -51,6 +51,7 @@ module_do_install() {
                   INSTALL_FW_PATH="${D}${nonarch_base_libdir}/firmware" \
                   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
                   O=${STAGING_KERNEL_BUILDDIR} \
+                  LD_LIBRARY_PATH="/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
                   ${MODULES_INSTALL_TARGET}
 
        if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
```


Kind regards

Jörg Sommer
-- 
Navimatix GmbH
Tatzendpromenade 2
D-07745 Jena  
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480



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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
       [not found]                 ` <1792E56CCC9D9F4D.20486@lists.openembedded.org>
@ 2023-11-03  7:49                   ` Jörg Sommer
  2023-11-03 13:28                     ` Bruce Ashfield
  0 siblings, 1 reply; 16+ messages in thread
From: Jörg Sommer @ 2023-11-03  7:49 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On 30.10.23 14:24, Jörg Sommer via lists.openembedded.org wrote:
> On 30.10.23 13:29, Bruce Ashfield wrote:
>> On Mon, Oct 30, 2023 at 4:40 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>>> On 26.10.23 17:25, Bruce Ashfield wrote:
> 
>>>> I ran into issues with some kernel versions, but we may have moved on
>>>> far enough that it is no longer an issue.
>>>
>>> Do you remember what kind of issues these were? Possibly I can check if
>>> they still exist.
>>
>> It was kernels older than 5.10 failing to take the r-path changes and
>> hence failing when doing the signing step.
> 
> This could be solved by setting LD_LIBRARY_PATH. Would this be okay?
> 
> ```
> diff --git i/meta/classes/module.bbclass w/meta/classes/module.bbclass
> index a09ec3ed1e..38e1c95216 100644
> --- i/meta/classes/module.bbclass
> +++ w/meta/classes/module.bbclass
> @@ -51,6 +51,7 @@ module_do_install() {
>                    INSTALL_FW_PATH="${D}${nonarch_base_libdir}/firmware" \
>                    CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
>                    O=${STAGING_KERNEL_BUILDDIR} \
> +                  LD_LIBRARY_PATH="/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
>                    ${MODULES_INSTALL_TARGET}
>  
>         if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
> ```

Hi Bruce,

I would like to here your opinion to this issue, because you've provided
the most to the discussion. I would like to submit a patch to fix
problem; either the BUILD_LDFLAGS one or the LD_LIBRARY_PATH.

Kind regards

Jörg Sommer
-- 
Navimatix GmbH
Tatzendpromenade 2
D-07745 Jena
Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480


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

* Re: [oe] openssl-native.rm_work runs before kernel-module.install -> no signature
  2023-11-03  7:49                   ` Jörg Sommer
@ 2023-11-03 13:28                     ` Bruce Ashfield
  0 siblings, 0 replies; 16+ messages in thread
From: Bruce Ashfield @ 2023-11-03 13:28 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: Jose Quaresma, Khem Raj, openembedded-devel

On Fri, Nov 3, 2023 at 3:49 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
>
> On 30.10.23 14:24, Jörg Sommer via lists.openembedded.org wrote:
> > On 30.10.23 13:29, Bruce Ashfield wrote:
> >> On Mon, Oct 30, 2023 at 4:40 AM Jörg Sommer <joerg.sommer@navimatix.de> wrote:
> >>> On 26.10.23 17:25, Bruce Ashfield wrote:
> >
> >>>> I ran into issues with some kernel versions, but we may have moved on
> >>>> far enough that it is no longer an issue.
> >>>
> >>> Do you remember what kind of issues these were? Possibly I can check if
> >>> they still exist.
> >>
> >> It was kernels older than 5.10 failing to take the r-path changes and
> >> hence failing when doing the signing step.
> >
> > This could be solved by setting LD_LIBRARY_PATH. Would this be okay?
> >
> > ```
> > diff --git i/meta/classes/module.bbclass w/meta/classes/module.bbclass
> > index a09ec3ed1e..38e1c95216 100644
> > --- i/meta/classes/module.bbclass
> > +++ w/meta/classes/module.bbclass
> > @@ -51,6 +51,7 @@ module_do_install() {
> >                    INSTALL_FW_PATH="${D}${nonarch_base_libdir}/firmware" \
> >                    CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
> >                    O=${STAGING_KERNEL_BUILDDIR} \
> > +                  LD_LIBRARY_PATH="/build/tmp/sysroots-components/x86_64/openssl-native/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
> >                    ${MODULES_INSTALL_TARGET}
> >
> >         if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
> > ```
>
> Hi Bruce,
>
> I would like to here your opinion to this issue, because you've provided
> the most to the discussion. I would like to submit a patch to fix
> problem; either the BUILD_LDFLAGS one or the LD_LIBRARY_PATH.
>

Thanks for the ping! gmail annoyingly doesn't show me anything
different when I'm
actually on the to: of an email .. I need to enhance my filters to at
least star the
email, so I'll notice them faster.

But I digress.

The proposal is going in the right direction.

The problem is that we really don't want any references into the
recipe sysroots,
whether they survive rm_work or not. Since we are installing the output of the
mods to the shared location, that is where all their references and requirements
are supposed to be contained.

The idea with something using library paths, etc, was that we should arrange
for the dependencies to also be installed into the STAGING_KERNEL_BUILDDIR
structure and adjust the make_mod_scripts appropriately to find them there
(either at build or dynamically at runtime).

There's also an existing libelf (and zlib) dependency that popped out when I
was working through the static linking issues. But that is because I
had to statically
link everything built by the scripts, not just the sign-tool (and so
far, those other
utilities have escaped causing us problems, but are probably just waiting to
appear :).

If we were to adjust the LD_LIBRARY_PATH, the values should be programmatically
pulled out via pkg-config versus something quite as explicit as in your work in
progress patch (alternatively IIRC there are utilities that adjust rpath and
dynamic linking in use in other parts of the build, we could possibly leverage
them).

Bruce

> Kind regards
>
> Jörg Sommer
> --
> Navimatix GmbH
> Tatzendpromenade 2
> D-07745 Jena
> Geschäftsführer: Steffen Späthe, Jan Rommeley
> Registergericht: Amtsgericht Jena, HRB 501480



-- 
- 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] 16+ messages in thread

end of thread, other threads:[~2023-11-03 13:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25  8:57 openssl-native.rm_work runs before kernel-module.install -> no signature Jörg Sommer
2023-10-25 11:40 ` [oe] " Jose Quaresma
2023-10-25 14:45   ` Bruce Ashfield
2023-10-25 17:18     ` Khem Raj
2023-10-26  8:34       ` Jose Quaresma
2023-10-26  8:47         ` Martin Jansa
2023-10-26  9:13           ` Jose Quaresma
2023-10-26 11:16         ` Jörg Sommer
2023-10-26 15:25           ` Bruce Ashfield
2023-10-26 16:10             ` Khem Raj
2023-10-30  8:40             ` Jörg Sommer
2023-10-30 12:29               ` Bruce Ashfield
2023-10-30 13:24                 ` Jörg Sommer
     [not found]                 ` <1792E56CCC9D9F4D.20486@lists.openembedded.org>
2023-11-03  7:49                   ` Jörg Sommer
2023-11-03 13:28                     ` Bruce Ashfield
     [not found] ` <179156E1429869C6.11247@lists.openembedded.org>
2023-10-25 12:01   ` Jose Quaresma

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.