Metadata
File Layout OpenEmbedded has six directories three of them hold BitBake metadata. The conf directory is holding the bitbake.conf, machine and distribution configuration. bitbake.conf is read when BitBake is started and this will include among others a local.conf the machine and distribution configuration files. These files will be searched in the BBPATH environment variable. classes is the directory holding BitBake bbclass. These classes can be inherited by the BitBake files. BitBake automatically inherits the base.bbclass on every parsed file. BBPATH is used to find the class. In packages the BitBake files are stored. For each task or application we have a directory. These directories store the real BitBake files. They are the ones ending with .bb. And for each application and version we have one.
Syntax OpenEmbedded has files ending with .conf, .inc, .bb and.bbclass. The syntax and semantic of these files are best described in the BitBake manual.
Classes OpenEmbedded provides special BitBake classes to ease compiling, packaging and other things. FIXME.
Writing Meta Data (Adding packages) This page will guide you trough 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 other 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 to 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: a6434b0fc8a54c3dec3d6875bf3be8mtn Notice the ${P} variable, that one 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.