Repository navigation
OpenEmbedded tips & tricks
Beauty of OpenEmbedded is in many things among which:
- Layers which may add new packages, scripts configs to underlying layers or equally well modify pretty much everything defined in underlying layers.
-
local.conffile used for fine-tuning existing build. Again it allows to specify or override settings otherwise provided by used recipes.
And here we'll provide some interesting and useful examples.
By default OE will use Binutils and GCC defined in openembedded-core:
- Binutils: https://github.com/openembedded/openembedded-core/tree/master/meta/recipes-devtools/binutils
- GCC: https://github.com/openembedded/openembedded-core/tree/master/meta/recipes-devtools/gcc
These are upstream releases (version depend on OE branch is used, in master it will be the most recent release) with a couple of patches with critical fixes on top of them.
But there might be a need to use a different component version. In case of ARC we have our forks of both Binutils and GCC on GitHub which differ from upstream releases by some amount of not yet upstreamed or not yet accepted in upstream changes. This is especially interesting in between releases of upstream tools as we may have quite a few changes with important fixes which are essentially not yet a part of the upstream release and not yet pack-ported a separate patches to OE.
So to use ARC tools just mention in your conf/local.conf:
BINUVERSION = "arc"
GCCVERSION = "arc"
Note it's perfectly possible to specify only BINUVERSION or GCCVERSION.
Again in your conf/local.conf add:
DISTRO_FEATURES_append = " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
Note that in OE systemd requires support of cgroups in the Linux kernel, otherwise on boot you'll see:
Freeing unused kernel memory: 23176K
This architecture does not have kernel memory protection.
[!!!!!!] Failed to mount API filesystems, freezing.
To enable support of cgroups in the kernel fire-up kernel configuration utility bitbake virtual/kernel -c menuconfig and select at least CONFIG_CGROUPS.
Normally in case of embedded systems we prefer to build all binaries for our tiny target on powerful host machine using so-called cross-compilation.
But sometimes we may want to have a toolchain installed on the target so we may build at least simple applications right there without host invocation. This toolchain sometimes referenced as "native" toolchain because it produces binaries for the same machine where it is being run.
To get that "native" toolchain built by OE and installed on the target just add EXTRA_IMAGE_FEATURES += "dev-pkgs tools-sdk" to your conf/local.conf. Note though that in default conf/local.conf there's already EXTRA_IMAGE_FEATURES ?= "debug-tweaks" and if it gets defined above by the user then debug-tweaks will be effectively omitted from IMAGE_FEATURES and among other things root password will be required for loggin in.. but since [most probably] root password was never set the user won't be able to login at all into the target.
Or even better build build-appliance-image - an image containing entire build-system (i.e. it might rebuild itself right on target).