3 Andreas Oberritter <obi@opendreambox.org>
10 1.2 Supported products
12 1.4 Obtaining the source code
14 1.6 Directory structure
15 1.6.1 openembedded-core and meta-openembedded
16 1.6.2 meta-opendreambox
20 3 Major changes since previous releases
21 3.1 Changes since release 1.6
23 5 Building OpenDreambox
25 5.2 Configuration variables
26 5.2.1 BB_NUMBER_THREADS
29 5.3 Adding custom layers
30 5.4 Adding custom options
31 5.4.1 DISTRO_FEED_PREFIX
34 5.5 Setting up a build directory
35 5.6 Building a firmware image
36 5.7 Building a package
38 6.1 Cross-compilation of external software
40 6.3 Package architecture
41 7 Bug reports and patches
45 This document briefly describes the OpenDreambox distribution, an embedded
46 Linux distribution for Set-Top-Boxes manufactured by Dream Multimedia GmbH.
48 OpenDreambox is based on the OpenEmbedded build framework, which uses BitBake
49 to transform build instructions into distributable firmare images and software
54 Developers familiar with previous versions of OpenDreambox or OpenEmbedded in
57 1.2 Supported products
59 The current version includes support for the following machines:
61 +-----------------------------------+
62 | ---------- | ---------------- |
63 |Product name |Environment variable|
64 | ---------- | ---------------- |
65 |DM 500 HD |MACHINE=dm500hd |
66 |DM 800 HD PVR |MACHINE=dm800 |
67 |DM 800 HD SE |MACHINE=dm800se |
68 |DM 7020 HD |MACHINE=dm7020hd |
69 |DM 8000 HD PVR|MACHINE=dm8000 |
70 | ---------- | ---------------- |
71 +-----------------------------------+
75 Copyright (c) 2010-2012 Dream Multimedia GmbH, Germany
76 http://www.dream-multimedia-tv.de/
78 Andreas Frisch <fraxinas@opendreambox.org>
79 Andreas Monzner <ghost@opendreambox.org>
80 Andreas Oberritter <obi@opendreambox.org>
81 Mladen Horvat <acid-burn@opendreambox.org>
82 Stefan Pluecken <thedoc@opendreambox.org>
83 Stephan Reichholf <reichi@opendreambox.org>
85 Permission is hereby granted, free of charge, to any person obtaining a copy
86 of this software and associated documentation files (the "Software"), to deal
87 in the Software without restriction, including without limitation the rights
88 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89 copies of the Software, and to permit persons to whom the Software is
90 furnished to do so, subject to the following conditions:
92 The above copyright notice and this permission notice shall be included in
93 all copies or substantial portions of the Software.
95 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
97 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
98 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
104 1.4 Obtaining the source code
106 OpenDreambox uses the Git version control system. To obtain the source code, it
107 is required to install Git. See http://git-scm.com/.
109 To initially download the source into the current directory, issue the
112 git clone git://git.opendreambox.org/git/opendreambox.git
118 make -C opendreambox image
120 If this command fails, prerequisites my be missing. See section 2.
122 1.6 Directory structure
124 OpenDreambox consists of a set of layers containing build instructions. This
125 meta data is used by BitBake to download and compile source code and to
126 assemble installable software packages and firmware images.
128 Currently, there are five layers, ordered by priority from lowest to highest:
133 * meta-bsp/${MACHINE}
135 If a recipe for the same package exists in multiple layers, then the higher
136 priority layer takes precedence over the lower priority layer.
138 For example, libmad_0.15.1b.bb exists in both meta-openembedded and
139 openembedded-core. The recipe in meta-openembedded will be used, because
140 openembedded-core has lower priority.
142 NOTE: This would still be true even if the version of libmad in
143 openembeded-core was higher than the version in meta-openembedded, unless
144 PREFERRED_VERSION_libmad was set to the version in openembedded-core. There is
145 currently no way to prefer a version of a lower priority layer, if the same
146 version is present in a higher priority layer.
148 1.6.1 openembedded-core and meta-openembedded
150 These directories contain copies of Git repositories from git.openembedded.org,
151 including the OpenEmbedded-Core layer ("meta") and the OpenEmbedded layer
152 ("meta-oe"). They get created automatically when building the distribution for
155 Throughout this document, the combination of these directories will be referred
158 1.6.2 meta-opendreambox
160 This directory contains:
161 * Recipes for packages written specifically for the OpenDreambox distribution
162 * Modifications to recipes from OpenEmbedded
163 * Recipes for software versions older than those available from OpenEmbedded
164 * Recipes for software versions newer than those available from OpenEmbedded
168 The directory meta-bsp contains Board Support Packages (BSP) for the supported
169 Dreambox models. This includes:
171 * Machine specific overrides
178 2.1 Required software
180 The OpenEmbedded project provides a general list of prerequisites for many
181 Linux distributions and also for some other operating systems.
182 * http://www.openembedded.org/index.php/OEandYourDistro
183 * http://www.openembedded.org/index.php/Required\_software
185 It is highly recommended to use Linux to build OpenDreambox. In theory, any
186 recent distribution will do, but not many distributions have been verified to
187 build OpenDreambox without errors. Tested distributions include:
188 * Arch Linux 2011.08.19 [amd64]
189 * Debian 6.0 (Squeeze) [i386]
190 * Debian "Testing" (Wheezy) [i386]
191 * Fedora 16 [i386, amd64]
192 * Ubuntu 10.10 (Maverick Meerkat) [i386]
193 * Ubuntu 11.10 (Oneiric Ocelot) [amd64]
194 * Ubuntu 12.04 LTS (Precise Pangolin) [i386, amd64]
196 Distributions known to cause problems:
197 * Ubuntu 10.04 LTS (Lucid Lynx) [i386]: The dynamic linker crashes
198 frequently, interrupting the build process. Setting PARALLEL_MAKE = -j1 in
199 conf/make.conf may help.
201 Distributions known not to work:
202 * Debian 5.0 (Lenny): Comes with Python 2.5, which is too old.
204 3 Major changes since previous releases
206 3.1 Changes since release 1.6
208 * Recipes were split across multiple layers and categorized.
209 * env.source has been replaced by two files, bitbake.env and
210 cross-compile.env. The former sets a minimal environment that is needed to
211 execute bitbake. The latter creates machine-specific command aliases, in
212 order to compile external software.
213 * All machines share a common tmp directory.
214 * ${MACHINE}/build directories were renamed to build/${MACHINE}.
215 * Kernel packages were renamed from linux-${MACHINE} to linux-dreambox.
216 * Support for machines based on ATI Xilleon or IBM STB was dropped.
222 5 Building OpenDreambox
224 In the top level directory, there is a Makefile, which is used to set up build
225 directories and to fetch or update all used repositories. The Makefile can be
226 influenced by environment variables, either by specifing them on the
227 command-line or by storing them in a file called conf/make.conf. It is not
228 recommended to edit the Makefile directly in order to avoid conflicts with
231 When the Makefile is run for the first time, the following steps will be
233 * Creation of configuration files
235 * conf/opendreambox.conf
236 * build/${MACHINE}/conf/bblayers.conf
237 * build/${MACHINE}/conf/local.conf
238 * Update or checkout of Git repositories
245 Run make help to get a list of targets of the top level Makefile, together with
248 5.2 Configuration variables
250 5.2.1 BB_NUMBER_THREADS
252 Controls how many BitBake tasks may run at a time. Defaults to the number of
253 cores available on the build system. The number of cores is obtained from
254 /proc/cpuinfo. If this file is unavailable, the default value is 1.
258 Controls the target machine to build packages for. See section 1.2 for a list
259 of supported products.
263 Controls how many processes per recipe make may use. Defaults to the number of
264 cores available on the build system. The number of cores is obtained from
265 /proc/cpuinfo. If this file is unavailable, the default value is 1.
267 NOTE: If you see seemingly random build failures, try setting this variable to
270 5.3 Adding custom layers
272 It is possible to add custom layers to the build system. This can be done
273 globally and per machine. To add a layer globally, edit conf/bblayers-ext.conf.
274 To add a machine-specific layer, edit conf/bblayers-${MACHINE}-ext.conf.
275 Assuming that an additional layer is available at ${HOME}/custom-layer, the
276 entry to add to the file will look like this:
278 BBLAYERS =+ "${HOME}/custom-layer"
280 5.4 Adding custom options
282 It is possible to tweak a lot more options than those used by the Makefile by
283 editing conf/local-ext.conf or conf/local-${MACHINE}-ext.conf.
285 For example, if the firmware shall use the package feed built on the develoment
286 machine, which happens to be 192.168.1.1 and has a webserver configured to
287 point to tmp/deploy/ipk, a line like the following may be added:
289 DISTRO_FEED_URI = "http://192.168.1.1/${DISTRO}/${DISTRO_VERSION}"
291 In general, any variable in OpenEmbedded that uses weak assignment (?=) may be
292 overridden from these files.
294 The following sections list some commonly used options.
296 5.4.1 DISTRO_FEED_PREFIX
298 DISTRO_FEED_PREFIX specifies the name of the package update feed. This name may
299 be arbitarily chosen.
301 Default: DISTRO_FEED_PREFIX = "remote"
303 5.4.2 DISTRO_FEED_URI
305 DISTRO_FEED_URI specifies the URI of the package update feed.
307 Default: DISTRO_FEED_URI = "http://my-distribution.example/remote-feed/"
311 INHERIT specifies bbclasses to include from a configuration file. Usually, this
312 variable gets appended to by using the += operator.
314 The OpenDreambox distribution automatically appends "buildhistory recipe_sanity
317 Default: INHERIT = ""
321 Always build the latest versions of OpenDreambox-related projects from Git:
323 INHERIT += "opendreambox-autorev"
325 Remove temporary files of previous versions of a recipe before a newer version
328 INHERIT += "rm_old_work"
330 Remove temporary files of a recipe after it has been built and packaged
335 5.5 Setting up a build directory
337 To set up a build directory for e.g. DM 500 HD run make MACHINE=dm500hd. If
338 MACHINE=dm500hd has been set in conf/make.conf, you can simply run make with no
339 arguments instead. This will create and initialize the directory build/dm500hd.
341 5.6 Building a firmware image
343 To build a firmware image for e.g. DM 500 HD run make MACHINE=dm500hd image. If
344 MACHINE=dm500hd has been set in conf/make.conf, you can simply run make image
347 5.7 Building a package
349 To build a single package, BitBake has to be used directly. First, the
350 environment has to be set up, in order to make BitBake available to the shell.
351 This can be done with the following command:
355 BitBake must be run from the machine's build directory. For DM 500 HD run:
359 In order to build enigma2, run:
365 6.1 Cross-compilation of external software
367 OpenDreambox provides a script called cross-compile.env. Once run, the script
368 will create the following commands (shell aliases), aiming to ease
369 cross-compilation of external source trees:
370 * oe_autoreconf - Calls OE's version of autoreconf. Useful for projects based
372 * oe_runconf - Calls ./configure with parameters suitable for OE. Useful for
373 projects based on GNU autotools.
374 * oe_runmake - Calls make with parameters suitable for OE. Useful for
375 projects based on GNU autotools or GNU make.
376 * oe_env - Useful to execute arbitrary commands in the OE environment (e.g.
378 * oe_setenv - Exports the OE environment to the currently running shell
381 The script needs to know the target machine, which can be one of the supported
382 products (see 1.2). Because the script adds aliases to your currently running
383 shell session, it has to be invoked using source or . (the dot operator), e.g.:
385 source cross-compile.env dm7020hd
387 The script may be called from any location, but must reside inside the
388 OpenDreambox Git tree. You may want to create a symlink to cross-compile.env
389 somewhere in your PATH.
393 Run scripts/do_stylize.sh on new recipes to ensure proper coding style.
395 6.3 Package architecture
397 Set PACKAGE_ARCH = "${MACHINE_ARCH}" if either condition is met:
398 * The recipe uses COMBINED_FEATURES, MACHINE_FEATURES or DREAMBOX_FEATURES.
399 * The recipe is part of meta-bsp.
401 7 Bug reports and patches
403 Please send bug reports and patches to the Enigma2 development mailing list
404 <enigma2-devel@lists.elitedvb.net>.
406 A comfortable way to create patches is to use git format-patch, after all
407 changes have been committed to your local copy of the repository.