Skip to content

Yocto Open Embedded

sipke edited this page Jul 5, 2018 · 7 revisions

Releases download

http://downloads.yoctoproject.org/releases/yocto/

Build Info

To include /etc/build in your image, modify local.conf or layer.conf with

INHERIT += "image-buildinfo"

MAGE_BUILDINFO_VARS = "DISTRO DISTRO_VERSION MACHINE IMAGE_NAME USER".

https://mender.io/blog/build-info-yocto-2

Nice links

http://events17.linuxfoundation.org/sites/events/files/slides/ELC%202016%20-%20Designing%20a%20distro%20from%20scratch%20using%20OpenEmbedded.pdf

https://www.yoctoproject.org/docs/what-i-wish-id-known/

http://linuxgizmos.com/the-best-way-to-build-with-yocto-project-and-bitbake/

Examples

vardepsexclude

An example of vardepsexclude is in poky/meta/recipes-core/os-release/os-release.bb, where the BUILD_ID defaults to DATETIME variable. If that was not included as a vardepsexclude there would be parse errors.

VERSION_ID = "${DISTRO_VERSION}"
PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
BUILD_ID ?= "${DATETIME}"
BUILD_ID[vardepsexclude] = "DATETIME"

Versioning your distro/image

poky/meta/recipes-core/os-release/os-release.bb

Produces the /etc/os-release file based on some conf/distro/<your-distro>.bb variables.

Example tmp disk usage

Openembedded builds a lot of things, you'll need decent disk space. Here's an example of a typical build tmp directory.

du -h -d1 tmp/
844K  tmp/log
87M   tmp/stamps
4.0K  tmp/hosttools
29M   tmp/cache
16K   tmp/sysroots
19M   tmp/buildstats
17M   tmp/sstate-control
9.6G  tmp/deploy
1.6G  tmp/work-shared
38G   tmp/work
23M   tmp/sysroots-components
8.0M  tmp/pkgdata
60M   tmp/sysroots-uninative
49G   tmp/

Creating multiple packages using FILES_

A recipe can (and usually does) produce more than one package. The system isn't completely stupid so for example all the headers will automatically go into -dev package and all documentation goes into -doc, but often the recipe writer needs to make a decision on which package a specific file belongs to. This is done with the FILES_<packagename> += "/path/to/file" format.

The default values for FILES_* can be found in meta/conf/bitbake.conf but note that classes your recipe inherits may also modify the values: check the final values with bitbake -e <recipe>|grep ^FILES_

Courtesy of https://stackoverflow.com/questions/46071039/an-example-of-using-files-pn

Clone this wiki locally