]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Read in and parse /efi/freebsd/loader.env from the boot device's
authorimp <imp@FreeBSD.org>
Mon, 29 Apr 2019 05:02:25 +0000 (05:02 +0000)
committerimp <imp@FreeBSD.org>
Mon, 29 Apr 2019 05:02:25 +0000 (05:02 +0000)
commitfa653d511e85977e5d25ffc6bee518512512a4db
treed0d56ea9a78dd9e7365d2fc95f5f04bbc45244a6
parent324cf6c560b804903ed9376e0d0a07e5fa11e3a5
Read in and parse /efi/freebsd/loader.env from the boot device's
partition as if it were on the command line.

Fetch FreeBSD-LoaderEnv UEFI enviornment variable. If set, read in
loader environment variables from it. Otherwise read in
/efi/freebsd/loader.env. Both are read relative to the device
loader.efi loaded from (they aren't full UEFI device paths)

Next fetch FreeBSD-NextLoaderEnv UEFI environment variable. If
present, read the file it points to in as above and delete the UEFI
environment variable so it only happens once.

This lets one set environment variables in the bootloader.
Unfortunately, we don't have all the mechanisms in place to parse the
file, nor do we have the magic pattern matching in place that
loader.conf has. Variables are of the form foo=bar. No quotes are
supported, so spaces aren't allowed, for example. Also, variables like
foo_load=yes are intercepted when we parse the loader.conf file and
things are done based on that. Since those aren't done here, variables
that cause an action to happen won't work.

Reviewed by: bcran
Differential Revision: https://reviews.freebsd.org/D20016
stand/efi/loader/main.c