Skip to content

Conversation

bshephar
Copy link
Contributor

@bshephar bshephar commented Sep 4, 2025

This change updates the /run/reboot-required file to include information
about the staged bootc image. This will provide users with information
about what bootc image will be effective after the system has been
rebooted.

Fixes #1574

@bootc-bot bootc-bot bot requested a review from cgwalters September 4, 2025 12:44
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 for picking this up!

@bshephar bshephar changed the title Add helper function to write reboot-required message Update reboot-required file with information about the staged image Sep 4, 2025
@bshephar
Copy link
Contributor Author

bshephar commented Sep 4, 2025

I didn't realize that we were already creating this file, so this change is much more simple than I had initially planned. I think it should always be updated in that stage function, so we don't need a helper and to handle it for each operation.

@bshephar bshephar marked this pull request as ready for review September 4, 2025 23:52
@bootc-bot bootc-bot bot requested a review from cgwalters September 4, 2025 23:53
@bshephar
Copy link
Contributor Author

bshephar commented Sep 5, 2025

Result looks like:

❯ sudo target/release/bootc upgrade
layers already present: 67; layers needed: 1 (695.2 MB)
Fetched layers: 662.96 MiB in 34 seconds (19.51 MiB/s)
  Deploying: done (6 seconds)
Queued for next boot: ghcr.io/bshephar/fedora-asahi-bootc:42
  Version: 42.20250904.0
  Digest: sha256:8ea48cc32573500a367526e687cd61510859e097df82402bf352d98da755c6c9
Total new layers: 68    Size: 3.2 GB
Removed layers:   1     Size: 688.5 MB
Added layers:     1     Size: 695.2 MB
❯ cat /run/reboot-required
Reboot required for bootc image: ghcr.io/bshephar/fedora-asahi-bootc:42

I guess if this was a bootc switch instead of a bootc upgrade it would be more useful, because the image would be different to the one I'm currently running. But because I have used a tag, this is always just going to say the same thing. Do we feel like that is still valuable? Or, do we realistically want the context of which operation has staged the image?

Maybe there's something more informative than just &spec.image.image like I'm using here?

Edit: Maybe image.manifest_digest.as_ref() would be better here actually:
https://github.com/bootc-dev/bootc/blob/main/crates/lib/src/deploy.rs#L668

Using the digest looks like:

❯ cat /run/reboot-required
Reboot required for bootc image digest: sha256:c0aaf49e1df7ec2f4baa4ed8077b684cad36820381f1a7511247558fb35e2bea%

@bshephar bshephar force-pushed the reboot-required branch 2 times, most recently from 1fec49b to bdd40e4 Compare September 5, 2025 04:52
This change updates the /run/reboot-required file to include information
about the staged bootc image. This will provide users with information
about what bootc image will be effective after the system has been
rebooted.

Fixes bootc-dev#1574
Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
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!

@cgwalters cgwalters enabled auto-merge September 5, 2025 13:06
@cgwalters cgwalters merged commit 84aba8e into bootc-dev:main Sep 5, 2025
16 of 27 checks passed
bshephar added a commit to bshephar/bootc that referenced this pull request Sep 6, 2025
This change adds a function that writes the /run/reboot-required file,
this function is called from any deployment operation with the relevant
context. Calling from rollback will ensure the rollback context along
with the image reference is written to the file, while calling from
upgrade or switch will write the deploy context for users to reference.

This expands on the functionality requested in: bootc-dev#1574
Related to: bootc-dev#1583

Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
bshephar added a commit to bshephar/bootc that referenced this pull request Sep 6, 2025
This change adds a function that writes the /run/reboot-required file.
This function is called from any deployment operation with the relevant
context. Calling from rollback will ensure the rollback context along
with the image digest is written to the file, while calling from
upgrade or switch will write the deploy context for users to reference.

This expands on the functionality requested in: bootc-dev#1574
Related to: bootc-dev#1583

Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
bshephar added a commit to bshephar/bootc that referenced this pull request Sep 6, 2025
This change adds a function that writes the /run/reboot-required file.
This function is called from any deployment operation with the relevant
context. Calling from rollback will ensure the rollback context along
with the image digest is written to the file, while calling from
upgrade or switch will write the deploy context for users to reference.

This expands on the functionality requested in: bootc-dev#1574
Related to: bootc-dev#1583

Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
bshephar added a commit to bshephar/bootc that referenced this pull request Sep 8, 2025
This change adds a function that writes the /run/reboot-required file.
This function is called from any deployment operation with the relevant
context. Calling from rollback will ensure the rollback context along
with the image digest is written to the file, while calling from
upgrade or switch will write the deploy context for users to reference.

This expands on the functionality requested in: bootc-dev#1574
Related to: bootc-dev#1583

Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
bshephar added a commit to bshephar/bootc that referenced this pull request Sep 8, 2025
This change adds a function that writes the /run/reboot-required file.
This function is called from any deployment operation with the relevant
context about the image that has been staged.

This expands on the functionality requested in: bootc-dev#1574
Related to: bootc-dev#1583

Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
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.

[FEATURE] Put a brief explanation in /run/reboot-required
2 participants