Skip to content

Instantly share code, notes, and snippets.

@hongkongkiwi
Created February 23, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongkongkiwi/9d8691dae803f254e6591b9b8a29616b to your computer and use it in GitHub Desktop.
Save hongkongkiwi/9d8691dae803f254e6591b9b8a29616b to your computer and use it in GitHub Desktop.
Build Raspberry Pi Kernel
######################
### Kernel headers ###
######################
#To build this module from source, I did the following on my RPI2.
#Install build tools:
sudo -s
apt install build-essential bc git wget
#Get kernel source code
cd /usr/src
git clone --depth 1 https://github.com/raspberrypi/linux.git
ln -s linux $(uname -r)
ln -s /usr/src/linux /lib/modules/$(uname -r)/build
#Prepare linux build headers
cd linux
wget -O Module.symvers https://raw.githubusercontent.com/raspberrypi/firmware/master/extra/Module7.symvers
KERNEL=kernel7 # or the right one depending on your Raspberry Pi model.
make bcm2709_defconfig # or the right one depending on your Raspberry model.
make prepare
make modules_prepare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment