store: Support read-only /sysroot on a live ISO#2275
Open
cgwalters wants to merge 1 commit into
Open
Conversation
We want to support at least read-only operation when mounted from a physically read-only medium (like a squashfs/EROFS for /sysroot). Check the backing block device status, and propagate its read-only state up. Generated-by: AI Signed-off-by: Colin Walters <walters@verbum.org>
fd89199 to
ee4ddc2
Compare
Johan-Liebert1
requested changes
Jul 3, 2026
| pub(crate) fn require_writable(&self) -> Result<()> { | ||
| anyhow::ensure!( | ||
| !self.is_ro, | ||
| "Cannot perform this operation: /sysroot is on a read-only block device (e.g. a live ISO)" |
Collaborator
There was a problem hiding this comment.
Nit: This one just feels like the LLM taking things too literally
Suggested change
| "Cannot perform this operation: /sysroot is on a read-only block device (e.g. a live ISO)" | |
| "Cannot perform this operation: /sysroot is on a read-only block device" |
| } | ||
|
|
||
| // The mount is read-only but the device is writable: this is the normal | ||
| // ostree case where /sysroot is mounted read-only by default. Remount it |
Collaborator
There was a problem hiding this comment.
Here and a few places else: we shouldn't only be mentioning ostree as the composefs backend also does the same
| let d = Dir::open_ambient_dir("/sysroot", cap_std::ambient_authority()) | ||
| .context("Opening /sysroot")?; | ||
| let is_ro = sysroot_is_read_only(&d)?; | ||
| let physical_root = d.open_dir(".").context("Opening /sysroot")?; |
Collaborator
There was a problem hiding this comment.
Do we need to reopen sysroot here?
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.
We want to support at least read-only operation when mounted from a physically read-only medium (like a squashfs/EROFS for /sysroot).
Check the backing block device status, and propagate its read-only state up.
Generated-by: AI