[OE-core] [PATCH] kernel-devsrc: copy mmiowb.h and modpost from ${B} of kernel

Bruce Ashfield bruce.ashfield at gmail.com
Wed Sep 4 03:55:52 UTC 2019


On Tue, Sep 3, 2019 at 9:43 PM Hongzhi.Song <hongzhi.song at windriver.com> wrote:
>
> There are two errors when compile an out of tree kernel module
> using sdk:
>

This is not universally true. Can you expand on what kernel version
and architectures you are building ? I'm able to build kernel modules
across all the arches I'm currently testing, so I'd like to capture
your exact config in the long log. Neither is the autobuilder showing
any errors.

> 1. "In file included from ./include/linux/seqlock.h:36:0,
>                  from ./include/linux/time.h:6,
>                  from ./include/linux/stat.h:19,
>                  from ./include/linux/module.h:10,
>                  from kernel-module/char.c:1:
> ./include/linux/spinlock.h:60:10: fatal error: asm/mmiowb.h: No such
> file or directory"
>
> mmiowb.h is generated to ${B}/arch/${ARCH}/include/generated/asm/.
>
> And there is only generated/ under ${B}/arch/${ARCH}/include/,
> so I copy whole ${B}/arch/${ARCH}/include/ to $kerneldir/build/
> in case of other files under generated/ is needed in the future.
>
> 2. "/bin/sh: scripts/mod/modpost: No such file or directory"
>
> Copy above files or directory to $kerneldir/build/ fix the errors.
>
> Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
> ---
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 3900489..feff9f1 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -80,6 +80,12 @@ do_install() {
>
>         cp .config $kerneldir/build
>
> +       if [ -d arch/${ARCH}/include ]; then
> +           cp -a --parents arch/${ARCH}/include $kerneldir/build/
> +       fi

Just copy the files you need, not the entire directory.

> +
> +       cp --parents scripts/mod/modpost $kerneldir/build/

We shouldn't be copying binaries or scripts. They are regenerated on target.

Bruce

> +
>         # This scripts copy blow up QA, so for now, we require a more
>         # complex 'make scripts' to restore these, versus copying them
>         # here. Left as a reference to indicate that we know the scripts must
> --
> 2.8.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


More information about the Openembedded-core mailing list