Sunday, 19 February 2017

Build Linux For Raspberry Pi 2/3

Building Linux Kernel


Checkout cross compiler toolchain:-
git clone https://github.com/raspberrypi/tools

and export path for tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/

better put it in your .bashrc

You can also build 64 bit, however, at the moment, default/recommended is 32 bit.


Check out the latest source of kernel from:-
git clone --depth=1 https://github.com/raspberrypi/linux


Configure for Rapsberry Pi 2/3 boards:-
cd linux
KERNEL=kernel7
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig


Build the kernel source:-
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs


References:-
https://www.raspberrypi.org/documentation/linux/kernel/building.md

7 comments:

  1. Very precise and helpful tutorial !!!

    ReplyDelete
  2. Please add steps to add rootfs, add other partitions etc and create a final image to flash in sd card. Thanks !!!!

    ReplyDelete
  3. Ok, will add tips for rootfs soon.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Interesting and useful tutorial..

    ReplyDelete