I recently compiled a kernel by myself after the instructions from the kernel building guide. I also configured the kernel with some custom flags. I turned on device drivers/sound card support/also/debug options.
After that I installed the modules copied the zImage and the device trees (plus overlays) and everything booted up.
Now comes my problem: I need to compile some .Ko modules to run a hardware. That's why I installed the same version kernel headers. After the compilation I get an error with the compiled modules.
"Disagrees with version of ...."
"Can't find symbol ... "
After some research I found out it seems that I don't even need the same numerical version but also the same configuration. Since the kernel has other flags than the vanilla headers.
First I tried to just edit the config and then compile but it didn't helped. After that I packed the header folder in a tar from the build machine and extracted it on the pi. Because I don't want to compile it on the slow pi

What am I missing here? Thanks a lot for your help!