This building block provides a way to build your yocto project either locally with dobi or via ci/cd concourse pipeline. In both cases the image is build in a containerized environment. It contains an example to build a poky/openembedded yocto image with systemd as system and service manager. It currently uses the long term support yocto release "dunfell".
dobi should only be used via the dobi.sh script, because there important variables are set and the right scripts are included.
The following dobi resources are available:
./dobi.sh build-qemuarm-core-image-minimal #build qemuarm core-image-minimal
./dobi.sh buildimage #generate container image with all yocto build dependencies
./dobi.sh clean #clean yocto build and deploy directory
./dobi.sh clean-all #clean yocto build, deploy and source directory
./dobi.sh interactive-build-shell #run interactive build shell
./dobi.sh run-qemuarm-core-image-minimal-interactive #run qemuarm core-image-minimal
./dobi.sh version #generate version informations (auto called by dobi.sh)The yocto build artefacts images, licenses and rpm are located in ./gen/yocto-deploy.
Version informations are generated automatically from git history by using building block bb-gitversion (https://github.com/elbb/bb-gitversion).
./dobi.sh run-qemuarm-core-image-minimal-interactivewill run the yocto core-image-minimal for target qemuarm in a docker container. Login as root without password. To exit this test environment stop the qemu machine, via
poweroff
Edit ./default.env to set default project variables.
If you want to override project variables, copy ./local.env.template to ./local.env and edit ./local.env accordingly.
./local.env is ignored by git via ./.gitignore.
Clone this repository.
git clone https://github.com/elbb/bb-yocto-builder.git
kas is used to configure and build the yocto image.
An example minimal configuration is located in directory ./kas. The example uses the poky distribution to build core-image-minimal for target qemuarm.
Follow the upstream documentation at https://kas.readthedocs.io to configure your yocto project.
To start an interactive build shell, run \
./dobi.sh interactive-build-shellE.g. to build core-image-minimal for target qemuarm, type:
kas build poky.yaml:qemuarm.yamlTo set an out of tree yocto download or sstate directory, follow "Local project variables" and set BB_YOCTO_DL_DIR and/or BB_YOCTO_SSTATE_DIR.
The pipeline file must be uploaded to concourse CI via fly.
Enter the build users ssh private key into the file ci/credentials.template.yaml and rename it to ci/credentials.yaml.
Copy the file ci/email.template.yaml to ci/email.yaml and enter the email server configuration and email addresses.
For further information how to configure the email notification, see: https://github.com/pivotal-cf/email-resource
Note: credentials.yaml and email.yaml are ignored by .gitignore and will not be checked in.
In further releases there will be a key value store to keep track of the users credentials.
Before setting the pipeline you might login first to your concourse instance fly -t <target> login --concourse-url http://<concourse>:<port>. See the fly documentation for more help.
Upload the pipeline file with fly:
$ fly -t <target> set-pipeline -n -p bb-yocto-builder -l ci/config.yaml -l ci/credentials.yaml -l ci/email.yaml -c ci/pipeline.yaml
After successfully uploading the pipeline to concourse CI login and unpause it. After that the pipeline should be triggered by new commits on the master branch (or new tags if enabled in pipeline.yaml).
ERROR: No space left on device or exceeds fs.inotify.max_user_watches?Check inotify.max_user_watches with:
sysctl -n fs.inotify.max_user_watchesWhen this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.
You can set a new limit temporary with:
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -pIf you like to make your limit permanent, use:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -pIf you have memory requirements for the running qemuarm image instance in dobi job run-qemuarm-core-image-minimal-interactive, you can adapt QEMUPARAMS in local.env , e.g.
QEMUPARAMS="-m 1024"
sets the available memory to 1024MB.
embedded linux building blocks is a project to create reusable and adoptable blueprints for highly recurrent issues in building an internet connected embedded linux system.
Licensed under either of
- Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Copyright (c) 2020-2021 conplement AG
