How to create a buildroot environment for Raspberry Pi

First of all, what is build root?

As described in the site:

"Buildroot is a set of Makefiles and patches that makes it easy to generate a complete embedded Linux system. Buildroot can generate any or all of a cross-compilation toolchain, a root filesystem, a kernel image and a bootloader image. Buildroot is useful mainly for people working with small or embedded systems, using various CPU architectures (x86, ARM, MIPS, PowerPC, etc.) : it automates the building process of your embedded system and eases the cross-compilation process."


"Buildroot is maintained by Peter Korsgaard, and licensed under the GNU GENERAL PUBLIC LICENSE V2 (Or later). Stable releases are delivered every three months."


There are several advantages using buildroot to build your linux embedded systems, two of these are the most important for me:

  1. You don't have to build all the scripts to startup a linux system. Buildroot will do the work for you.
  2. Buildroot installs a cross compilation toolchain, so you can compile your system using your desktop PC  and so you can gain a lot of time. For example, the compiling process of a complete system on a Raspberry Pi can take several weeks, instead on your PC it will take few hours.

For my pourposes I'm using Bsquask. The Bsquask SDK provides a GCC 4.6.3 toolchain for building armv6 binaries with the hardfloat ABI, as well as bootloaders, kernel image, rootfs, and development sysroot for the Raspberry Pi. You can find more at the following address:

As explained in the above page:


Getting and building the Bsquask SDK

Download the RaspberryPi-Buildroot package from or use git clone

$ wget

deflate the file 

$ unzip 


Create the directory where you want your SDK to be built:

$ export BSQUASK_DIR=/opt/bsquask

$ mkdir -p $BSQUASK_DIR


Enter the BuildRoot directory and generate a Makefile for your SDK:

$ cd BuildRoot

$ make raspberrypi_defconfig O=$BSQUASK_DIR

You may be missing some build dependancies (flex, bison, etc…) but you will be warned about what packages you need to install if this is the case.


Change to your SDK directory and and start the build (this can take a few hours the first time).


$ make


Using Generated Image on the Raspberry Pi

First you need to obtain an SD card that has the correct partitions setup. It needs to be setup as follows:

75MB fat32 partition

500MB or greater ext4 partition (ideally using the remainder of the card)

When you have this setup, mount the the two partitions (assuming /media/BOOT for the fat32 partiion, and /media/rootfs for the ext4). Then run the following commands to install the rootfs:

$ cd $BSQUASK_DIR/images

$ tar -zxvf boot.tar.gz -C /media/BOOT

$ sudo tar -zxvf rootfs.tar.gz -C /media/rootfs

Make sure you are root(sudo) when extracting rootfs.tar.gz, or you will have problems on boot

Now place the SD card in your Raspberry Pi and power on. If everything went as planned, you should get a login prompt for Bsquask (linux).


Login information:

username: root

password: root



You may also like...

3 Responses

  1. Patrick says:

    The first step were followed, but got lost in the last..stage. pls a little explanation on these steps.

    $ cd $BSQUASK_DIR/images


    $ tar -zxvf boot.tar.gz -C /media/BOOT

    $ sudo tar -zxvf rootfs.tar.gz -C /media/rootfs

  2. admin says:


    waht is going wrong? have you any errors from the command line?



  3. makouda says:

    I followed instructions and compliled fine, now I want to access RPI via ssh (no other choises). how can I set static ip? it's not like Raspbian, I didnt's found the file /etc/network/interface. 

    where can I find the file configuration

Leave a Reply

Your email address will not be published. Required fields are marked *