Open Source Summit 2k18 (Paris)
The Yocto Project (YP) is an open source collaboration project that helps developers create custom Linux-based systems regardless of the hardware architecture. The project provides a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations, and best practices that can be used to create tailored Linux images for embedded and IOT devices, or anywhere a customized Linux OS is needed.
This is a poky (v2.5 | sumo) container to build your own Linux image for whatever kind of architecture.
To run the docker container execute:
$ ./set.sh
This bash script (to use at your own risk if you have sensitive data on your system) will:
- build locally the Docker image
- cleanup your system
⚠️ - create the bridge network
- run the container with
docker-compose
[¹] the container will leave in background also if you exit, so to access again execute: docker exec -it yocto zsh
.
To save time if you want to run a pre-built image execute directly:
$ ./run.sh
[²] the container will be removed when you exit.
All the data created with poky are persistent and stored in the volume poky
.
Inside your host machine you can easily find under the path: /var/lib/docker/volumes/poky
.
To boot the yocto images inside the poky container it's necessary to add the device /dev/net/tun
from the host machine with the flag --device=/dev/net/tun
.
To run the yocto image it's necessary to share the X11 socket as a volume.
Once you're inside the container, you can test your yocto environment in this way:
$ cd poky
$ source oe-init-build-env qemux86-build
$ bitbake core-image-minimal # requires a long time ...
$ runqemu qemux86
If the bitbake
process ends up fine you should be able to boot your first x86_64 Linux image built with yocto, using the core-image-minimal layer, and see something like this:
Happy hacking!
For more info check out the official doc:
or take a look at the cheat sheet:
This work is licensed under the terms of GNU General Public License v3.0.