MetadataFile LayoutThe OpenEmbedded
directory, $OEBASE/openembedded/, has seven
directories, three of which hold
BitBake metadata.
classes/Contains BitBake.bbclass files. These classes can
be inherited by other BitBake
files. Every BitBake.bb file automatically inherits the
base.bbclass. BBPATH
is used to find the .bbclass files.
conf/Contains the configuration files for OpenEmbedded.
The bitbake.conf is read when
BitBake is started and this will
include the local.conf, the machine and
distribution configuration files, among others. These files
will be located using the BBPATH environment
variable as a search path.
contrib/Contains miscellaneous scripts that do not
belong in the other directories.
docs/Contains the source for the user manual and other
documentation files.
files/Contains setup tables for populating
the /dev directory of various target images.
recipes/Contains all of the
BitBake.bb
files. There is a subdirectory for each task or application
and within that subdirectory is
a BitBake.bb file
for each supported version of an application or task.
site/Contains site configuration files for
the autoconf/automake
system.
SyntaxOpenEmbedded has files ending with .conf,
.inc, .bb
and .bbclass. The syntax and semantics of these files
are best described in the BitBake
manual.ClassesOpenEmbedded provides special BitBake
classes to ease compiling, packaging and other things. FIXME.Writing Meta Data (Adding packages)This page will guide you through the effort of writing a .bb file or
recipe in BitBake speak.Let's start with the easy stuff, like the package description,
license, etc:
DESCRIPTION = "My first application, a really cool app containing lots of foo and bar"
LICENSE = "GPLv2"
HOMEPAGE = "http://www.host.com/foo/"
The description and license fields are mandatory, so
better check them twice.The next step is to specify what the package needs to build and run,
the so called dependencies:
DEPENDS = "gtk+"
RDEPENDS = "cool-ttf-fonts"
The package needs gtk+ to build ('DEPENDS') and
requires the 'cool-ttf-fonts' package to run ('RDEPENDS'). OE will add
run-time dependencies on libraries on its own via the so called
shlibs-code, but you need to specify everything else
by yourself, which in this case is the 'cool-ttf-fonts' package.After entering all this OE will know what to build before trying to
build your application, but it doesn't know where to get it yet. So let's
add the source location:
SRC_URI = "http://www.host.com/foo/files/${P}.tar.bz2;md5sum=yoursum"
This will tell the fetcher where to download the
sources from and it will check the integrity using md5sum if you provided
the appropriate yoursum. You can make one by doing
md5sum foo-1.9.tar.bz2 and replacing
yoursum with the md5sum on your screen. A typical
md5sum will look like this: a6434b0fc8a54c3dec3d6875bf3be868 Notice
the ${P} variable holds the package name
(${PN} in BitBake speak) and the package version
(${PV} in BitBake speak). It's a short way of writing
${PN}-${PV}. Using this notation means you can copy
the recipe when a new version is released without having to alter the
contents. You do need to check if everything is still correct, because new
versions mean new bugs.Before we can move to the actual building we need to find out which
build system the package is using. If we're lucky, we see a
configure file in the build tree this is an indicator
that we can inherit autotools if we see a
.pro file, it might be qmake, which needs
inherit qmake. Virtually all gtk apps use autotools:
inherit autotools pkgconfig
We are in luck! The package is a well-behaved
application using autotools and pkgconfig to configure and build it
self.Lets start the build: bitbake foo
Depending on what you have built before and the
speed of your computer this can take a few seconds to a few hours, so be
prepared..... some time goes by .....Your screen should now have something like this on it:
NOTE: package foo-1.9-r0: task do_build: completed
NOTE: package foo-1.9: completed
NOTE: build 200605052219: completed
All looks well, but wait, let's scroll up:
NOTE: the following files where installed but not shipped:
/usr/weirdpath/importantfile.foo
OE has a standard list of paths which need to be
included, but it can't know everything, so we have to tell OE to include
that file as well:
FILES_${PN} += "/usr/weirdpath/importantfile.foo"
It's important to use += so it
will get appended to the standard file-list, not replace the standard
one.