diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2018-07-05 16:30:32 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2018-07-05 16:30:32 +0000 |
commit | 39d44f7f15cf28df572028f198bc51ce2de510a5 (patch) | |
tree | fc6977e2809819dd1d3823638e209fb08f4b0b18 /usr.sbin/config/config.h | |
parent | e28687347fa065c61559d62ef1f006772956279c (diff) | |
download | src-39d44f7f15cf28df572028f198bc51ce2de510a5.tar.gz src-39d44f7f15cf28df572028f198bc51ce2de510a5.zip |
kern_environment: use any provided environments, evict hintmode/envmode
At the moment, hintmode and envmode are used to indicate whether static
hints or static env have been provided in the kernel config(5) and the
static versions are mutually exclusive with loader(8)-provided environment.
hintmode *can* be reconfigured later to pull from the dynamic environment,
thus taking advantage of the loader(8) or post-kmem environment setting.
This changeset fixes both problems at once to move us from a semi-confusing
state to a consistent state: if an environment file, hints file, or
loader(8) environment are provided, we use them in a well-known order of
precedence:
- loader(8) environment
- static environment
- static hints file
Once the dynamic environment is setup this becomes a moot point. The
loader(8) and static environments are merged (respecting the above order of
precedence), and the static hints are merged in on an as-needed basis after
the dynamic environment has been setup.
Hints lookup are changed to respect all of the above. Before the dynamic
environment is setup, lookups use the above-mentioned order and fallback to
the next environment if a matching hint is not found. Once the dynamic
environment is setup, that is used on its own since it captures all of the
above information plus any dynamic kenv settings that came up later in boot.
The following tangentially related changes were made to res_find:
- A hintp cookie is now passed in so that related searches continue using
the chain of environments (or dynamic environment) without relying on
global state
- All three environments will be searched if they actually have valid hints
to use, rather than just choosing the first environment that actually had
a hint and rolling with that only
The hintmode sysctl has been ripped out. static_{env,hints}.disabled are
still honored and will disable their respective environments from being used
for hint lookups and from being merged into the dynamic environment, as
expected.
MFC after: 1 month (maybe)
Differential Revision: https://reviews.freebsd.org/D15953
Notes
Notes:
svn path=/head/; revision=335998
Diffstat (limited to 'usr.sbin/config/config.h')
-rw-r--r-- | usr.sbin/config/config.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index fd5fb344e791..941a65f60216 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -179,8 +179,6 @@ SLIST_HEAD(, includepath) includepath; extern char *ident; extern char kernconfstr[]; extern int do_trace; -extern int envmode; -extern int hintmode; extern int incignore; char *get_word(FILE *); |