Skip to content

Install kernel sources

notro edited this page May 6, 2013 · 6 revisions

This step by step guide is for installing on the Raspberry Pi using the Raspian "wheesy" distro.

This guide assumes everything is done as root

sudo -i

make zinstall preperation

''make zinstall'' won't work out of the box. One piece is missing.
/sbin/installkernel needs to find a script.

This is a simple solution with the caveat that ''make install'' will actually do ''zinstall''

Create directory

mkdir -p /etc/kernel/postinst.d/

Create file ''/etc/kernel/postinst.d/kernel_img''

#!/bin/sh

ver="$1"
img="$2"

exec </dev/null >&2

# backup current kernel
mv /boot/kernel.img /boot/kernel_last.img

# fat doesn't support symlinks
mv $img /boot/kernel.img

Make the file execuable

chmod +x /etc/kernel/postinst.d/kernel_img

It is also possible to override /sbin/installkernel with INSTALLKERNEL. See kbuild.txt

# This is an example on how 'make zinstall' will call the script /sbin/installkernel
/sbin/installkernel 3.2.27+ arch/arm/boot/zImage System.map "/boot"

Install programs

apt-get update
apt-get -y install git libncurses5-dev

Get kernel sources

We don't download the complete git history (--depth 1) to speed things up.

cd /usr/src
git clone --depth 1 git://github.com/raspberrypi/linux.git
Clone this wiki locally