So, as the standard debian kernel packaging system isn't used (the kernel and module are all in the raspberrypi-bootloader package), and the headers aren't distributed, you will need to download the source tree from the github at https://github.com/raspberrypi/linux/. You won't have to recompile it however.
Here a quick guide. I'm assuming that you already have build-essential/compiler/everything else you need in place anyhow, and just need the kernel specific headers and symbols.
Download the kernel source and unpack it with:
Then we'll grab the config from the raspberry pi's running kernel, and get the source tree to prepare itself for module builds:
What you will also need to build modules that will actually go into the new kernel is Modules.symvers. Luckily, someone has nicely put it in the raspberrypi/firmware github along with the pre-compiled kernel and firmware binaries, so we can just download the latest one from there:
Then just make symlinks available in /lib/modules/[kernelversion]/ for the stuff you're compiling. Might as well put a symlink in for /usr/src/linux etc as well
Apart from the time downloading, the rest should take about 10 minutes or so hopefully, depending on how fast the storage you've got available is. This will also take up about 630MB of space under /usr/src until you clean it up
Hope this helps
Here a quick guide. I'm assuming that you already have build-essential/compiler/everything else you need in place anyhow, and just need the kernel specific headers and symbols.
Download the kernel source and unpack it with:
- CODE: SELECT ALL
sudo bash
cd /usr/src
git clone --depth 1 git://github.com/raspberrypi/linux.git
Then we'll grab the config from the raspberry pi's running kernel, and get the source tree to prepare itself for module builds:
- CODE: SELECT ALL
cd linux
zcat /proc/config.gz > .config
make oldconfig
make modules_prepare
What you will also need to build modules that will actually go into the new kernel is Modules.symvers. Luckily, someone has nicely put it in the raspberrypi/firmware github along with the pre-compiled kernel and firmware binaries, so we can just download the latest one from there:
- CODE: SELECT ALL
wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
Then just make symlinks available in /lib/modules/[kernelversion]/ for the stuff you're compiling. Might as well put a symlink in for /usr/src/linux etc as well
- CODE: SELECT ALL
KSRC=`pwd`
pushd /lib/modules/`uname -r`
ln -s ${KSRC} source
ln -s ${KSRC} build
popd
pushd /usr/src
ln -s ${KSRC} linux-`uname -r`
ln -s ${KSRC} linux
popd
Apart from the time downloading, the rest should take about 10 minutes or so hopefully, depending on how fast the storage you've got available is. This will also take up about 630MB of space under /usr/src until you clean it up
Hope this helps
No comments:
Post a Comment