This document briefly describes the OpenDreambox distribution, an embedded Linux distribution for Set-Top-Boxes manufactured by Dream Multimedia GmbH.
OpenDreambox is based on the OpenEmbedded build framework, which uses BitBake to transform build instructions into distributable firmare images and software packages.
The current version, OpenDreambox 2.0, is based on OpenEmbedded ”denzil”.
Developers familiar with previous versions of OpenDreambox or OpenEmbedded in general.
The current version includes support for the following machines:
Product name | Environment variable |
DM 500 HD | MACHINE=dm500hd |
DM 800 HD PVR | MACHINE=dm800 |
DM 800 HD SE | MACHINE=dm800se |
DM 7020 HD | MACHINE=dm7020hd |
DM 8000 HD PVR | MACHINE=dm8000 |
OpenDreambox uses the Git version control system. To obtain the source code, it is required to install Git. See http://git-scm.com/.
To initially download the source into the current directory, issue the following command:
git clone -b denzil git://git.opendreambox.org/git/opendreambox.git
The Git repository can be viewed online at:
http://cgit.opendreambox.org/opendreambox.git
For the impatient:
make -C opendreambox image
If this command fails, prerequisites my be missing. See section 2.
OpenDreambox consists of a set of layers containing build instructions. This meta data is used by BitBake to download and compile source code and to assemble installable software packages and firmware images.
Currently, there are five layers, ordered by priority from lowest to highest:
If a recipe for the same package exists in multiple layers, then the higher priority layer takes precedence over the lower priority layer.
For example, libmad_0.15.1b.bb exists in both meta-openembedded and openembedded-core. The recipe in meta-openembedded will be used, because openembedded-core has lower priority.
NOTE: This would still be true even if the version of libmad in openembeded-core was higher than the version in meta-openembedded, unless PREFERRED_VERSION_libmad was set to the version in openembedded-core. There is currently no way to prefer a version of a lower priority layer, if the same version is present in a higher priority layer.
These directories contain copies of Git repositories from git.openembedded.org, including the OpenEmbedded-Core layer (”meta”) and the OpenEmbedded layer (”meta-oe”). They get created automatically when building the distribution for the first time.
Throughout this document, the combination of these directories will be referred to as OpenEmbedded.
The latest changes to these Git repositories can be seen at:
http://git.openembedded.org/openembedded-core-contrib/log/?h=obi/current
http://git.openembedded.org/meta-openembedded-contrib/log/?h=obi/current
This directory contains:
The directory meta-bsp contains Board Support Packages (BSP) for the supported Dreambox models. This includes:
The OpenEmbedded project provides a general list of prerequisites for many Linux distributions and also for some other operating systems.
It is highly recommended to use Linux to build OpenDreambox. In theory, any recent distribution will do, but not many distributions have been verified to build OpenDreambox without errors. Tested distributions include:
Distributions known not to work:
configure: error: changes in the environment can compromise the build configure: error: run ‘make distclean’ and/or ‘rm ./config.cache’ and start over
Solution: bitbake -ccleansstate gcc-cross-initial gcc-cross-intermediate gcc-cross
In the top level directory, there is a Makefile, which is used to set up build directories and to fetch or update all used repositories. The Makefile can be influenced by environment variables, either by specifing them on the command-line or by storing them in a file called conf/make.conf. It is not recommended to edit the Makefile directly in order to avoid conflicts with future updates.
When the Makefile is run for the first time, the following steps will be executed:
Run make help to get a list of targets of the top level Makefile, together with a brief description.
Controls how many BitBake tasks may run at a time. Defaults to the number of cores available on the build system. The number of cores is obtained from /proc/cpuinfo. If this file is unavailable, the default value is 1.
Controls the target machine to build packages for. See section 1.2 for a list of supported products.
Controls how many processes per recipe make may use. Defaults to the number of cores available on the build system. The number of cores is obtained from /proc/cpuinfo. If this file is unavailable, the default value is 1.
NOTE: If you see seemingly random build failures, try setting this variable to 1.
It is possible to add custom layers to the build system. This can be done globally and per machine. To add a layer globally, edit conf/bblayers-ext.conf. To add a machine-specific layer, edit conf/bblayers-${MACHINE}-ext.conf. Assuming that an additional layer is available at ${HOME}/custom-layer, the entry to add to the file will look like this:
BBLAYERS =+ "${HOME}/custom-layer"
It is possible to tweak a lot more options than those used by the Makefile by editing conf/local-ext.conf or conf/local-${MACHINE}-ext.conf.
For example, if the firmware shall use the package feed built on the develoment machine, which happens to be 192.168.1.1 and has a webserver configured to point to tmp/deploy/ipk, a line like the following may be added:
DISTRO_FEED_URI = "http://192.168.1.1/${DISTRO}/${DISTRO_VERSION}"
In general, any variable in OpenEmbedded that uses weak assignment (?=) may be overridden from these files.
The following sections list some commonly used options.
DISTRO_FEED_PREFIX specifies the name of the package update feed. This name may be arbitarily chosen.
Default: DISTRO_FEED_PREFIX = "remote"
DISTRO_FEED_URI specifies the URI of the package update feed.
Default: DISTRO_FEED_URI = "http://my-distribution.example/remote-feed/"
INHERIT specifies bbclasses to include from a configuration file. Usually, this variable gets appended to by using the += operator.
The OpenDreambox distribution automatically appends "buildhistory recipe_sanity testlab" to INHERIT.
Default: INHERIT = ""
Some examples:
Always build the latest versions of OpenDreambox-related projects from Git:
INHERIT += "opendreambox-autorev"
Remove temporary files of previous versions of a recipe before a newer version gets built:
INHERIT += "rm_old_work"
Remove temporary files of a recipe after it has been built and packaged successfully.
INHERIT += "rm_work"
To set up a build directory for e.g. DM 500 HD run make MACHINE=dm500hd. If MACHINE=dm500hd has been set in conf/make.conf, you can simply run make with no arguments instead. This will create and initialize the directory build/dm500hd.
To build a firmware image for e.g. DM 500 HD run make MACHINE=dm500hd image. If MACHINE=dm500hd has been set in conf/make.conf, you can simply run make image instead.
To build a single package, BitBake has to be used directly. First, the environment has to be set up, in order to make BitBake available to the shell. This can be done with the following command:
source bitbake.env
BitBake must be run from the machine’s build directory. For DM 500 HD run:
cd build/dm500hd
In order to build enigma2, run:
bitbake enigma2.
OpenDreambox provides a script called cross-compile.env. Once run, the script will create the following commands (shell aliases), aiming to ease cross-compilation of external source trees:
The script needs to know the target machine, which can be one of the supported products (see 1.2). Because the script adds aliases to your currently running shell session, it has to be invoked using source or . (the dot operator), e.g.:
source cross-compile.env dm7020hd
The script may be called from any location, but must reside inside the OpenDreambox Git tree. You may want to create a symlink to cross-compile.env somewhere in your PATH.
Run scripts/do_stylize.sh on new recipes to ensure proper coding style.
Set PACKAGE_ARCH = "${MACHINE_ARCH}" if either condition is met:
Please send bug reports and patches to the Enigma2 development mailing list <enigma2-devel@lists.elitedvb.net>.
A comfortable way to create patches is to use git format-patch, after all changes have been committed to your local copy of the repository.