Difference between revisions of "Kenv"

From GhostBSD Wiki
Jump to: navigation, search
(Usage)
Line 34: Line 34:
 
where whitespace around `name' and `=', and everything after a `<nowiki># </nowiki>' character, are ignored.  Almost any printable character except `=' is accept able as part of a name.  Quotes are optional and necessary only if the  value contains whitespace.
 
where whitespace around `name' and `=', and everything after a `<nowiki># </nowiki>' character, are ignored.  Almost any printable character except `=' is accept able as part of a name.  Quotes are optional and necessary only if the  value contains whitespace.
  
 
+
'''Attention''': The kernel environment variables are also tunable. Before you play with them, reed the man pages. It is possible to crash your system with a false value.
  
  

Revision as of 15:58, 27 February 2020

Welcome to Icon Disti GhostBSD.png Kenv.
Kernel Competence
Sysctl Kldstat Third-party Kernel Modules
Kernel Modules FreeBSD Ports: Kld Kenv
Compiling a new GhostBSD kernel
Back to the Icon Disti GhostBSD.pngSystem

Introduction

With kenv you can dump or modify the kernel environment.

Usage

If you you write

>kenv

in your terminal, you will get the complete kernel environment tree. These variables are the loader variables and relate to initial hardware probes. The right decision has to be made before anything in the kernel accesses the specific hardware.

Kernel environment variables can be set in the /boot/loader.conf

There are following options:

  • >kenv -h -h will limit the report to kernel probe hints.
  • If an optional variable name is specified, kenv will only report that value.
  • If the -N option is specified, kenv will only display variable names and not their values.
  • If the -u option is specified, kenv will delete the given environment variable. If the environment variable is followed by an optional value, kenv will set the environment variable to this value.
  • If the -q option is set, warnings normally printed as a result of being unable to perform the requested operation will be suppressed.
  • If the -v option is set, the variable name will be printed out for the environment variable in addition to the value when kenv is executed with a variable name.

Variables can be added to the kernel environment using the /boot/loader.conf file, or also statically compiled into the kernel using the statement

env filename

in the kernel config file. The file can contain lines of the form name = value # this is a comment

where whitespace around `name' and `=', and everything after a `# ' character, are ignored. Almost any printable character except `=' is accept able as part of a name. Quotes are optional and necessary only if the value contains whitespace.

Attention: The kernel environment variables are also tunable. Before you play with them, reed the man pages. It is possible to crash your system with a false value.