3

I started with Raspbian 3.18.5 (Wheezy?) and did an rpi update and ended up with 4.1.10 (Jessie?).

When I did a sudo apt-get install linux-headers the following packages were available:

linux-headers-rpi 3.2+46+rpi4
linux-headers-3.6-trunk-rpi 3.6.9-1~experimental.1+rpi7
linux-headers-3.2.0-4-rpi 3.2.51-1+rpi1
linux-headers-3.10-3-rpi 3.10.11-1+rpi7

and it said I needed to download a specific one (I downloaded 3.10).

None of these match my old 3.18, let alone the 4.1.

I went to the Debian page and they had an old build of 4.1.11 and the most recent stable build is 4.2.4 with an even newer version available.

Since my 4.1.10 was built by someone, they obviously had the headers to match. Where can I find those headers so I can build a kernel module ?

I know I have several specifics in this question, but in general where does Raspbian keep these header files so the apt-get can pull them down ?

Could I just take the Debian 4.1.11 header files and compile against those ?

1

2 Answers 2

3

I started with Raspian 3.18.5 (Wheezy?) and did an apt-get update and ended up with 4.1.10 (Jessie?).

I don't think you can end up going from wheezy to jessie just with apt-get update. They will both be on 4.1.x kernels by now.

Check w/ cat /etc/issue. If it says Raspbian 7 you are still using wheezy.

You probably should do the upgrade at some point; although you don't have to, eventually the updates on wheezy will stop.

When I did a sudo apt-get install linux-headers the following packages were available:

There is are some issues with the way the Pi kernel is integrated into Raspbian packaging. Even on stretch (the testing branch after jessie), I don't see a headers package > 3.18.0-4.

Could I just take the Debian 4.1.11 header files and compile against those?

I doubt it.

Since my 4.1.10 was built by someone, they obviously had the headers to match. Where can I find those headers so I can build a kernel module?

The whole tree is on the Foundation's github site (see the "linux" directory there), all previous versions are branched there.

Unfortunately the latest (default) is 4.1.11 if you look at the Makefile .If you know how to use git, there are branches for the major version (this are also browsable via the web interface), but to find a minor version you have to browse commits.

However, if you want one to match a kernel installed from Raspbian, there's an easier way; see #2 here.

1
  • Thank you. I'm very new to both Raspberry and doing kernel stuff so the help is much appreciated.
    – CramerTV
    Commented Oct 24, 2015 at 14:43
5

See answer here https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=154749

You can try sudo apt-get install raspberrypi-kernel-headers if you're running raspbian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.