Building OpenVix - SimonCapewell/enigma2 GitHub Wiki

Operating System

Builds are much quicker when running on real hardware. VMs are slow due to the large number of small file operations involved.

Linux

  • Ubuntu 20.04 LTS

Windows

Bitbake will only run in a WSL 2 instance. Build speed is similar to running a Linux in a VM. The following distros work

  • Ubuntu 20.04 LTS

If your Windows PATH environment variable has any paths with spaces in them, you will need to add

[interop]
appendWindowsPath=false

to /etc/wsl.conf and then restart WSL from the Windows terminal

wsl --shutdown

Update

Ensure your OS is up to date

sudo apt-get update

Modify max_user_watches

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -n -w fs.inotify.max_user_watches=524288

Install dependencies

sudo apt-get install -y autoconf automake bison bzip2 chrpath coreutils cpio curl cvs debianutils default-jre default-jre-headless diffstat flex g++ gawk gcc gcc-8 gcc-multilib g++-multilib gettext git git-core gzip help2man info iputils-ping java-common libc6-dev libegl1-mesa libglib2.0-dev libncurses5-dev libperl4-corelibs-perl libproc-processtable-perl libsdl1.2-dev libserf-dev libtool libxml2-utils make ncurses-bin patch perl pkg-config psmisc python3 python3-git python3-jinja2 python3-pexpect python3-pip python-setuptools qemu quilt socat sshpass subversion tar texi2html texinfo unzip wget xsltproc xterm xz-utils zip zlib1g-dev zstd 

Set Python 3 as the preferred python version

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --config python

Then select python3 when asked

Set up the build environment.

The Python 3 version of OpenVix is currently built using the oe-alliance 5.0 branch

mkdir ~/openvix
cd ~/openvix
git clone https://github.com/oe-alliance/build-enviroment.git -b 5.0 build-environment-5.0
cd build-environment-5.0
make update

This takes around 5-10 minutes

Configure for your hardware

Note that site.conf isn't created until your first build.

You can adjust the number of threads used to build, the current default is 4 threads per CPU core, which seems to be good. Open the site.conf file in Nano Editor. nano site.conf Change the number of threads BB_NUMBER_THREADS to a value to suit your hardware, then save and exit (Ctrl+X).

Point at your git repository

Add the Python 3 branch location to site.conf:

ENIGMA2_URI = "git://github.com/OpenVix/enigma2.git;protocol=git;branch=Dev-python3-compatible"

or your own branch

ENIGMA2_URI = "git://github.com/SimonCapewell/enigma2.git;protocol=git;branch=Dev-python3-compatible"

Build an image.

Update and then build image.

MACHINE=et8500 DISTRO=openvix DISTRO_TYPE=developer make image

make image takes 4-8 hours on a Core-i5 with 4 cores running on a VM, and uses around 30GB of disk.

Quicker build for Enigma2 binary

If just building the c++ enigma2 binary, you can speed things up by only building its dependencies rather than the whole distribution. The build then takes somewhere between 10 and 30 minutes for an initial build, and between 1 and 2 minutes if a few files have been changed:

Setup

Fetch the source from the git repo

cd builds/openvix/developer/et8500
. env.source
bitbake -c clean enigma2
bitbake -c unpack enigma2

Build

Now that the source is in place, any changes can be copied over the top if needed. Example location: builds/developer/et8500/tmp/work/et8500-oe-linux/enigma2/enigma2-5.3+gitAUTOINC+f3fe89ab92-r0/git

bitbake -c compile enigma2

This will build an enigma2 binary to builds/developer/et8500/tmp/work/et8500-oe-linux/enigma2/enigma2-5.3+gitAUTOINC+f3fe89ab92-r0/git/main

The binary contains various debug symbols so is around 35MB

You can copy this to your hard disk rather than flash if running short on space and run it from there, e.g. /hdd/bin/enigma2

If you want a non debug version, you'll need to also run the package command after compile

bitbake -c package enigma2

Once built, this smaller enigma2 binary can be found in, for example, builds/developer/et8500/tmp/work/et8500-oe-linux/enigma2/enigma2-5.3+gitAUTOINC+f3fe89ab92-r0/package/usr/bin/

Even quicker build

To speed things up further, you can tell bitbake to run the enigma2 recipe directly and avoid the dependency resolution step. This will only work if the previous normal build step has been completed.

bitbake -b ../../../../meta-oe-alliance/meta-oe/recipes-oe-alliance/enigma2/enigma2.bb -c compile enigma2