Skip to content

otamaker: payload source paths in YAML comments #223

Closed

Description

@learmj

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. pelwell commented on Nov 2, 2026

    @pelwell
    Collaborator

    Please take a look at #224, which should implement the changes you requested.

  2. learmj commented on Nov 3, 2026

    @learmj
    Author

    Thanks Phil. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions