First and foremost, it should be noted that LibreELEC relies heavily on cross-compilation, and as such, it is possible to build it for multiple targets with ease from a single compute instance.
Tools you’ll need:
Start by updating your system (on Ubuntu or other Debian-based distribution):
Note: Debian does not need “sudo” however the commands are identical once sudo is removed
Note: at least gcc-4.7 is required.
sudo apt-get update sudo apt-get upgrade sudo apt-get install make
Reconfigure to bash so we have best possible script compatibility:
sudo dpkg-reconfigure dash
and select no, to install bash as the default
Then, install build tools
Ubuntu 14.04 +:
you will need libxml-parser-perl
sudo apt-get install libxml-parser-perl
We will use dnf to install the required development packages. Note that on recent Fedora releases, dnf is the current package management application, and yum has been deprecated.
dnf install autoconf automake binutils cpp cvs gcc gcc-c++ glibc-devel glibc-headers glibc-static kernel-devel kernel-headers \ libmpc libstdc++-devel libstdc++-static ncurses-devel perl-libintl perl-Test-Harness perl-Text-Unidecode \ perl-Thread-Queue texinfo
Download LibreELEC from Github:
Now we will fetch an LibreELEC repository that will allow us to build a version targeted for the Odroid C2 ARM board:
git clone https://github.com/lrusak/LibreELEC.tv.git --branch aarch64-odroid-c2
A new folder called LibreELEC.tv will be created.
Be sure to have lot of free space – at least 15 GB. Better more than less.
In a terminal , browse to the directory that was just created:
To build a bootable disk and update image for the Odroid C2:
time ARCH=aarch64 PROJECT=Odroid_C2 make -j8
This will take a while. Remember, the LibreELEC build process is a self-hosted cross-compilation, meaning that this will initially fetch the cross-compiler (linaro’s arm toolkit), third party libraries, and then the build process will start.
When the build completes, you will find the fresh build in the target directory of your build directory LibreELEC.tv/target/
If you need to clean and start over do the following
and then start the build process again.
To install the generated target, follow the installations here, and adapt as necessary, see the Raspberry Pi’s reference style is an ideal starting point. This may also come in handy when dealing with u-boot.