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
Unknown Object (File)
Wed, Nov 6, 9:45 AM
Unknown Object (File)
Wed, Nov 6, 9:45 AM
Unknown Object (File)
Mon, Nov 4, 6:25 PM
Unknown Object (File)
Tue, Oct 22, 4:28 PM
Unknown Object (File)
Sat, Oct 19, 9:42 PM
Unknown Object (File)
Thu, Oct 17, 12:20 AM
Unknown Object (File)
Wed, Oct 16, 11:46 PM
Unknown Object (File)
Wed, Oct 16, 11:46 PM
Subscribers
None

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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...");