These instructions are tested on a clean install of debian straight from the Raspberry Pi website (I used version debian6-19-04-2012.zip), but you do need more than the default partition size, so resize the partition first (there's a useful guide here until I get around to writing one!).
We already have the build-essential package provided with the Pi which takes care of most of the compilation, but we need git to get the repository, libncurses5-dev to run the configuration menu and the command bc for the kernel build (not in build-essential).
sudo apt-get install git libncurses5-dev bc
Download the kernel sources from the Raspberry Pi source control repository, then link them to the kernel directory - I use a symlink here as means I can store the files on a larger filesystem (I have a USB attached drive)
git clone --depth 1 https://github.com/raspberrypi/linux.git
sudo ln -s `pwd`/linux /lib/modules/3.1.9+/build
Then, we get ready to do the kernel build. The Pi stores the current kernel configuration in the /proc/ filesystem, so we can use that to provide an initial setup - all these commands need to be done from the ~/linux directory.
gzip -dc /proc/config.gz > .config
Set up your new kernel, setting what you need to [M] in the configuration.
make menuconfig
Set up the building process, and start the build - NOTE you have to build the entire kernel the first time to ensure that the symbols are synchronised - the kernel doesn't need to be used for the modules to work (and if you want to add more modules in future, you can just do make modules) - does anyone know how to avoid having to do this?
make
make
Go and have a lot of coffee - this step takes a significant amount of time - like, about 6 hours!
Once this is done, and if you have any build errors, let me know, I may be able to point you in the right direction, we can now go ahead and install the modules:
sudo make modules_install
If the drivers you require also have firmware, then install that, too:
sudo make firmware_install
All done - congratulations!
I'm going to write another blog post soon about using a distributed compiler on another machine - that should speed things up but in the meantime this does work!
ReplyDeleteHi all hope you can help.
ReplyDeleteIm trying to install this program USB Redirector for Linux
http://www.incentivespro.com/downloads.html
running latest debian for raspberry
When tring to install i get the famus kernel error could somebody who knows linux help me so i could install this???
What processor arch version did you download. What is 'the famus kernel error' ???
Delete