I would like to cross-build some in-tree modules (
gigaset) that are included in the kernel source but not in the standard Raspbian kernel.
My toolchain is using the tools from https://github.com/raspberrypi/tools and the source from https://github.com/raspberrypi/linux. It works for building an image and all modules. But the process takes a long time.
Therefore, I am looking for a way to only build the required modules. I got to the point where the resulting modules can be loaded, but one of them (
kernelcapi) still raises a
no symbol version for module_layout.
Here is what I do: After identifying the firmware hash and subsequently the kernel hash, I checkout the source for the target kernel version, clean up (
mrproper), retrieve the symbol table (e.g.
Module7.symvers), rename it if necessary, install the configuration (e.g.
bcm2709_defconfig), and run a configuration script that uses
scripts/config to set the options for my target modules (using
--module). At that point, I can make
Now, trying to save time, I disable all modules (
sed -i 's/=m/=n/' .config) in the regular configuration before running my configuration script and then make
modules. I don't like the use of sed to disable the modules, but I don't know how else to do it.
In my first attempt to build just the required modules, I used
M=<dir> to identify them. Due to interdependencies between the modules, I had to copy
Module.symvers from one
<dir> to the next. Unfortunately, the resulting modules were not marked as in-tree and thus tainted the kernel.