Xcompile RPI Kernel on Debian

Building an RPI 3.6.11 kernel with PPS support on GPIO pin 24.

Straight forward instructions with no BS and no fancy crap.

PSA: To people writing how-to’s, keep your shiny Linux CLI kung-fu on your resume and off your blog.

If you are interested in compiling a custom kernel for other reasons just skip/replace the PPS specific junk below.

Install Debian.

Add Emdebian to sources.list:

# Xcompile Toolchain
deb http://www.emdebian.org/debian/ squeeze main

Install the packages we need:

apt-get install emdebian-archive-keyring
apt-get install gcc-4.4-arm-linux-gnueabi

Create directories for your build:

mkdir /admin
mount 10.1.1.104:/NAS/admin /admin

Install git and clone the source to the directories created:

apt-get install git-core
git clone --depth=1 https://github.com/raspberrypi/linux.git
git clone --depth 1 https://github.com/raspberrypi/firmware

— START PPS (pin 24) Specific Stuff —

Download the BCM2708 patch.

And apply it. You should be in the top level of the linux src tree with the patch file one level above that.

patch -p1 < ../bcm2708.diff

--- END PPS Specific Stuff ---

Compile the Kernel:

make -j 2 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

Compile the modules:

make modules_install ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/admin/compile/rpi-3.6.11/modules/

Copy the zImage you created and rename it to kernel.img:

root@hcpi002:/admin/compile/rpi-3.6.11/linux/arch/arm/boot# cp zImage /boot
root@hcpi002:/boot# mv zImage kernel.img

Copy Modules:

root@hcpi002:/admin/compile/rpi-3.6.11/modules/lib/modules# cp -R 3.6.11-kcom-pin24-pps-g2bebfca-dirty /lib/modules
root@hcpi002:/admin# depmod -A
root@hcpi002:/admin# reboot

If you'd rather download a built kernel with PPS signal on GPIO pin 24, here are the files...

Kernel PPS on GPIO pin 24
Modules