Skip to content

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

p5
Copy link
Contributor

@p5 p5 commented Apr 8, 2025

Closes #474

Allows the operator to control the /usr overlay from bootc edit, and displays the current configuration within bootc 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:

❯ sudo ./target/debug/bootc status 
● Booted image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
       Version: 250425 (2025-04-25T01:46:32Z)

  Rollback image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
          Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
         Version: 250425 (2025-04-25T01:46:32Z)

❯ sudo ./target/debug/bootc status              
[sudo] password for admin: 
  Staged image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
       Version: 250425 (2025-04-25T01:46:32Z)

● Booted image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        Digest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e (amd64)
       Version: 250425 (2025-04-25T01:46:32Z)
  /usr overlay: read-write

  Rollback image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
          Digest: sha256:90fd7bc0675e923511a6edabb2e584f752feddbf8f90e0d610f7fc63d3e03f23 (amd64)
         Version: 250423 (2025-04-23T01:46:06Z)

❯ sudo ./target/debug/bootc status --format yaml
apiVersion: org.containers.bootc/v1
kind: BootcHost
metadata:
  name: host
spec:
  image:
    image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
    transport: registry
    signature: containerPolicy
  bootOrder: default
  usrOverlay: readWrite
status:
  staged:
    (...)
  booted:
    image:
      image:
        image: ghcr.io/rsturla/eternal-linux/lumina:42-nvidia-open
        transport: registry
        signature: containerPolicy
      version: '250425'
      timestamp: 2025-04-25T01:46:32Z
      imageDigest: sha256:b1874fbb5f442657f3cc07a547c54292ca3f24fe828ab4f3132df4c9f23f1e3e
      architecture: amd64
    cachedUpdate: null
    incompatible: false
    pinned: false
    store: ostreeContainer
    ostree:
      checksum: cac59f70910b5ef683d1e6589609789d104d206c18089efa14b51619466cfe17
      deploySerial: 0
  rollback:
    (...)
  rollbackQueued: false
  usrOverlay: readWrite
  type: bootcHost
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.

Copy link
Collaborator

@cgwalters cgwalters left a 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!

@p5 p5 force-pushed the 474-status-usroverlay branch from 7361768 to 4e8ec8b Compare April 26, 2025 19:18
@p5 p5 changed the title feat(status): display usroverlay state in status feat(edit): configure /usr overlay Apr 26, 2025
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]>
@p5 p5 force-pushed the 474-status-usroverlay branch from 4e8ec8b to 02a2578 Compare April 26, 2025 19:27
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]>
@p5 p5 force-pushed the 474-status-usroverlay branch 2 times, most recently from d4398b2 to 2162466 Compare April 26, 2025 19:48
@p5 p5 marked this pull request as ready for review April 26, 2025 21:43
@p5 p5 force-pushed the 474-status-usroverlay branch from 2162466 to 07509f6 Compare April 26, 2025 22:03
@p5
Copy link
Contributor Author

p5 commented Apr 26, 2025

This PR has been updated to also include changing the /usr overlay within bootc edit.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bootc status does not report unlocked status
2 participants