-
Notifications
You must be signed in to change notification settings - Fork 116
feat(edit): configure /usr overlay #1258
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks again for working on this!
7361768
to
4e8ec8b
Compare
Closes bootc-dev#474 Displays the status of the usroverlay within bootc status. Although not ideal, handles the displaying of the host's filesystem within the image/ostree functions since otherwise it may require the introduction of another "host" block within the status output (i.e. having a "host", "staged", "booted" and "rollback"). Signed-off-by: Robert Sturla <[email protected]>
4e8ec8b
to
02a2578
Compare
Allows setting the usrOverlay within "bootc edit". Since there's no clean ways (that I'm aware of) for switching back from a writable /usr to a readonly one, this follows the recommended commands in the docs, and lazily unmounts /usr. Signed-off-by: Robert Sturla <[email protected]>
d4398b2
to
2162466
Compare
Signed-off-by: Robert Sturla <[email protected]>
2162466
to
07509f6
Compare
This PR has been updated to also include changing the /usr overlay within Overall, I'm quite pleased with how it turned out as it seems to fit the brief. Certainly learned a lot from this one, even if it is quite basic. Please do let me know all the small (or large) things that could be done to improve 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.
Again sorry about the delay in review, it's my bad for not getting back to this earlier. The code looks good!
Same as the other PR though it will need a rebase for the status unit test.
(Add stateroot: default
to the ostree
section)
@@ -129,6 +129,21 @@ pub(crate) fn mount(dev: &str, target: &Utf8Path) -> Result<()> { | |||
) | |||
} | |||
|
|||
pub fn unmount(target: &Utf8Path, lazy: bool) -> Result<()> { |
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.
This is OK as is because we are already forking in other places but my thought lately is we should really just switch to direct syscalls.
@@ -363,6 +372,7 @@ fn human_render_imagestatus( | |||
mut out: impl Write, | |||
slot: Slot, | |||
image: &crate::spec::ImageStatus, | |||
host: &crate::spec::HostStatus, |
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.
@cgwalters Would you be able to explain what you meant by this please?
This was in relation to passing through BootEntry instead of HostStatus to the render functions.
we could pass down the metadata ultimately from ostree_deployment_get_unlocked() here.
#1291 (comment)
I've been trying to wrap my head around how to get the unlocked state from only the Slot, ImageStatus and BootEntry, but can't figure it out. Unless you're thinking of adding another function input for the usrOverlay status (though this doesn't seem as scalable - especially if you're also wanting to display information about the stateroot or rootfs)?
(No rush - I'm logging off for the day and will look at this after work tomorrow)
Closes #474
Allows the operator to control the /usr overlay from
bootc edit
, and displays the current configuration withinbootc status
.Also updates the
bootc usr-overlay
to use the new overlay functions, but this should be non-breaking.I've added a "best effort" functionality to
umount /usr
, though this seems to be an ostree thing that's not really possible to do in a smooth way - every time I tried it, I received (device busy) errors and /usr remained r/w.Here's the outputs in both human and YAML output formats:
Screencast.From.2025-04-26.20-45-28.webm
As with my previous PRs, I am still extremely new to Rust, so please be harsh with the reviews. I will improve as I attempt more of these.