-
Notifications
You must be signed in to change notification settings - Fork 198
composefs: Support transient /etc, transient root, and volatile /var #2201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac40a80
initramfs: Fix overlay upper/work dir permissions to unblock unprivil…
cgwalters a0d1700
dracut/51bootc: Auto-install setup-root-conf.toml into initramfs
cgwalters afe7102
initramfs: Refactor overlay_transient to return detached fd
cgwalters dce85fe
status: Support transient root in composefs_booted()
cgwalters 4305d3d
generator: Add bootc-early-overlay-relabel for transient overlay SELi…
cgwalters 188b055
composefs: Support transient /etc, transient root, and volatile /var
cgwalters File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| # Inject base configuration files for CI testing of transient-root/etc/var configurations. | ||
| # Arguments: $1=variant, $2=baseconfigs (comma-separated, may be empty) | ||
| set -xeuo pipefail | ||
|
|
||
| VARIANT="${1:-}" | ||
| BASECONFIGS="${2:-}" | ||
|
|
||
| # No-op if no baseconfigs specified | ||
| if [ -z "${BASECONFIGS}" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # setup-root-conf.toml is composefs-specific; ostree uses prepare-root.conf | ||
| # which has a different (INI) format and different option names. | ||
| case "${VARIANT}" in | ||
| composefs*) | ||
| TARGET="/usr/lib/composefs/setup-root-conf.toml" | ||
| ;; | ||
| *) | ||
| echo "inject-baseconfig: baseconfigs not supported for variant '${VARIANT}'" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| mkdir -p "$(dirname "${TARGET}")" | ||
|
|
||
| # Split on commas and process each token | ||
| IFS=',' read -ra TOKENS <<< "${BASECONFIGS}" | ||
| for raw_token in "${TOKENS[@]}"; do | ||
| # Trim leading/trailing spaces | ||
| token="${raw_token#"${raw_token%%[![:space:]]*}"}" | ||
| token="${token%"${token##*[![:space:]]}"}" | ||
|
|
||
| [ -z "${token}" ] && continue | ||
|
|
||
| case "${token}" in | ||
| etc-transient) | ||
| printf '[etc]\ntransient = true\n' >> "${TARGET}" | ||
| ;; | ||
| root-transient) | ||
| printf '[root]\ntransient = true\n' >> "${TARGET}" | ||
| ;; | ||
| var-volatile) | ||
| # Mount /var as a fresh tmpfs on every boot via systemd.volatile=state. | ||
| # bootc-root-setup detects this karg in the initramfs and automatically | ||
| # skips the /var state bind-mount, leaving /var as an empty directory | ||
| # from the composefs image. systemd-fstab-generator then mounts a fresh | ||
| # tmpfs there at local-fs.target. Using a plain tmpfs avoids the | ||
| # overlayfs-on-overlayfs restriction that breaks tools like podman which | ||
| # use overlayfs under /var/lib/containers. | ||
| mkdir -p /usr/lib/bootc/kargs.d | ||
| printf 'kargs = ["systemd.volatile=state"]\n' \ | ||
| > /usr/lib/bootc/kargs.d/50-var-volatile.toml | ||
| ;; | ||
| *) | ||
| echo "Unknown baseconfig: ${token}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should probably use python scripts for stuff like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, or Rust (could do some xtask-style stuff here).