Commit graph

30 commits

Author SHA1 Message Date
Stéphane Rochoy c475e61f66 stand/lua: always allow overriding with local config files
Loader now also read configuration files listed in local_loader_conf_files.
Files listed here are the last ones read. And /boot/loader.conf.local was
moved from loader_conf_files to local_loader_conf_files leaving only
loader.conf and device.hints in loader_conf_files by default.

The idea is to ensure local_loader_conf_files, i.e., /boot/loader.conf.local,
can always be used to override other user defined settings.

So the sequencing is now as follow:

 1. Bootstrap:
     /boot/defaults/loader.conf

 2. Read loader_conf_files files:
     /boot/device.hints
     /boot/loader.conf

 3. Read loader_conf_dirs files:
     /boot/loader.conf.d/*.conf

 4. And finally, rread local_loader_conf_files files:
     /boot/loader.conf.local

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759
2024-02-02 12:04:57 -07:00
Stéphane Rochoy c343eedc6d stand/lua: per-product conf if requested via product_vars
If product_vars is set, it must be a space separated list of environment
variable names to walk through to guess the product. Each time a product can be
guessed (i.e., the corresponding variable is defined), prepend
/boot/loader.conf.d/PRODUCT/ to loader_conf_dirs.

It can be typically used as follow:

    smbios.system.planar.maker="PLANAR_MAKER"
    smbios.system.planar.product="PLANAR_PRODUCT"
    smbios.system.product="PRODUCT"
    uboot.m_product="M_PRODUCT"
    product_vars="smbios.system.planar.maker smbios.system.planar.product smbios.system.product uboot.m_product"

to read files found in the following directories, in that order:

    /boot/loader.conf.d/PLANAR_MAKER
    /boot/loader.conf.d/PLANAR_PRODUCT
    /boot/loader.conf.d/PRODUCT
    /boot/loader.conf.d/M_PRODUCT

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759
2024-02-02 12:04:57 -07:00
Warner Losh 994865caf2 Revert "stand/lua: per-product conf if requested via product_vars"
This reverts commit 754cac4b28. No mail
went out and commit message was wrong.

Sponsored by:		Netflix
2024-02-02 12:04:57 -07:00
Warner Losh 5fdf01dbee Revert "stand/lua: always allow overriding with local config files"
This reverts commit d3d0b73557. no mail
sent out, and the commit message was wrong.

Sponsored by:		Netflix
2024-02-02 12:04:57 -07:00
Stéphane Rochoy d3d0b73557 stand/lua: always allow overriding with local config files
Loader now also read configuration files listed in local_loader_conf_files.
Files listed here are the last ones read. And /boot/loader.conf.local was
moved from loader_conf_files to local_loader_conf_files leaving only
loader.conf and device.hints in loader_conf_files by default.

The idea is to ensure local_loader_conf_files, i.e., /boot/loader.conf.local,
can always be used to override other user defined settings.

So the sequencing is now as follow:

 1. Bootstrap:
     /boot/defaults/loader.conf

 2. Read loader_conf_files files:
     /boot/device.hints
     /boot/loader.conf

 3. Read loader_conf_dirs files:
     /boot/loader.conf.d/*.conf

 4. And finally, rread local_loader_conf_files files:
     /boot/loader.conf.local
2024-02-02 11:58:28 -07:00
Stéphane Rochoy 754cac4b28 stand/lua: per-product conf if requested via product_vars
If product_vars is set, it must be a space separated list of environment
variable names to walk through to guess the product. Each time a product can be
guessed (i.e., the corresponding variable is defined), prepend
/boot/loader.conf.d/PRODUCT/ to loader_conf_dirs.

It can be typically used as follow:

    smbios.system.planar.maker="PLANAR_MAKER"
    smbios.system.planar.product="PLANAR_PRODUCT"
    smbios.system.product="PRODUCT"
    uboot.m_product="M_PRODUCT"
    product_vars="smbios.system.planar.maker smbios.system.planar.product smbios.system.product uboot.m_product"

to read files found in the following directories, in that order:

    /boot/loader.conf.d/PLANAR_MAKER
    /boot/loader.conf.d/PLANAR_PRODUCT
    /boot/loader.conf.d/PRODUCT
    /boot/loader.conf.d/M_PRODUCT
2024-02-02 11:57:52 -07:00
Dag-Erling Smørgrav 7edbf69b79 stand: Add 1440p to the list of known resolutions.
MFC after:	1 week
Reviewed by:	manu, kevans, imp
Differential Revision:	https://reviews.freebsd.org/D43391
2024-01-23 15:20:27 +01:00
Warner Losh 64db9a0f82 Add kenv .Xr in kldload(8) and loader.conf(5)
Sponsored by:		Netflix
2023-12-20 21:17:38 -07:00
Ed Maste 4722ceb7d5 Use 115200 bps by default for serial communication
9600 was a standard baud rate decades ago, but 115200 is now more common
so choose defaults that are useful to the largest number of users.

Note that boot0sio does not support rates above 9600 so it remains
unchanged.

Reviewed by:	bz, imp, manu
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36295
2023-08-17 13:31:38 -04:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Kyle Evans 3cb2f5f369 lualoader: add support for .lua configuration files
If a file is specified in loader_conf_files that ends in '.lua', lualoader
will now load and execute that file. These may be used in place of a
traditional loader.conf to use more complicated logic, where some values
may be set based on others or based on the environment that the C bits has
left us with.

Lua scripts are run in a limited environment. In particular, it does not get
access to any modules or, in-fact, anything except environment variable.

A config.buildenv hook has been added so that a local module can add
whatever it may need to to the environment.

When a global var is set in the lua script, it does not immediately alter
the loader environment. Instead, the script's environment is initially
empty and processed only if the whole script executes successfully.
Effectively, a lua configuration file either takes effect or it does not,
an error will not leave it in a half-baked state.

Reviewed by:	bcr (manpages), imp
Differential Revision:	https://reviews.freebsd.org/D28450
2023-05-10 23:10:53 -05:00
Li-Wen Hsu de0c7fbe28
loader.conf(5): mention "efi" option for "console" parameter
PR:		213467
Reviewed by:	imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D31368
2021-08-01 06:41:49 +08:00
Daniel Gerzo 71f6aea415 loader: update autoboot description and move to loader.conf.5
Document "NO" special value for the autoboot_delay and move the
description to loader.conf.5.

imp reworked some of the wording from danger's patch.

Reviewed by:		imp
PR:			85128
Differential Revision:	https://reviews.freebsd.org/D11887
2021-07-12 15:13:03 -06:00
Mateusz Piotrowski 79eca6520e Fix date
It's 2021 already.

Reported by:	delphij
2021-01-07 21:15:26 +01:00
Mateusz Piotrowski 3efe9b3e77 Fix a couple of typos and formatting issues 2021-01-06 16:19:15 +01:00
Toomas Soome babda0952f loader: instead of hw.vga.textmode, use screen.textmode
hw.vga.textmode is directing VT VGA backend to use text mode.

The default screen mode for BIOS loader is text, and default
screen mode for VT VGA backend is graphics (unless we are running on
hypervisor or hw.vga.textmode is set to 1). Using hw.vga.textmode
for loader does remove possibility to have graphical mode VT VGA with
text mode loader.

screen.textmode can have possible values "0" to disable text mode,
and "1" to set text mode.
2021-01-06 14:38:55 +02:00
Toomas Soome 3630506b9d loader: implement framebuffer console
Draw console on efi.
Add vbe framebuffer for BIOS loader (vbe off, vbe on, vbe list,
vbe set xxx).
autoload font (/boot/fonts) based on resolution and font size.
Add command loadfont (set font by file) and
variable screen.font (set font by size). Pass loaded font to kernel.

Export variables:
screen.height
screen.width
screen.depth

Add gfx primitives to draw the screen and put png image on the screen.
Rework menu draw to iterate list of consoles to enamble device specific
output.

Probably something else I forgot...

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27420
2021-01-02 21:41:36 +02:00
Kyle Evans 72cf7db3aa lualoader: add loader_conf_dirs support (loader.conf.d)
loader_conf_dirs is the supporting mechanism for the included
/boot/loader.conf.d directory.  When lualoader finishes processing all of
the loader_conf_files it finds after walking /boot/defaults/loader.conf,
it will now check any and all loader_conf_dirs and process files ending
in ".conf" as if they were a loader.conf.

Note that loader_conf_files may be specified in a loader.conf.d config
file, but loader_conf_dirs may *not*. It will only be processed as specified
in /boot/defaults/loader.conf and any loader_conf_files that were loaded
from there.

Reviewed by:	allanjude, freqlabs, rpokala, tsoome
Includes suggestion from:	imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D25608
2020-12-31 10:37:05 -06:00
Gordon Bergling 812b09037d Fix a few mandoc issues
- whitespace at end of input line
- skipping paragraph macro: Pp at the end of Sh
- new sentence, new line
- consider using OS macro: Fx
- AUTHORS section without An macro
- skipping paragraph macro: Pp before Ss
2020-10-09 15:14:19 +00:00
Kyle Evans 80a623bf52 loader.conf(5): document that loader_conf_files may be clobbered
A future change in lualoader may take some liberties with the
loader_conf_files in the name of efficiency; namely, it may start omitting
it from the loader environment entirely so that it doesn't need to worry
about maintaining any specific value.

This variable has historically been incredibly volatile anyways, as it may
get set to completely different values in any given configuration file to
trigger a load of more files.

Document now that we may not maintain it in the future, but perhaps we'll
reserve the right to change our minds and eventually formally export all of
the loader configuration files that were read using this variable.

MFC after:	3 days
2020-04-30 02:50:58 +00:00
Glen Barber dbffe0f105 Fix a minor typo in loader.conf(5).
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-10 20:25:41 +00:00
Kyle Evans 532dc17243 lualoader: Create a module blacklist, add DRM modules to it
This is a step in the process of easing migration into the new world order
of DRM drivers. Strongly encourage users towards loading DRM modules via
rc.conf(5) instead of loader.conf(5) by failing the load from loader(8).
Users so inclined may wipe out the blacklist via module_blacklist="" in
loader.conf(5), and it is expected that these modules will eventually be
removed from the blacklist. They may still be loaded as dependencies of
other modules or explicitly via the loader prompt, but this should not be a
major problem.

Approved by:	re (rgrimes)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16914
2018-10-07 01:53:43 +00:00
Mark Johnston f6a0fd4490 Document the cpu_microcode_* tunables.
Reviewed by:	bcr (previous version), kib
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16923
2018-08-28 17:14:46 +00:00
Kyle Evans bd868d67bc loader.conf(5): Convert list of values to much better looking table format
Discussed with:	jhb, rpokala
2018-03-23 23:46:59 +00:00
Kyle Evans 9ee31ef21c loader.conf(5): Document efi_max_resolution 2018-03-23 23:02:50 +00:00
Kyle Evans 2c58a19393 Amend missed reference to /boot/overlays, moved to /boot/dtb/overlays 2018-03-19 16:17:10 +00:00
Ed Maste c69defc269 loader.conf: remove obsolete non-x86 beastie menu statement
As of r330005 the same loader.conf defaults are used on all platforms.

Sponsored by:	The FreeBSD Foundation
2018-03-19 15:07:15 +00:00
Kyle Evans dec08e67e4 loader.conf(5): Document some other settings
These tend to have less coverage in other places and they don't have
defaults as of yet, so mention them here:
- fdt_overlays
- kernels_autodetect (lualoader only)
2018-03-07 18:45:24 +00:00
Warner Losh fcd13be6e2 loader.conf is loader agnostic, so remove 4th references. 2018-02-26 03:16:57 +00:00
Warner Losh b6955dfd92 Go back to one loader.conf
We really only need one loader.conf. The other loader.conf was created
because the current one took forever to parse in FORTH. That will be
fixed in the next commit.
2018-02-26 03:16:47 +00:00
Renamed from stand/forth/loader.conf.5 (Browse further)