SolidRun / lx2160a_build

Scripts to build basic images for LX2160A COM express type 7 modules
58 stars 47 forks source link

How to get Kernel Headers into the image #84

Open seidlplus opened 9 months ago

seidlplus commented 9 months ago

Hello there,

for being able to build External Kernel Modules for installing a certain Driver (OFED for Mellanox), the Kernel Headers (linux-headers) are necessary. /lib/modules/'uname -r'/build/ and /usr/src/linux-headers-'uname -r'/ are missing in the image built from the docker Note: I found https://kernelnewbies.org/KernelHeaders and https://docs.kernel.org/kbuild/headers_install.html helpful for background knowledge

It would be great, if there would be a way to get the Kernel Headers installed during the image build. Unfortunately i couldn't figure out how to edit runme.sh to get this done. Could someone help me here or give me a hint?

As a Fallback, is there a way to correctly install (with Symlinks) the Kernel Headers after the image build, on the running Linux? Note: After the build of the image via the Docker, the folder build/linux/ is provided, which seems to contain the Kernel Headers. I tried several things with it, but ran into several problems.

Thank you for providing this build environment which provides good running images! And thanks for your attention on my question.

kotocom commented 9 months ago

FYI: you can copycat the solution from line 570+ https://github.com/SolidRun/lx2160a_build/pull/79/commits/ef55ac6b030eff59c7455ad40406746317436b8e

Although, as reported, the system won't respect the headers due to version misalignment.