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 ?

rav_kr
  • 446
  • 5
  • 12
CramerTV
  • 133
  • 1
  • 1
  • 7
  • 3
    Possible duplicate of [RPI2 Kernel module compilation (kernel 3.18.11+ vs 3.18.11-v7+)](http://raspberrypi.stackexchange.com/questions/37010/rpi2-kernel-module-compilation-kernel-3-18-11-vs-3-18-11-v7) – mpromonet Oct 24 '15 at 15:54

2 Answers2

4

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.

Ghanima
  • 15,578
  • 15
  • 58
  • 113
Dip
  • 101
  • 1
  • 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.

goldilocks
  • 56,430
  • 17
  • 109
  • 217