From 593e2c6ecec705b9fe0f6dcc366b5c1def7a1a7a Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 9 Jun 2018 15:10:39 +0000 Subject: stand: Consolidate checking for boot flags driven by environment vars e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these in multiple places, consolidate into common/ and allow a setting of "NO" for any of these to turn them off. This allows systems with multiple loader.conf(5) or loader.conf(5) overlay systems to easily turn off variables in later processed files by setting it to NO. Reported by: Nick Wolff @ iXsystems Reviewed by: imp --- stand/efi/loader/bootinfo.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'stand/efi') diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 4a4156658e03..43db6d7cfab1 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -32,9 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include +#include #include #include #include @@ -72,15 +71,9 @@ bi_getboothowto(char *kargs) const char *sw; char *opts; char *console; - int howto, i; - - howto = 0; + int howto; - /* Get the boot options from the environment first. */ - for (i = 0; howto_names[i].ev != NULL; i++) { - if (getenv(howto_names[i].ev) != NULL) - howto |= howto_names[i].mask; - } + howto = bootenv_flags(); console = getenv("console"); if (console != NULL) { -- cgit v1.2.3