Skip to content
  • Warner Losh's avatar
    Read in and parse /efi/freebsd/loader.env from the boot device's · 8ac2d6f5
    Warner Losh authored
    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
    8ac2d6f5