Search code examples
linux-kernelembedded-linuxbeagleboneblackbeagleboard

How to install linux Headers on Beaglebone Black


I'm currently trying to build a LKM (Linux Kernel Module) for a Beaglebone Black Board under Debian version 7 (3.8.13-bone47). I have problems whenever I try to download linux headers... Here is what the console shows when I run the command sudo apt-get install linux-headers-$(uname -r):

root@beaglebone:/# sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-3.8.13-bone47
E: Couldn't find any package by regex 'linux-headers-3.8.13-bone47'

I already tried to update and upgrade packages : this does'nt solve the problem. If there is a way to install it offline, where can I find the Archive for the current version?

Thanks in advance for your answers !


Solution

  • Compiling on the target is never the correct way to work. You can clone the Beaglebone kernel from here. Listing the tags for that kernel source, I do not see bone47 version. Unless there is a specific reason you are sticking to an older release, I recommend to migrate to a new image which will have a new kernel. You can checkout the required branch from that git repository.

    You can then cross compile your kernel module against the kernel source on PC after having build it by specifying the ARCH, CROSS_COMPILE and KDIR flags on the command line.