Closed larry-xmos closed 6 years ago
It might be that after update and upgrade the raspberrypi-kernel-headers package does indeed match running kernel. If that's the case, it's only the instructions that need to change requiring an update and upgrade be done first (or have top level script do it).
Just tried this on a fresh system and it indeed seems that the raspberrypi-kernel-headers package can be ahead of an up to date system
The --reinstall
option to apt-get seemed to have brought my running kernel up to date with the headers package, so have changed our setup script to do that in 80c81c4
https://raspberrypi.stackexchange.com/questions/63879/installed-kernel-headers-and-uname-r-differ
The setup script uses
sudo apt-get install raspberrypi-kernel-headers
to install headers for building the I2C and I2S kernel modules.These may not match running kernel version. The version you get is the most recent depending on state of APT, whether you've done an APT update recently, and so on.
Getting matching headers is straightforward in Ubuntu or CentOS, but it seems that Raspberry Foundation find it too much trouble to package their kernel properly. What people seem to be doing is getting the full kernel source, building it and using a Raspberry Foundation provided makefile to export headers into
/lib/modules
.See comment dated November 2013 from dom at https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=57401.
There are a number of scripts automating this procedure. One of them—https://github.com/notro/rpi-source—does exactly what I described above.
Other references: