Skip to content

Add systemd-boot bootchooser #1367

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 1 commit into
base: master
Choose a base branch
from

Conversation

obbardc
Copy link
Contributor

@obbardc obbardc commented Mar 21, 2024

Add some really basic support to set the EFI variable for systemd-boot's default boot choice EFI variable.

This is currently set when "rauc status mark-good" is called; meaning that once the system has started successfully the default boot choice EFI variable will be updated to reflect from the next boot onwards.


This PR needs (at least):

  • manually rebasing onto latest main (currently based on v1.2)
  • testing
  • implementation for r_boot_get_state, r_boot_get_primary, r_boot_set_primary
  • test cases
  • documentation & example!

For context, this is from a project which we converted to use systemd-boot for its bootloader and is working quite well. I am creating a draft PR to see if there is any interest in accepting this into upstream, I can do all of the work to get it in.

@obbardc obbardc changed the title bootchooser: Add systemd-boot support Add systemd-boot bootchooser support Mar 21, 2024
@obbardc obbardc changed the title Add systemd-boot bootchooser support Add systemd-boot bootchooser Mar 21, 2024
@obbardc obbardc force-pushed the wip/obbardc/systemd-boot-bootchooser branch 2 times, most recently from a5fa810 to 021b534 Compare March 21, 2024 19:51
}

/* Set the default boot choice to this slot name */
/* TODO: allow the slot name to be configurable */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add a config option for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the slot's bootname?

Add some really basic support to set the EFI variable for systemd-boot's
default boot choice EFI variable.

This is currently set when `rauc status mark-good` is called; meaning that
once the system has started successfully the default boot choice EFI
variable will be updated to reflect from the next boot onwards.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
@obbardc obbardc force-pushed the wip/obbardc/systemd-boot-bootchooser branch from 021b534 to 6c89078 Compare March 21, 2024 19:57
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 16.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 79.87%. Comparing base (ec9ab08) to head (6c89078).
Report is 681 commits behind head on master.

Files with missing lines Patch % Lines
src/bootchooser.c 16.00% 21 Missing ⚠️

❌ Your patch check has failed because the patch coverage (16.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1367      +/-   ##
==========================================
- Coverage   79.95%   79.87%   -0.08%     
==========================================
  Files          67       67              
  Lines       20057    20082      +25     
==========================================
+ Hits        16037    16041       +4     
- Misses       4020     4041      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jluebbe
Copy link
Member

jluebbe commented Mar 28, 2024

How would this interact with https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/, which is also implemented by systemd-boot?

@jluebbe
Copy link
Member

jluebbe commented Apr 2, 2025

This would need to be rebased, as #1636 has split the bootloader backends into different files.

@jluebbe jluebbe added this to the Unplanned milestone Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants