How to compile kernel

Compiling kernel on Raspberry Pi takes long time – cross compiling is much better solution on separated, faster computer with Linux installed. Both Raspberry Pi and Linux box must be connected to the same network and internet. I’m using my home webserver on Ubuntu OS. Lan IP = 192.168.1.77 , Raspberry Pi Lan 192.168.1.93 – replace with your own Lan Ips. Make sure you have SSH on Ubuntu box if not sudo apt-get install openssh-server.

Setup Raspberry Pi
Download Raspian “wheezy” from http://www.raspberrypi.org/downloads
I’m using 2013-07-26-wheezy-raspbian
Setup SD card minimum 4GB using http://sourceforge.net/projects/win32diskimager/

Configure Raspberry Pi

Use Hexxeh’s script to update firmware on Raspberry Pi,

Make dir writable

Make sure you have GIT

Update Raspberry Pi

Compile Kernel on Ubuntu box
Install packages for cross compiling

From /proc/ directory grab .config on Raspberry Pi

Copy .config from Raspberry Pi to the Ubuntu computer using your local LAN – my local Raspberry Pi IP = 193.168.1.93 (replace ip with your own LAN ip)

Configure .config

Compile Kernel on Ubuntu box (add j3 for dual core pc, j6 for quad core pc)

Create modules dir

Install modules to modules dir

Copy compiled kernel to the Raspberry Pi

Replace old kernel img with new compiled kernel

Copy new modules to the Raspberry Pi & remove directories we do not need
Remove first

Next copy modules to Raspberry Pi

Reboot Raspberry Pi

Resources:
http://elinux.org/RPi_Kernel_Compilation

Speak Your Mind