Page MenuHomeFreeBSD

efi: Add zfs bootonce support to boot1.efi

Authored by imp on Apr 3 2023, 11:03 PM.
Referenced Files
F84949981: D39400.diff
Thu, May 30, 3:04 PM
Unknown Object (File)
Fri, May 17, 4:51 AM
Unknown Object (File)
Thu, May 16, 3:46 AM
Unknown Object (File)
Thu, May 9, 7:54 AM
Unknown Object (File)
Apr 18 2024, 2:50 PM
Unknown Object (File)
Mar 14 2024, 11:50 PM
Unknown Object (File)
Jan 3 2024, 12:26 PM
Unknown Object (File)
Dec 20 2023, 1:34 AM



We have a usecase where we have to chainload loader.efi off the
dataset. The recent loader.efi breakage was such that it happened before
it could clear bootonce. We really should be clearing it in boot1.efi in
this case so that we can fall back to the last known good image.

We have to re-implement the bootonce protocol here because boot1 doesn't
have devdesc. But inlining zfs_get_bootonce and all it calls was only
about 20 lines of actual lines of code since we didn't have to go back
and forth to the devdesc, lookup the spa many times, etc. Add comments
to this effect with details.

Sponsored by: Netflix

Test Plan

The generic kenv stuff could be separated out, so opinions on that would be good.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped
Build Status
Buildable 50740
Build 47631: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 3 2023, 11:03 PM
imp added reviewers: tsoome, kevans, allanjude.

I had a gut reaction at first when I hit the word "Inlined," but it's really not bad. I don't think the zfs_get_bootenv() part is likely to change, but can you add a note to zfs_get_bootonce() that it's' been inlined here in case we end up, e.g., doing more than just removing this key and writing it back out at some point?




I believe this is zfs_get_bootenv

This revision is now accepted and ready to land.Apr 4 2023, 1:31 AM