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.04 LTS (Lucid Lynx) [i386]
193 * Ubuntu 11.10 (Oneiric Ocelot) [amd64]
194 * Ubuntu 12.04 LTS (Precise Pangolin) [i386, amd64]
196 Distributions known not to work:
197 * Debian 5.0 (Lenny): Comes with Python 2.5, which is too old.
199 3 Major changes since previous releases
201 3.1 Changes since release 1.6
203 * Recipes were split across multiple layers and categorized.
204 * env.source has been replaced by two files, bitbake.env and
205 cross-compile.env. The former sets a minimal environment that is needed to
206 execute bitbake. The latter creates machine-specific command aliases, in
207 order to compile external software.
208 * All machines share a common tmp directory.
209 * ${MACHINE}/build directories were renamed to build/${MACHINE}.
210 * Kernel packages were renamed from linux-${MACHINE} to linux-dreambox.
211 * Support for machines based on ATI Xilleon or IBM STB was dropped.
215 * Building on eCryptfs fails, because it doesn't support sufficiently long
216 filenames (eCryptfs bug #344878).
218 5 Building OpenDreambox
220 In the top level directory, there is a Makefile, which is used to set up build
221 directories and to fetch or update all used repositories. The Makefile can be
222 influenced by environment variables, either by specifing them on the
223 command-line or by storing them in a file called conf/make.conf. It is not
224 recommended to edit the Makefile directly in order to avoid conflicts with
227 When the Makefile is run for the first time, the following steps will be
229 * Creation of configuration files
231 * conf/opendreambox.conf
232 * build/${MACHINE}/conf/bblayers.conf
233 * build/${MACHINE}/conf/local.conf
234 * Update or checkout of Git repositories
241 Run make help to get a list of targets of the top level Makefile, together with
244 5.2 Configuration variables
246 5.2.1 BB_NUMBER_THREADS
248 Controls how many BitBake tasks may run at a time. Defaults to the number of
249 cores available on the build system. The number of cores is obtained from
250 /proc/cpuinfo. If this file is unavailable, the default value is 1.
254 Controls the target machine to build packages for. See section 1.2 for a list
255 of supported products.
259 Controls how many processes per recipe make may use. Defaults to the number of
260 cores available on the build system. The number of cores is obtained from
261 /proc/cpuinfo. If this file is unavailable, the default value is 1.
263 NOTE: If you see seemingly random build failures, try setting this variable to
266 5.3 Adding custom layers
268 It is possible to add custom layers to the build system. This can be done
269 globally and per machine. To add a layer globally, edit conf/bblayers-ext.conf.
270 To add a machine-specific layer, edit conf/bblayers-${MACHINE}-ext.conf.
271 Assuming that an additional layer is available at ${HOME}/custom-layer, the
272 entry to add to the file will look like this:
274 BBLAYERS =+ "${HOME}/custom-layer"
276 5.4 Adding custom options
278 It is possible to tweak a lot more options than those used by the Makefile by
279 editing conf/local-ext.conf or conf/local-${MACHINE}-ext.conf.
281 For example, if the firmware shall use the package feed built on the develoment
282 machine, which happens to be 192.168.1.1 and has a webserver configured to
283 point to tmp/deploy/ipk, a line like the following may be added:
285 DISTRO_FEED_URI = "http://192.168.1.1/${DISTRO}/${DISTRO_VERSION}"
287 In general, any variable in OpenEmbedded that uses weak assignment (?=) may be
288 overridden from these files.
290 The following sections list some commonly used options.
292 5.4.1 DISTRO_FEED_PREFIX
294 DISTRO_FEED_PREFIX specifies the name of the package update feed. This name may
295 be arbitarily chosen.
297 Default: DISTRO_FEED_PREFIX = "remote"
299 5.4.2 DISTRO_FEED_URI
301 DISTRO_FEED_URI specifies the URI of the package update feed.
303 Default: DISTRO_FEED_URI = "http://my-distribution.example/remote-feed/"
307 INHERIT specifies bbclasses to include from a configuration file. Usually, this
308 variable gets appended to by using the += operator.
310 The OpenDreambox distribution automatically appends "buildhistory recipe_sanity
313 Default: INHERIT = ""
317 Always build the latest versions of OpenDreambox-related projects from Git:
319 INHERIT += "opendreambox-autorev"
321 Remove temporary files of previous versions of a recipe before a newer version
324 INHERIT += "rm_old_work"
326 Remove temporary files of a recipe after it has been built and packaged
331 5.5 Setting up a build directory
333 To set up a build directory for e.g. DM 500 HD run make MACHINE=dm500hd. If
334 MACHINE=dm500hd has been set in conf/make.conf, you can simply run make with no
335 arguments instead. This will create and initialize the directory build/dm500hd.
337 5.6 Building a firmware image
339 To build a firmware image for e.g. DM 500 HD run make MACHINE=dm500hd image. If
340 MACHINE=dm500hd has been set in conf/make.conf, you can simply run make image
343 5.7 Building a package
345 To build a single package, BitBake has to be used directly. First, the
346 environment has to be set up, in order to make BitBake available to the shell.
347 This can be done with the following command:
351 BitBake must be run from the machine's build directory. For DM 500 HD run:
355 In order to build enigma2, run:
361 6.1 Cross-compilation of external software
363 OpenDreambox provides a script called cross-compile.env. Once run, the script
364 will create the following commands (shell aliases), aiming to ease
365 cross-compilation of external source trees:
366 * oe_autoreconf - Calls OE's version of autoreconf. Useful for projects based
368 * oe_runconf - Calls ./configure with parameters suitable for OE. Useful for
369 projects based on GNU autotools.
370 * oe_runmake - Calls make with parameters suitable for OE. Useful for
371 projects based on GNU autotools or GNU make.
372 * oe_env - Useful to execute arbitrary commands in the OE environment (e.g.
374 * oe_setenv - Exports the OE environment to the currently running shell
377 The script needs to know the target machine, which can be one of the supported
378 products (see 1.2). Because the script adds aliases to your currently running
379 shell session, it has to be invoked using source or . (the dot operator), e.g.:
381 source cross-compile.env dm7020hd
383 The script may be called from any location, but must reside inside the
384 OpenDreambox Git tree. You may want to create a symlink to cross-compile.env
385 somewhere in your PATH.
389 Run scripts/do_stylize.sh on new recipes to ensure proper coding style.
391 6.3 Package architecture
393 Set PACKAGE_ARCH = "${MACHINE_ARCH}" if either condition is met:
394 * The recipe uses COMBINED_FEATURES, MACHINE_FEATURES or DREAMBOX_FEATURES.
395 * The recipe is part of meta-bsp.
397 7 Bug reports and patches
399 Please send bug reports and patches to the Enigma2 development mailing list
400 <enigma2-devel@lists.elitedvb.net>.
402 A comfortable way to create patches is to use git format-patch, after all
403 changes have been committed to your local copy of the repository.