Page MenuHomeFreeBSD

stand/loader.efi: read zfs bootonce attribute before checking currdev
ClosedPublic

Authored by glebius on Jun 2 2023, 5:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 8, 8:29 AM
Unknown Object (File)
Sat, Oct 5, 8:51 AM
Unknown Object (File)
Sat, Oct 5, 8:00 AM
Unknown Object (File)
Sat, Oct 5, 4:57 AM
Unknown Object (File)
Wed, Oct 2, 7:26 PM
Unknown Object (File)
Wed, Oct 2, 3:22 PM
Unknown Object (File)
Tue, Oct 1, 3:14 AM
Unknown Object (File)
Fri, Sep 27, 5:53 PM
Subscribers

Details

Summary

First check if bootonce is configured and if it is, then change currdev
accordingly and after that do the sanity check. This fixes boot in a
situation when ZFS pool doesn't have the "bootfs" property, but has
bootonce attribute set. A strange, but legitimate case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51854
Build 48745: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jun 2 2023, 11:42 AM
stand/efi/loader/main.c
268

I'm not 100% sure this is completely right. If we wind up not using it, then this shouldn't be set. And if it's not sane, shouldn't we act as if it wasn't set at all?

stand/efi/loader/main.c
268

This doesn't change the current behavior. I agree that env should be unset if we fail to mount the specified bootonce, but that can be a separate change.

imp added inline comments.
stand/efi/loader/main.c
268

I might quibble with not changing current behavior, but current behavior is broken so let's do what I think is needed as a followup patch.