mmdebstrap: expand environment variables in mirror paths#22
Open
learmj wants to merge 1 commit intobdrung:mainfrom
Open
mmdebstrap: expand environment variables in mirror paths#22learmj wants to merge 1 commit intobdrung:mainfrom
learmj wants to merge 1 commit intobdrung:mainfrom
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.