diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-06-09 15:10:39 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-06-09 15:10:39 +0000 |
commit | 593e2c6ecec705b9fe0f6dcc366b5c1def7a1a7a (patch) | |
tree | 3b1dd02d61e87abc4867ce3c1339596052217f04 /stand/efi | |
parent | 4a0f8b339eca10c1eb62bd21474d818ec877e8a5 (diff) | |
download | src-593e2c6ecec705b9fe0f6dcc366b5c1def7a1a7a.tar.gz src-593e2c6ecec705b9fe0f6dcc366b5c1def7a1a7a.zip |
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
Notes
Notes:
svn path=/head/; revision=334882
Diffstat (limited to 'stand/efi')
-rw-r--r-- | stand/efi/loader/bootinfo.c | 13 |
1 files changed, 3 insertions, 10 deletions
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 <stand.h> #include <string.h> #include <sys/param.h> -#include <sys/reboot.h> #include <sys/linker.h> -#include <sys/boot.h> +#include <sys/reboot.h> #include <machine/cpufunc.h> #include <machine/elf.h> #include <machine/metadata.h> @@ -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) { |