[OE-core] make-mod-scripts question

Bruce Ashfield bruce.ashfield at gmail.com
Thu Sep 5 15:42:25 UTC 2019


On Thu, Sep 5, 2019 at 10:43 AM Nicolas Dechesne
<nicolas.dechesne at linaro.org> wrote:
>
> hi,
>
> I was looking into a build issue today, related to signing an external
> kernel module. My build failed when calling the kernel utility
> sign-file, the error was that libcrypto.so was not found.
>
> Looking a bit more into that, I realized that make-mod-scripts will
> built some kernel utilities, including scripts/sign-file which link
> against libcrypto, however we 'copy' sign-file into
> STAGING_KERNEL_BUILDDIR.

Indeed, the build and redirected output dir will get the binaries, but
not the libraries. Either static linking of a smarter install of the
binaries would be a good idea.

>
> Later on, when my own recipe uses sign-file from
> STAGING_KERNEL_BUILDDIR, it still requires the libcrypto.so file which
> is in the make-mod-scripts per recipe sysroot. So basically my recipe
> needs a binary from STAGING_KERNEL_BUILDDIR and a shared library from
> another recipe sysroot. That looks wrong to me.
>
> My problem is fixed by adding a dependency on make-mod-scripts, it
> still feels wrong to reply on another recipe sysroot , doesn't it go
> against the whole idea of per recipe sysroot?

Agreed.

I'm wondering make-mod-scripts should both create a package and
install into the staged kernel build dir.

That way if you had a dependency on make-mod-scripts, you'd use both
the binary and the library from the recipe sysroot, but we'd also get
that shared copy for the needs in the shared kernel build directory.
Obviously the shared kernel build artifacts are a special case, and
I'm not even sure if what I'm thinking is even possible .. or is worse
than the symptom you are describing.

Just thinking out loud. Hopefully someone with more knowledge on the
packaging/internal/sstate internals will see this and have more
details.

Bruce

>
> Here is the sign-file in the kernel shared workdir:
>
> $ find tmp-glibc -name sign-file
> tmp-glibc/work-shared/open-q-212a-homehub/kernel-build-artifacts/scripts/sign-file
>
> And here we can see the dependency against make-mod-scripts sysroot:
> $ ldd tmp-glibc/work-shared/open-q-212a-homehub/kernel-build-artifacts/scripts/sign-file
>         linux-vdso.so.1 =>  (0x00007fff8299d000)
>         libcrypto.so.1.1 =>
> /local/mnt2/workspace2/ndec/le.um.3.4.1/build-wlan/tmp-glibc/work/open_q_212a_homehub-oe-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/usr/lib/libcrypto.so.1.1
> (0x00007fcb2247d000)
>         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcb220b3000)
>         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcb21eaf000)
>         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007fcb21c92000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007fcb2293c000)
>
> or like that:
> $ strings tmp-glibc/work-shared/open-q-212a-homehub/kernel-build-artifacts/scripts/sign-file
> | grep tmp-glib
> /local/mnt2/workspace2/ndec/le.um.3.4.1/build-wlan/tmp-glibc/work/open_q_212a_homehub-oe-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/usr/lib:/local/mnt2/workspace2/ndec/le.um.3.4.1/build-wlan/tmp-glibc/work/open_q_212a_homehub-oe-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/lib
>
> cheers
> nico



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


More information about the Openembedded-core mailing list