Date: Mon, 1 Mar 2021 19:00:33 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c0708f6835bf - releng/13.0 - efibootmgr: Check for efi supported after parsing args Message-ID: <202103011900.121J0X6D030912@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c0708f6835bf752ccfb2b1c48e7c47f9ead529a6 commit c0708f6835bf752ccfb2b1c48e7c47f9ead529a6 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-02-11 23:06:30 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-03-01 18:59:49 +0000 efibootmgr: Check for efi supported after parsing args Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems. Approved by: re@ (gjb) (cherry picked from commit 7fe2f504f8a0e4237872f8528e911c5f7b7ed59d) (cherry picked from commit b8b867a10f56b4a78b680fb5d2a97c83e745a0ce) --- usr.sbin/efibootmgr/efibootmgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 8c7ba82cb5a5..53bc417c4e07 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1072,11 +1072,12 @@ int main(int argc, char *argv[]) { + memset(&opts, 0, sizeof (bmgr_opts_t)); + parse_args(argc, argv); + if (!efi_variables_supported()) errx(1, "efi variables not supported on this system. root? kldload efirt?"); - memset(&opts, 0, sizeof (bmgr_opts_t)); - parse_args(argc, argv); read_vars(); if (opts.create)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103011900.121J0X6D030912>