Loading...
 

Build From Source - Buildroot

This page will show you how to download and build Buildroot file system for ESPRESSObin. We will start by downloading the necessary sources to your local Linux machine (e.g. to /home/espressobin/buildroot directory):

espressobin@buildserver:~$ mkdir buildroot
espressobin@buildserver:~$ cd buildroot/
espressobin@buildserver:~/buildroot$ git clone https://github.com/MarvellEmbeddedProcessors/buildroot-marvell .

 

Then let's checkout to the proper branch we are going to use: buildroot-2015.11-16.08

espressobin@buildserver:~/buildroot$ git checkout buildroot-2015.11-16.08
Branch buildroot-2015.11-16.08 set up to track remote branch buildroot-2015.11-16.08 from origin.
Switched to a new branch 'buildroot-2015.11-16.08'

 

Next we make a default ./.config file using the arch/arm64/configs/mvebu_v8_le_defconfig:

espressobin@buildserver:~/buildroot$ make mvebu_armv8_le_defconfig


Now that we have generated a default .config, we need to launch make menuconfig and set the correct external compiler settings:

espressobin@buildserver:~/buildroot$ make menuconfig


Once in menuconfig, we select Toolchain and there configure the following (note that some of these settings might be pre-configured already):

  1. Toolchain Type -> External toolchain
  2. Toolchain -> Custom toolchain
  3. Toolchain origin -> Pre-installed toolchain
  4. Toolchain path -> path-to-linaro-toolchain-excluding-bin
    Here set the compiler path as you have configured it when following Toolchain tutorial but excluding the /bin directory (in our case the path was /home/espressobin/toolchain/gcc-linaro-5.2-2015.11-2-x86_64_aarch64-linux-gnu/)
  5. Toolchain prefix -> aarch64-linux-gnu
    Here we set the toolchain prefix excluding the last "-", so this should be aarch64-linux-gnu
  6. External toolchain gcc version --> 5.x
  7. External toolchain kernel headers series -> 4.0.x
    Here we set the correct toolchain kernel header series. The toolchain used for building ESPRESSObin Buildroot (as we demonstrated in Toolchain) is Linaro gcc 5.2.1 which uses kernel header 4.0.x

So after these changes, this is how your menuconfig should look like:

Make Menuconfig

We then select Exit and hit Save on our way out to save our newly-made configuration. There is one more fix that needs to be made before building the Buildroot file system. The package fio2.17 is no longer available from the foosies.org, so change the FIO_SITE variable to use github.com as the repository server:

diff --git a/package/fio/fio.mk b/package/fio/fio.mk
index e310d61..39a4d56 100644
--- a/package/fio/fio.mk
+++ b/package/fio/fio.mk
@@ -5,7 +5,7 @@
 ################################################################################

 FIO_VERSION = 2.17
-FIO_SITE = https://fossies.org/linux/misc
+FIO_SITE = https://github.com/axboe/fio/archive
 FIO_LICENSE = GPLv2 + special obligations
 FIO_LICENSE_FILES = LICENSE


Now we can start the build process with:

espressobin@buildserver:~/buildroot$ make -j4


Note that during this process Buildroot will download sources from the Internet, so make sure you will have a stable connection throughout the building process. Also, note that the building process might take some time to finish the first time it is compiled.

When the build process is done, head into the subdirectory output/image where you will find rootfs.tar.gz rootfs image:

espressobin@buildserver:~/buildroot$ cd output/images/
espressobin@buildserver:~/buildroot/output/images$ ls
Image  rootfs.tar  rootfs.tar.gz


This tar containing the Buildroot root file system can also be downloaded from our Tech Spec page, Software table under Buildroot.

Head over to Boot from MicroSD card/USB stick - Buildroot page to see how to properly format either a microSD card or USB device, extract the Buildroot file system onto it and boot it on your ESPRESSObin.