8000 src/context: priorize bootchooser to select bootslot (for custom bootloader backend) by gportay · Pull Request #1669 · rauc/rauc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

src/context: priorize bootchooser to select bootslot (for custom bootloader backend) #1669

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

Conversation

gportay
Copy link
Contributor
@gportay gportay commented Mar 20, 2025

The commit 9af0613 introduced the new bootchooser API r_boot_get_current_bootname() to allow the backend to determine the current bootslot.

Since then, the bootchooser is able determine the bootslot if it cannot be guessed from the kernel cmdline; it is used by the custom backend only at that moment.

This gives the priority to the bootchooser over the kernel cmdline.

Copy link
codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.36%. Comparing base (fa1dc1f) to head (c53fe0b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1669   +/-   ##
=======================================
  Coverage   84.36%   84.36%           
=======================================
  Files          76       76           
  Lines       22197    22197           
=======================================
  Hits        18727    18727           
  Misses       3470     3470           
Flag Coverage Δ
service=false 80.84% <100.00%> (ø)
service=true 84.32% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@gportay gportay force-pushed the context-priorize-bootchooser-to-select-bootslot branch from 31cd05b to c53fe0b Compare March 20, 2025 15:21
@ejoerns
Copy link
Member
ejoerns commented Mar 28, 2025

Sounds reasonable to me to give the custom backend priority for setting the booted slot.

get-current remains optional since missing output or any failure in get-current (e.g. due to strict input checking) will not lead to an error and just fall back to the root=-based bootname.

I guess it would make sense to clarify the detection order in the description in https://rauc.readthedocs.io/en/latest/integration.html#identification-via-custom-backend

@jluebbe
8000 Copy link
Member
jluebbe commented Mar 28, 2025

@ejoerns I've not checked the code yet, but we need to ensure that external and NFS override results from the bootloader backend.

@ejoerns
Copy link
Member
ejoerns commented Mar 28, 2025

@jluebbe Indeed, that's one corner case I overlooked. Thus maybe it makes sense to just move the call to r_boot_get_current_bootname() into get_cmdline_bootname() (and rename this?).

It's also a bit inconsistent currently that we check rauc.external first, then rauc.slot and bootchooser.active, THEN root=/dev/nfs, and finally other root= options.
I'd suggest we check rauc.external and root=/dev/nfs first, then handle the custom backend, and then the rest.

@oli-ben
Copy link
oli-ben commented Mar 28, 2025

@jluebbe Indeed, that's one corner case I overlooked. Thus maybe it makes sense to just move the call to r_boot_get_current_bootname() into get_cmdline_bootname() (and rename this?).

It's also a bit inconsistent currently that we check rauc.external first, then rauc.slot and bootchooser.active, THEN root=/dev/nfs, and finally other root= options. I'd suggest we check rauc.external and root=/dev/nfs first, then handle the custom backend, and then the rest.

I ran into the same issue as @gportay, I think this would be a great path forward!

@ejoerns ejoerns changed the title src/context: priorize bootchooser to select bootslot src/context: priorize bootchooser to select bootslot (for custom bootloader backend) Mar 28, 2025
gportay added 2 commits April 15, 2025 16:08
The commit 9af0613 introduced the new
bootchooser API r_boot_get_current_bootname() to allow the backend to
determine the current bootslot.

Since then, the bootchooser is able determine the bootslot if it cannot
be guessed from the kernel cmdline; it is used by the custom backend
only at that moment.

This gives the priority to the bootchooser over the kernel cmdline.

Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
This splits the logic of get_cmdline_bootname() in two parts:
 - first the bootname that explicit set the slot (rauc.external or
   rauc.slot), and the nfs ignored root device
 - second the bootname guessed from the root device
@gportay gportay force-pushed the context-priorize-bootchooser-to-select-bootslot branch from c53fe0b to 5cede34 Compare April 15, 2025 15:06
@gportay
Copy link
Contributor Author
gportay commented Apr 15, 2025

@jluebbe, @ejoerns, I have split the get_cmdline_bootname() logic in two. I have moved the explicit rauc slot before calling the bootloader backend (and the nfs case). I have kept the rauc slot guessing from the root device after.

Also, I am thinking about moving the barebox thing in the bootloader backend by adding the cmdline in parameter to the r_boot_get_current_bootname(..., cmdline, ...).

Is that looking good to you?

@jluebbe
Copy link
Member
jluebbe commented May 15, 2025

I've created #1712 to make the refactoring easier to review. What do you think, @gportay?

@gportay
Copy link
Contributor Author
gportay commented May 15, 2025

I've created #1712 to make the refactoring easier to review. What do you think, @gportay?

I saw, let's close that one.

@gportay gportay closed this May 15, 2025
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.

4 participants
0