261ad5a21c
This MFC consists of the following SVN revisions: 258741 261568 261603 261668 263115 263117 263968 264078 264087 264088 264092 264095 264115 264132 264208 264261 264262 264263 264319 265028 265057 268974 Detailed commit messages: r258741: Note that libstand is 32-bit on amd64 and powerpc64 r261568: Build libstand as a 64-bit library on amd64 The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a to be 32-bit. r261603: Don't force efi to a 32-bit build on amd64 r261668: Build libstand as a 64-bit library on ppc64 The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32, so there is no need to force /usr/lib/libstand.a to be 32-bit. This is equivalent to r261568 for amd64. r263115: Add amd64 EFI headers r263117: Connect 64-bit boot ficl to the build It is not yet used, but this will ensure it doesn't get broken. r263968: Use EFI types for EFI values (silences warnings). EFI UINTN is actually a 64-bit type on 64-bit processors. r264078: Put each source file on a separate line This will simplify rebasing the amd64 UEFI patch set. r264087: Build boot/ficl as 64-bit library on amd64 The 32-bit bootloaders on amd64 now use the 32-bit version in ficl32, as is done with libstand32. The native 64-bit ficl will be used by the upcoming UEFI loader. r264088: Merge efilib changes from projects/uefi r247216: Add the ability for a device to have an "alias" handle. r247379: Fix network device registration. r247380: Adjust our load device when we boot from CD under UEFI. The process for booting from a CD under UEFI involves adding a FAT filesystem containing your loader code as an El Torito boot image. When UEFI detects this, it provides a block IO instance that points at the FAT filesystem as a child of the device that represents the CD itself. The problem being that the CD device is flagged as a "raw device" while the boot image is flagged as a "logical partition". The existing EFI partition code only looks for logical partitions and so the CD filesystem was rendered invisible. To fix this, check the type of each block IO device. If it's found to be a CD, and thus an El Torito boot image, look up its parent device and add that instead so that the loader will then load the kernel from the CD filesystem. This is done by using the handle for the boot filesystem as an alias. Something similar to this will be required for booting from other media as well as the loader will live in the EFI system partition, not on the partition containing the kernel. r247381: Remove a scatalogical debug printf that crept in. r264092: Add -fPIC for amd64 r264095: Support UEFI booting on amd64 via loader.efi This is largely the work from the projects/uefi branch, with some additional refinements. This is derived from (and replaces) the original i386 efi implementation; i386 support will be restored later. Specific revisions of note from projects/uefi: r247380: Adjust our load device when we boot from CD under UEFI. The process for booting from a CD under UEFI involves adding a FAT filesystem containing your loader code as an El Torito boot image. When UEFI detects this, it provides a block IO instance that points at the FAT filesystem as a child of the device that represents the CD itself. The problem being that the CD device is flagged as a "raw device" while the boot image is flagged as a "logical partition". The existing EFI partition code only looks for logical partitions and so the CD filesystem was rendered invisible. To fix this, check the type of each block IO device. If it's found to be a CD, and thus an El Torito boot image, look up its parent device and add that instead so that the loader will then load the kernel from the CD filesystem. This is done by using the handle for the boot filesystem as an alias. Something similar to this will be required for booting from other media as well as the loader will live in the EFI system partition, not on the partition containing the kernel. r246231: Add necessary code to hand off from loader to an amd64 kernel. r246335: Grab the EFI memory map and store it as module metadata on the kernel. This is the same approach used to provide the BIOS SMAP to the kernel. r246336: Pass the ACPI table metadata via hints so the kernel ACPI code can find them. r246608: Rework copy routines to ensure we always use memory allocated via EFI. The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now. r247214: Fix a number of problems preventing proper handover to the kernel. There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it. Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel. r246231: Add necessary code to hand off from loader to an amd64 kernel. r246335: Grab the EFI memory map and store it as module metadata on the kernel. This is the same approach used to provide the BIOS SMAP to the kernel. r246336: Pass the ACPI table metadata via hints so the kernel ACPI code can find them. r246608: Rework copy routines to ensure we always use memory allocated via EFI. The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now. r247214: Fix a number of problems preventing proper handover to the kernel. There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it. Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel. r247216: Use the UEFI Graphics Output Protocol to get the parameters of the framebuffer. r264115: Fix printf format mismatches r264132: Connect sys/boot/amd64 to the build r264208: Do not build the amd64 UEFI loader with GCC The UEFI loader causes buildworld to fail when building with (in-tree) GCC, due to a typedef redefinition. As it happens the in-tree GCC cannot successfully build the UEFI loader anyhow, as it does not support __attribute__((ms_abi)). Thus, just avoid trying to build it with GCC, rather than disconnecting it from the build until the underlying issue is fixed. r264261: Correct a variable's type for 64-bit Ficl FICL_INT is long. r264262: Fix printf args for 64-bit archs r264263: Add explicit casts to quiet warnings in libefi r264319: Fix EFI loader object tree creation on 9.x build hosts Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi subdirectory was skipped altogether for gcc (since GCC does not support a required attribute). However, during the early buildworld stages ${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build hosts), not the compiler that will eventually be used. This caused "make obj" to skip the efi subdirectory. In later build stages ${COMPILER_TYPE} is "clang", and then the efi loader would attempt to build in the source directory. r265028 (dteske): Disable the beastie menu for EFI console ... which doesn't support ANSI codes (so things like `at-xy', `clear', and other commands don't work making it impossible to generate a living menu). r265057 (nwhitehorn): Turn off various fancy instruction sets... as well as deduplicate some options. This makes the EFI loader build work with CPUTYPE=native in make.conf on my Core i5. r268974 (sbruno): Supress clang warning for FreeBSD printf %b and %D formats Relnotes: Yes Sponsored by: The FreeBSD Foundation
293 lines
8.1 KiB
Groff
293 lines
8.1 KiB
Groff
.\" Copyright (c) 1999 Daniel C. Sobral
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd April 27, 2014
|
|
.Dt LOADER.CONF 5
|
|
.Os
|
|
.Sh NAME
|
|
.Nm loader.conf
|
|
.Nd "system bootstrap configuration information"
|
|
.Sh DESCRIPTION
|
|
The file
|
|
.Nm
|
|
contains descriptive information on bootstrapping the system.
|
|
Through
|
|
it you can specify the kernel to be booted, parameters to be passed to
|
|
it, and additional modules to be loaded; and generally set all variables
|
|
described in
|
|
.Xr loader 8 .
|
|
.Pp
|
|
The file
|
|
.Pa /boot/loader.rc
|
|
must contain the following two lines for
|
|
.Nm
|
|
to be automatically processed:
|
|
.Pp
|
|
.Dl include /boot/loader.4th
|
|
.Dl start
|
|
.Pp
|
|
If no
|
|
.Pa /boot/loader.rc
|
|
exists at installworld time, one with the above lines will be installed.
|
|
.Sh SYNTAX
|
|
Though
|
|
.Nm Ns 's
|
|
format was defined explicitly to resemble
|
|
.Xr rc.conf 5 ,
|
|
and can be sourced by
|
|
.Xr sh 1 ,
|
|
some settings are treated in a special fashion.
|
|
Also, the
|
|
behavior of some settings is defined by the setting's suffix;
|
|
the prefix identifies which module the setting controls.
|
|
.Pp
|
|
The general parsing rules are:
|
|
.Bl -bullet
|
|
.It
|
|
Spaces and empty lines are ignored.
|
|
.It
|
|
A # sign will mark the remainder of the line as a comment.
|
|
.It
|
|
Only one setting can be present on each line.
|
|
.El
|
|
.Pp
|
|
All settings have the following format:
|
|
.Pp
|
|
.Dl variable="value"
|
|
.Pp
|
|
Unless it belongs to one of the classes of settings that receive special
|
|
treatment, a setting will set the value of a
|
|
.Xr loader 8
|
|
environment variable.
|
|
The settings that receive special
|
|
treatment are listed below.
|
|
Settings beginning with
|
|
.Qq *
|
|
below define the modules to be loaded and
|
|
may have any prefix; the prefix identifies a module.
|
|
All such settings sharing a common
|
|
prefix refer to the same module.
|
|
.Bl -tag -width Ar
|
|
.It Ar exec
|
|
Immediately executes a
|
|
.Xr loader 8
|
|
command.
|
|
This type of setting cannot be processed by programs other
|
|
than
|
|
.Xr loader 8 ,
|
|
so its use should be avoided.
|
|
Multiple instances of it will be processed
|
|
independently.
|
|
.It Ar loader_conf_files
|
|
Defines additional configuration files to be processed right after the
|
|
present file.
|
|
.It Ar kernel
|
|
Name of the kernel to be loaded.
|
|
If no kernel name is set, no additional
|
|
modules will be loaded.
|
|
The name must be a subdirectory of
|
|
.Pa /boot
|
|
that contains a kernel.
|
|
.It Ar kernel_options
|
|
Flags to be passed to the kernel.
|
|
.It Ar password
|
|
Protect boot menu with a password without interrupting
|
|
.Ic autoboot
|
|
process.
|
|
The password should be in clear text format.
|
|
If a password is set, boot menu will not appear until any key is pressed during
|
|
countdown period specified by
|
|
.Va autoboot_delay
|
|
variable or
|
|
.Ic autoboot
|
|
process fails.
|
|
In both cases user should provide specified password to be able to access boot
|
|
menu.
|
|
.It Ar bootlock_password
|
|
Provides a password to be required by check-password before execution is
|
|
allowed to continue.
|
|
The password should be in clear text format.
|
|
If a password is set, the user must provide specified password to boot.
|
|
.It Ar verbose_loading
|
|
If set to
|
|
.Dq YES ,
|
|
module names will be displayed as they are loaded.
|
|
.It Ar *_load
|
|
If set to
|
|
.Dq YES ,
|
|
that module will be loaded.
|
|
If no name is defined (see below), the
|
|
module's name is taken to be the same as the prefix.
|
|
.It Ar *_name
|
|
Defines the name of the module.
|
|
.It Ar *_type
|
|
Defines the module's type.
|
|
If none is given, it defaults to a kld module.
|
|
.It Ar *_flags
|
|
Flags and parameters to be passed to the module.
|
|
.It Ar *_before
|
|
Commands to be executed before the module is loaded.
|
|
Use of this setting
|
|
should be avoided.
|
|
.It Ar *_after
|
|
Commands to be executed after the module is loaded.
|
|
Use of this setting
|
|
should be avoided.
|
|
.It Ar *_error
|
|
Commands to be executed if the loading of a module fails.
|
|
Except for the
|
|
special value
|
|
.Dq abort ,
|
|
which aborts the bootstrap process, use of this setting should be avoided.
|
|
.El
|
|
.Pp
|
|
.Em WARNING:
|
|
developers should never use these suffixes for any kernel environment
|
|
variables (tunables) or conflicts will result.
|
|
.Sh DEFAULT SETTINGS
|
|
Most of
|
|
.Nm Ns 's
|
|
default settings can be ignored.
|
|
The few of them which are important
|
|
or useful are:
|
|
.Bl -tag -width bootfile -offset indent
|
|
.It Va bitmap_load
|
|
.Pq Dq NO
|
|
If set to
|
|
.Dq YES ,
|
|
a bitmap will be loaded to be displayed on screen while booting.
|
|
.It Va bitmap_name
|
|
.Pq Dq Pa /boot/splash.bmp
|
|
Name of the bitmap to be loaded.
|
|
Any other name can be used.
|
|
.It Va comconsole_speed
|
|
.Dq ( 9600
|
|
or the value of the
|
|
.Va BOOT_COMCONSOLE_SPEED
|
|
variable when
|
|
.Xr loader 8
|
|
was compiled).
|
|
Sets the speed of the serial console.
|
|
If the previous boot loader stage specified that a serial console
|
|
is in use then the default speed is determined from the current
|
|
serial port speed setting.
|
|
.It Va console
|
|
.Pq Dq vidconsole
|
|
.Dq comconsole
|
|
selects serial console,
|
|
.Dq vidconsole
|
|
selects the video console,
|
|
.Dq nullconsole
|
|
selects a mute console
|
|
(useful for systems with neither a video console nor a serial port), and
|
|
.Dq spinconsole
|
|
selects the video console which prevents any input and hides all output
|
|
replacing it with
|
|
.Dq spinning
|
|
character (useful for embedded products and such).
|
|
.It Va kernel
|
|
.Pq Dq kernel
|
|
.It Va kernels
|
|
.Pq Dq kernel kernel.old
|
|
Space or comma separated list of kernels to present in the boot menu.
|
|
.It Va loader_conf_files
|
|
.Pq Dq Pa /boot/loader.conf /boot/loader.conf.local
|
|
.It Va splash_bmp_load
|
|
.Pq Dq NO
|
|
If set to
|
|
.Dq YES ,
|
|
will load the splash screen module, making it possible to display a bmp image
|
|
on the screen while booting.
|
|
.It Va splash_pcx_load
|
|
.Pq Dq NO
|
|
If set to
|
|
.Dq YES ,
|
|
will load the splash screen module, making it possible to display a pcx image
|
|
on the screen while booting.
|
|
.It Va vesa_load
|
|
.Pq Dq NO
|
|
If set to
|
|
.Dq YES ,
|
|
the vesa module will be loaded, enabling bitmaps above VGA resolution to
|
|
be displayed.
|
|
.It Va beastie_disable
|
|
If set to
|
|
.Dq YES ,
|
|
the beastie boot menu will be skipped.
|
|
The beastie boot menu is always skipped if booting UEFI or running non-x86
|
|
hardware.
|
|
.It Va loader_logo Pq Dq Li orbbw
|
|
Selects a desired logo in the beastie boot menu.
|
|
Possible values are:
|
|
.Dq Li orbbw ,
|
|
.Dq Li orb ,
|
|
.Dq Li fbsdbw ,
|
|
.Dq Li beastiebw ,
|
|
.Dq Li beastie ,
|
|
and
|
|
.Dq Li none .
|
|
.It Va loader_color
|
|
If set to
|
|
.Dq NO ,
|
|
the beastie boot menu will be displayed without ANSI coloring.
|
|
.El
|
|
.Sh FILES
|
|
.Bl -tag -width /boot/defaults/loader.conf -compact
|
|
.It Pa /boot/defaults/loader.conf
|
|
default settings -- do not change this file.
|
|
.It Pa /boot/loader.4th
|
|
defines the commands used by loader to read and process
|
|
.Nm .
|
|
.It Pa /boot/loader.conf
|
|
user defined settings.
|
|
.It Pa /boot/loader.conf.local
|
|
machine-specific settings for sites with a common loader.conf.
|
|
.It Pa /boot/loader.rc
|
|
contains the instructions to automatically process
|
|
.Nm .
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr boot 8 ,
|
|
.Xr loader 8 ,
|
|
.Xr loader.4th 8
|
|
.Sh HISTORY
|
|
The file
|
|
.Nm
|
|
first appeared in
|
|
.Fx 3.2 .
|
|
.Sh AUTHORS
|
|
This manual page was written by
|
|
.An Daniel C. Sobral Aq dcs@FreeBSD.org .
|
|
.Sh BUGS
|
|
The
|
|
.Xr loader 8
|
|
stops reading
|
|
.Nm
|
|
when it encounters a syntax error, so any options which are vital for
|
|
booting a particular system (i.e.\&
|
|
.Dq Va hw.ata.ata_dma Ns "=0" )
|
|
should precede any experimental additions to
|
|
.Nm .
|