mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
efibootmgr: provide explicit error message if run as non-root
This should be less confusing for new users. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42213
This commit is contained in:
parent
6ace92326f
commit
c08ba4a588
|
@ -1101,8 +1101,11 @@ main(int argc, char *argv[])
|
|||
/*
|
||||
* find_dev can operate without any efi variables
|
||||
*/
|
||||
if (!efi_variables_supported() && !opts.find_dev)
|
||||
errx(1, "efi variables not supported on this system. root? kldload efirt?");
|
||||
if (!efi_variables_supported() && !opts.find_dev) {
|
||||
if (errno == EACCES && geteuid() != 0)
|
||||
errx(1, "must be run as root");
|
||||
errx(1, "efi variables not supported on this system. kldload efirt?");
|
||||
}
|
||||
|
||||
read_vars();
|
||||
|
||||
|
|
Loading…
Reference in a new issue