Gotcha #1

Symptom

Kernel compile fails on “make”.  After multiple unsuccessful attempts, cleaning the kernel tree after each attempt with:

$ make clean
$ make distclean
$ make mrproper

You start to notice that the failure point of “make” is different each time.

Cause

Memory corruption during compile.  The memory corruption is caused by overclocking the Pi with settings that make it unstable.  The CPU, GPU and SDRAM clock settings written to /boot/config.txt by the overclock applet provided in Raspbain and NOOBS provides unstable settings.  This has been confirmed by reference to [1] where they have carried out extensive measurements into the ideal settings for overclocking the Pi 2.

Solution

Either return CPU, GPU and SDRAM clocks to safe default values and accept increased compile time (if you compile directly on the Pi) or use the settings recommended by [1].

References

[1] http://linuxonflash.blogspot.co.uk/2015/02/a-look-at-raspberry-pi-2-performance.html