Description
At the moment, a payload's source file comes from a comment on the same line as its name, eg
- name: boot # boot.sparse
otamaker removes that comment before the YAML goes into the bundle.
I'd like to suggest an explicit key instead, for these reasons:
- Comments are expected to be inert. Neither the YAML spec nor any reader expects a comment to change behaviour. Someone tidying or rewording a comment can break packing without realising they've touched anything that matters.
- YAML tools drop comments. A contents file that is generated, templated or processed by yq, PyYAML or a formating util loses its source paths without any warning. That limits otamaker to hand-written input, which doesn't suit a tool meant to be driven by build systems.
- The failure is misleading. When the comment is missing, otamaker falls back to the payload name as the path, and the error is 'file boot not found'. The message doesn't point at a missing comment.
- Paths are resolved against the current directory. Whatever invokes otamaker has to cd into the directory holding the payloads first. The contents file can't sit somewhere else, and otamaker can't be run from somewhere else.
Suggestion: add an explicit build side key, eg source:, resolved relative to the contents file's directory. otamaker could strip that from the copy embedded in the bundle, as it does at the moment with the comment.
Re: 4, I'd like to suggest adding support for a different base/contents directory (eg similar to tar's -C). rpi-image-gen will soon support building the otamaker contents file from a user supplied template at image build time (see raspberrypi/rpi-image-gen#345), so generated input is about to become the normal case.
Activity
otamaker: Add a source: key and -C <dir> option
otamaker: Add a source: key and -C <dir> option
pelwell commentedon Nov 2, 2026
Please take a look at #224, which should implement the changes you requested.
otamaker: Add a source: key and -C <dir> option
otamaker: Add a source: key and -C <dir> option
learmj commentedon Nov 3, 2026
Thanks Phil. Much appreciated.