Automated review of Yocto Project and OpenEmbedded patches. Phase 1 runs the checks OpenEmbedded already has, and reports only what a patch series adds:
- patchtest (OE-Core): commit message, shortlog, Signed-off-by, and the
Upstream-Status,Signed-off-byandCVE:headers of added.patchfiles; - oelint-adv: recipe, class, include and configuration style and correctness rules;
- shellcheck: shell in task functions and shipped scripts, run as
/bin/sh, which is dash on many hosts; - leftover files: patch files a series drops from
SRC_URIbut leaves in the layer; - line length, license changes and CVE_CHECK_IGNORE: added lines over
200 characters, LIC_FILES_CHKSUM changes without a
License-Update:line, and added CVE_CHECK_IGNORE after kirkstone, as patchtest's metadata suite reports them; - documentation (yocto-docs, BitBake manual): the Sphinx build, sphinx-lint, and yocto-docs' check-glossaries and check-confusables.
Each checker runs on the tree before and after the series, so existing
problems are not blamed on the author. See designs/DESIGN.md
for the design and docs/STATUS.md for the current state.
bodnuti check --repo <layer checkout> <Message-ID | lore URL | mbox files...>
- A Message-ID or lore URL is fetched with
b4 mbox. mbox files can be one b4 mbox or onegit format-patchfile per patch. - The base is
--base, else a branch named by a subject tag such as[scarthgap], elseorigin/HEAD. - patchtest comes from an openembedded-core checkout:
--oecore, defaulting to--repo. --jsonprints the full report as JSON.
Exit status: 0 clean, 1 findings, 2 a checker could not run or bad input.
pyproject.toml packages the binary as a Python wheel with
maturin. The wheel pulls in oelint-adv, b4 and
patchtest's requirements; the docs extra adds Sphinx and sphinx-lint.
pip install maturin
maturin build --release
python3 -m venv ~/.venvs/bodnuti
~/.venvs/bodnuti/bin/pip install 'target/wheels/bodnuti-<version>-<platform>.whl[docs]'
~/.venvs/bodnuti/bin/bodnuti check --repo <layer> <Message-ID>
The venv does not need to be activated: bodnuti uses the python3,
oelint-adv and b4 installed beside it. b4 depends on pygit2, which may
have no prebuilt wheel for the newest Python release; use the release before
it if pip tries to compile pygit2.
The image carries oelint-adv, b4, shellcheck, patchtest's Python
requirements, and Sphinx with the extensions yocto-docs uses. Mount a clone
of the layer that bodnuti may write worktrees into, not your working
checkout. It must not be a git clone --shared of a host repository: its
object alternates point at host paths the container cannot see. For layers
other than openembedded-core, also mount an openembedded-core checkout for
patchtest and set BODNUTI_OECORE to it:
docker build -t bodnuti -f Containerfile .
docker run --rm \
-v ~/cache/openembedded-core:/repo \
bodnuti check --repo /repo '<20261023192932.159420-1-peter.marko@siemens.com>'
For a server deployment with rootless Podman, a read-only container and no
network during checks, see docs/DEPLOY.md.
Install oelint-adv, b4, patchtest's requirements
(meta/lib/patchtest/requirements.txt) and, for documentation, the packages
in yocto-docs' documentation/Pipfile plus sphinx-lint, in one venv. Point
bodnuti at it with --python, --oelint and --b4 (or BODNUTI_PYTHON,
BODNUTI_OELINT, BODNUTI_B4). shellcheck runs from its container image by default; set
--shellcheck shellcheck to use a local binary.
Each release's wheels and container image carry SLSA build provenance and an SPDX 2.3 SBOM, both signed through Sigstore by the Release workflow, and the image a keyless cosign signature. The wheels' SBOM lists the Rust crates in the bodnuti binary; the image's, one per platform, its Debian, Python and Go packages. The SBOMs are also attached to the GitHub release.
gh attestation verify bodnuti-0.2.0-py3-none-manylinux_2_28_aarch64.whl --repo moto-timo/bodnuti
gh attestation verify oci://ghcr.io/moto-timo/bodnuti:0.2.0 --repo moto-timo/bodnuti
cosign verify ghcr.io/moto-timo/bodnuti:0.2.0 \
--certificate-identity-regexp '^https://github.com/moto-timo/bodnuti/\.github/workflows/release\.yml@refs/tags/v' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify oci://ghcr.io/moto-timo/bodnuti:0.2.0 --repo moto-timo/bodnuti \
--predicate-type https://spdx.dev/Document/v2.3
The image of main, ghcr.io/moto-timo/bodnuti:main (and :main-<commit>),
is built, attested and signed the same way by the Main image workflow on
every push that changes what goes into it; its certificate names that
workflow and main:
cosign verify ghcr.io/moto-timo/bodnuti:main \
--certificate-identity https://github.com/moto-timo/bodnuti/.github/workflows/main-image.yml@refs/heads/main \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
The source has SLSA source provenance too: each push to main and each
tag gets a signed source provenance attestation and verification summary,
kept in git notes, which the
SLSA source tool checks:
sourcetool verify moto-timo/bodnuti --tag v0.2.0
bodnuti is licensed under either of the MIT license or the Apache License, Version 2.0, at your option. Unless you say otherwise, a contribution you submit for inclusion is licensed the same way, without further terms.
The container image also carries the tools bodnuti runs, each under its own license: among them shellcheck and cppcheck (GPL-3.0), trivy (Apache-2.0), oelint-adv (BSD-2-Clause), b4 (GPL-2.0), and the Debian packages of the base image.