ERROR: Kernel configuration is invalid
Hi All ,
I am trying to build an out-of-tree hello-world module using the RPI4 setup & compile an hello-world kernel module
A) Steps followed :
1) Create an basic hello-world-module.c & Makefile in any known location ( say custom layer )
2) $ bitbake -c devshell virtual/kernel
$ make M=<Location of module created in step 1 above> modules
Compilation of kernel-modules with this setup shows below error:/home/ashish/yocto-default/build-xenimage/tmp/work-shared/raspberrypi4-64/kernel-source/Makefile:609: include/config/auto.conf: No such file or directory
ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it.
But , the config is preset at below location & i can do $ bitbake -c menuconfig virtual/kernel home/ashish/yocto-default/build-xenimage/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.51+gitAUTOINC+aafb8f095e_machine-r0/linux-raspberrypi4_64-standard-build/.config
B) Please find that just to ensure if the procedure to compile an external modules is correct , i tried setting MACHINE ?= "qemuarm64" , and reported same steps .
I was able to compile the kernel module properly & ran on qemu to confirm the module is proper.
C) I was under expectation that the config file would be proper as we are able to generate minimal image
Any pointers or suggestion as to why the i am getting this error even though the .config is preset
--
Thanks ,
Ashish .
Hi Ashish,
Quoted 6 lines · Ashish
Hi All ,
I am trying to build an out-of-tree hello-world module using the RPI4 setup & compile an hello-world kernel module
A) Steps followed :
1) Create an basichello-world-module.c&Makefilein any known location ( say custom layer )
First, make a recipe for those.
Quoted 3 lines
2) $ bitbake -c devshell virtual/kernel
$ make M=<Location of module created in step 1 above> modules
I'd have used devtool for doing that and not devshell but I've almost never used devshell so I might be biased :)
devtool modify hello-world-module
Then, go into the devtool workspace and modify step by step until you've something that compiles with devtool build hello-world-module.
https://www.youtube.com/watch?v=zYyE-xah7jg for a tutorial on the minimal out of tree kernel driver compilation/recipe.
Let us know if you hit issues after this :)
Cheers,
Quentin
Quoted 11 lines · On Tuesday, August 4, 2020 4:12:49 A.M. EDT Quentin Schulz wrote:
Hi Ashish,
Quoted 8 lines · Ashish
Hi All ,
I am trying to build an out-of-tree hello-world module using the RPI4 setup & compile an hello-world kernel module
A) Steps followed :
1) Create an basichello-world-module.c&Makefilein any known location ( say custom layer )
Quoted 7 lines
First, make a recipe for those.
Quoted 2 lines
2) $ bitbake -c devshell virtual/kernel
$ make M=<Location of module created in step 1 above> modulesI'd have used devtool for doing that and not devshell but I've almost never used devshell so I might be biased :)
Devshell doesn't do enough to setup the environment. I was able to reproduce Ashish's issue with devshell. Ashish if you do want to use devshell you need to build more before you enter devshell, ie.
bitbake -c do_compile_kernelmodules virtual/kernel
Then you can do the module build, as you had it, entering the devshell and running:
make -C . M=.../poky/meta-skeleton/recipes-kernel/hello-mod/files modules
All was happy at this point.
MarkA
Quoted 13 lines
devtool modify hello-world-module
Then, go into the devtool workspace and modify step by step until you've something that compiles with devtool build hello-world-module.
https://www.youtube.com/watch?v=zYyE-xah7jg for a tutorial on the minimal out of tree kernel driver compilation/recipe.
Let us know if you hit issues after this :)
Cheers,
Quentin
Hi Quentin / Fred / MarkA ,
Thanks for pointers , will try them & update accordingly. --
Thanks ,
Ashish .
Quoted 10 lines · Ashish
2) $ bitbake -c devshell virtual/kernel
$ make M=<Location of module created in step 1 above> modulesCompilation of kernel-modules with this setup shows below error:
*/home/ashish/yocto-default/build-xenimage/tmp/work-shared/raspberrypi4-64/kernel-source/Makefile:609:
include/config/auto.conf: No such file or directory** ERROR: Kernel configuration is invalid.*
*include/generated/autoconf.horinclude/config/auto.confare missing.*
* Run 'make oldconfig && make prepare' on kernel src to fix it.
*
Quoted 4 lines
But , the config is preset at below location & i can do $ bitbake -c menuconfig virtual/kernel
home/ashish/yocto-default/build-xenimage/tmp/work/raspberrypi4_64-poky-linux/linux-raspberrypi/1_5.4.51+gitAUTOINC+aafb8f095e_machine-r0/linux-raspberrypi4_64-standard-build/.config
I've seen the same error before performing similar steps. Try running the following command. Then when building the kernel module the make-mod-scripts will run again and building external kernel modules should start working again.
$ bitbake make-mod-scripts -c clean
--
Fred