bootc icon indicating copy to clipboard operation
bootc copied to clipboard

feat(edit): configure /usr overlay

Open p5 opened this issue 8 months ago • 1 comments

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.

p5 avatar Apr 08 '25 22:04 p5

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.

p5 avatar Apr 26 '25 22:04 p5

Diff is quite large with this one. May pick this back up once the composefs stuff fully lands.

p5 avatar Oct 09 '25 19:10 p5