Repository navigation
install: Add --output-{json,pairs}-{path,fd} for the install result - #38
Closed
cgwalters-bot wants to merge 1 commit into
Closed
cgwalters-bot wants to merge 1 commit into
cgwalters-bot wants to merge 1 commit into
Conversation
This was referenced Oct 2, 2026
cgwalters
approved these changes
Oct 2, 2026
Installers wrapping `bootc install to-filesystem` need to know where the new deployment landed, typically to drop configuration into its /etc before the first boot, and today have to dig through the ostree or composefs layout for it. bootc already knows all of that at the end of the install, so let it write a small summary: backend, stateroot, the deployment, /etc and /var paths relative to the target, bootloader, and the target image with its digest. The format is JSON or "pairs" in the style of `lsblk --pairs --shell`, so that scripts without jq can just eval it; the destination is a path (replaced atomically) or an fd inherited from the caller. These are four flags rather than a format plus a destination option because each one reads unambiguously on its own; at most one may be given. Both destinations are validated before anything is installed. An fd must not be close-on-exec, which rules out a number the caller never passed but that happens to be open internally. A path's directory is opened up front and its fd carried across bootc's re-execs, since prepare_install may mount a tmpfs over /tmp and a path there would otherwise silently land in that. The options apply to to-disk and to-existing-root too, since they share the same install code. Ref: bootc-dev#542 Generated-by: AI Signed-off-by: Colin Walters <[email protected]>
Collaborator
Author
|
Signed off 1 commit(s) with |
cgwalters-bot
force-pushed
the
bot/install-output
branch
from
October 2, 2026 19:29
18a31b8 to
12a26b3
Compare
Collaborator
Author
|
Opened upstream as bootc-dev#2531. Closing this review draft. |
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.
Adds options to
bootc install to-filesystem(andto-disk,to-existing-root, which share the code) to write a machine-readable result once the install succeeded, as sketched in bootc-dev#542 (comment):At most one may be given. Pairs are
KEY="value"lines aslsblk --pairs --shell(one per line;",\,$and backtick are backslash-escaped as in os-release, soevalround-trips). Keys: backend, stateroot, deployment/etc/var paths relative to the target, bootloader, image, image transport and digest; JSON uses camelCase (etcPath), pairs upper snake case (ETC_PATH). A path is replaced atomically; an fd must be inherited (not close-on-exec) and writable, checked before anything is installed. The path's directory is opened up front and carried across bootc's re-execs, so/tmp/...doesn't silently land in the tmpfs bootc mounts there.Not covered:
install reset, which has its own flow.Testing, on a 16-core RHEL 10 devspace (AMD EPYC 7763; no fork CI):
just unit-testspassed (bootc-lib: 290, including 7 new ones covering pairs quoting with a realsheval round-trip, key names, rendering, and fd/path validation), and so didjust validate.plan-23-install-outside-container, extended to install with--output-json-pathand check the reported deployment,/etc(a file written viabootc install mountis found underetcPath),/var, image and digest, plus that an fd the caller didn't pass is rejected before installing: passed for the ostree variant and for composefs (grub, ext4, BLS).bcvk ephemeralVM:podman run --privileged --preserve-fds 1 localhost/bootc bootc install to-disk --output-pairs-fd 3 ... 3>&1 >&2intopairs=$(...), theneval "$pairs"; the reported$ETC_PATH,$VAR_PATHand$DEPLOYMENT_PATH/usrexisted on the installed disk.xref bootc-dev#542
Generated-by: https://github.com/cgwalters/#llms
Review draft in cgwalters-forge, not upstream yet. This section is removed when the PR is opened upstream.
bootc-dev/bootc, basemainPVTI_lADOE9oHIs4BlJLczg-Ke4cTo review:
/promoteon a line of its own, to open it upstream, ready for review. Either covers only the commits pushed so far.Signed-off-by: Colin Walters <[email protected]>to the commits lacking it (the bot's and yours; anyone else's only if you ask), with you as committer./draftline (in the same comment or before) to open it upstream as a draft (/readyundoes that).