Buildroot
Due to the various platforms and environments, build process could be failed.
If you use another version like Ubuntu 18.04, please refer to this TIP first.
Toolchains
In order to build Buildroot source tree for ODROID-C4, 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.
- host
$ mkdir -p /opt/toolchain
The instructions to install the toolchains.
- host
$ wget https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -P /tmp $ tar xJvf /tmp/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains
- host
$ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz -P /tmp $ tar xJvf /tmp/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz -C /opt/toolchains
- host
$ wget https://releases.linaro.org/archive/14.04/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz -P /tmp $ tar xJvf /tmp/gcc-linaro-arm-none-eabi-4.8-2014.04_linux.tar.xz -C /opt/toolchains
- host
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6_1-2017q1/gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2 -P /tmp $ tar xjvf /tmp/gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2 -C /opt/toolchains
Checkout & compile
The current Buildroot for ODROID-C4 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.
- host
$ mkdir -p $HOME/bin $ curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo $ chmod a+x $HOME/bin/repo $ export PATH=$HOME/bin:$PATH
Checkout source tree
- host
$ mkdir c4_buildroot $ cd c4_buildroot $ repo init -u https://github.com/hardkernel/platform-manifest.git -b aml64_buildroot_master --depth=1 $ repo sync $ repo start aml64_buildroot_master --all
Building
Once you have done above, you can start to build the source tree from selecting a build target. The current Buildroot for ODROID-C4 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-C4 is odroidc4_release.
- host
$ source buildroot/build/setenv.sh odroidc4_release $ make
At the end of the building, if everything goes fine, Buildroot drops many files in the directory out/odroidc4/images/.
Installation
- host
$ ls output/odroidc4/images/ Image.gz boot.ini logo.bmp.gz rootfs.cpio.uboot rootfs.ext4 s922d_odroidc4.dtb u-boot.bin boot.cmd boot.scr rootfs.cpio rootfs.ext2 rootfs.tar sdcard.img
- host
$ sudo dd if=output/odroidc4/images/sdcard.img of=<your/memory/card> conv=fsync
Tips
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.