Skip to content

mmdebstrap: expand environment variables in mirror paths#22

Open
learmj wants to merge 1 commit intobdrung:mainfrom
learmj:main
Open

mmdebstrap: expand environment variables in mirror paths#22
learmj wants to merge 1 commit intobdrung:mainfrom
learmj:main

Conversation

@learmj
Copy link
Copy Markdown

@learmj learmj commented Mar 10, 2026

Apply env variable expansion to each mirror entry before passing it to mmdebstrap. This allows mirror paths to contain environment variable references such as ${ROOT}/path/to/file.sources, which is useful when specifying DEB822 sources files via an absolute path derived from a build system variable.

Apply env variable expansion to each mirror entry before passing it to
mmdebstrap. This allows mirror paths to contain environment variable
references such as ${ROOT}/path/to/file.sources, which is useful when
specifying DEB822 sources files via an absolute path derived from a
build system variable.

Signed-off-by: Matthew Lear <matthew.lear@raspberrypi.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.00%. Comparing base (03fcee1) to head (c406351).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #22   +/-   ##
=======================================
  Coverage   97.00%   97.00%           
=======================================
  Files          13       13           
  Lines         901      901           
  Branches        5        5           
=======================================
  Hits          874      874           
  Misses         25       25           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

learmj added a commit to learmj/rpi-image-gen that referenced this pull request Mar 12, 2026
Replace one-liner mirror entries in layers with paths to deb822
.sources templates. A template can carry an X-IG-Signed-By field
naming the keyring path used to authenticate the repository at runtime.

Add a bdebstrap patch to support env var expansion in the mirror list
processing, allowing ${IGTOP} relative paths to be used in YAML mirror
entries. Ref: bdrung/bdebstrap#22

A new cleanup hook runs after all apt operations are complete. It reads
X-IG-Signed-By from each .sources file in the chroot's
/etc/apt/sources.list.d/, verifies the corresponding keyring is present
in the chroot, then injects the Signed-By field into every stanza so the
mirror will be authenticated by that keyring at run-time.

The customize-packages and customize-initramfs hooks have also been
renumbered to reduce the 'compression gap' between them.

Regarding usage of X-IG-Signed-By in the new deb822 templates:

- The Debian Policy Manual [1] documents the X- convention, but
  explicitly only for debian/control source package template files.
- sources.list(5) states "unsupported options are silently ignored by
  all APT versions", which covers our use-case in practice.
- The repolib project uses X-Repolib-Name in .sources files for the same
  purpose [2]. This provides a precedent, but it's not a specification.

Refs:
[1] https://www.debian.org/doc/debian-policy/ch-controlfields.html#user-defined-fields
[2] https://repolib.readthedocs.io/en/latest/deb822-format.html#repolib-specific-deb822-fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant