In order to build Buildroot source tree for ODROID-N2, you require to install the proper version of toolchanins required and they can be downloaded from Linaro or ARM website. Here is the installation instruction and the toolchains are listed in the BSP release notes of AMLogic.

The toolchains should be installed into /opt/toolchain in order to follow up the further instructions.

$ mkdir -p /opt/toolchain

The instructions to install the toolchains.

$ wget -P /tmp
$ tar xJvf /tmp/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains
$ wget -P /tmp
$ tar xJvf /tmp/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz -C /opt/toolchains
$ wget -P /tmp
$ tar xJvf /tmp/gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz -C /opt/toolchains
$ wget -P /tmp
$ tar xjvf /tmp/gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2 -C /opt/toolchains

The current Buildroot for ODROID-N2 is consisted with multiple git repositories and they can be downloaded by the command repo like Android, the command can be downloaded from Google download site. If you already have repo command, you do not need to download another copy of the command.

$ mkdir -p $HOME/bin
$ curl > $HOME/bin/repo
$ chmod a+x $HOME/bin/repo
$ export PATH=$HOME/bin:$PATH

Checkout source tree

$ mkdir n2_buildroot
$ cd n2_buildroot
$ repo init -u -b aml64_buildroot_master --depth=1
$ repo sync
$ repo start aml64_buildroot_master --all


Once you have done above, you can start to build the source tree from selecting a build target. The current Buildroot for ODROID-N2 provide the build target of Linux based Buildroot platform image as well as Petitboot image. The build target of the default Buildroot platform for ODROID-N2 is odroidn2_release.

$ source buildroot/build/ odroidn2_release
$ make

At the end of the building, if everything goes fine, Buildroot drops many files in the directory out/odroidn2/images/.

$ ls output/odroidn2/images/
Image.gz  boot.ini  logo.bmp.gz  rootfs.cpio.uboot  rootfs.ext4  s922d_odroidn2.dtb  u-boot.bin
boot.cmd  boot.scr  rootfs.cpio  rootfs.ext2        rootfs.tar   sdcard.img
$ sudo dd if=output/odroidn2/images/sdcard.img of=<your/memory/card> conv=fsync

Using Docker for building

Due to the various platforms and environments, build process could be failed because of unmatched tools or different machine types required for the tools or in order to continuously manages the build, Docker container is the alternative solution to avoid such difficulties and this page Using Docker will briefly introduce you to how you can set up Docker and its environments.