Page MenuHomeFreeBSD

efibootmgr: provide explicit error message if run as non-root
ClosedPublic

Authored by emaste on Oct 15 2023, 5:23 PM.
Tags
None
Referenced Files
F107296564: D42213.diff
Sun, Jan 12, 3:56 AM
Unknown Object (File)
Nov 16 2024, 9:07 PM
Unknown Object (File)
Nov 9 2024, 7:52 PM
Unknown Object (File)
Nov 6 2024, 9:45 AM
Unknown Object (File)
Nov 6 2024, 9:45 AM
Unknown Object (File)
Nov 4 2024, 6:25 PM
Unknown Object (File)
Oct 22 2024, 4:28 PM
Unknown Object (File)
Oct 19 2024, 9:42 PM
Subscribers
None

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.
imp added inline comments.
usr.sbin/efibootmgr/efibootmgr.c
1107

This works...

I'd also looked at machdep.bootmethod, but then discovered that's not on all UEFI-supporting systems and that's why I never finished up the patches.

This revision is now accepted and ready to land.Oct 15 2023, 5:25 PM
usr.sbin/efibootmgr/efibootmgr.c
1107

Though thinking about it, arm and arm64 both require UEFI (effectively), though arm64 can get its device tree from fdt.
Riscv64 might also require it, but I'm way less sure about that. It's rare enough we needn't optimize it yet.
Either way, we'd cover the vast majority of cases if we added an

#ifdef amd64
/* code here to get machdep.bootmethod and compare against UEFI and say BIOS not supported instead */
#endif
errx(1, "efi variables not supported...");