Problem compiling kernel module for newer BalenaOS

I have for a while been compiling a kernel module for my BalenaOS devices.
I download kernel headers from the Balena s3 bucket.

It compiles for all BalenaOS v2.x.x, but breaks for v3.x.x and onwards.
I notice this line in the change log: “use kernel-devsrc to provide kernel headers”

I suspect this means I need to compile in a different way, but I have not been able to find out what the change is and/or what to do about it.

The exact error message I get with the newer kernel headers is this (though that might not tell you much):
make[4]: *** No rule to make target ‘/usr/src/app/peak-linux-driver-8.15.2/driver/src/pcan_main.o’, needed by ‘/usr/src/app/peak-linux-driver-8.15.2/driver/pcan.o’.

Hey @krix , welcome back to the forums!

I think this blog post should answer all of your questions, and specifically mentions what changes are needed for v3.x:

Let us know if you are still having trouble after following the advice in the blog!

1 Like

Thank you. The trick was the need for make modules_prepare.