Commit Graph

685 Commits

Author SHA1 Message Date
Warner Losh
08fa847abf Use % for printf, not a dollar sign 2018-07-27 22:35:07 +00:00
Warner Losh
0f0d65df7b Style nits noted by rpokala 2018-07-27 22:31:38 +00:00
Warner Losh
34b3f88f36 In the BootXXXX message, use the actual boot variable.
Fix stupid compile issue that crept in when I moved patches between trees.
2018-07-27 22:29:20 +00:00
Warner Losh
fb4c478715 Add some additional debug to loader.efi
Add some verbose debugging information to the loader's new
choices. I'll remove these / put them behind a DEBUG define at a later
time. This is to give additional information if there's any dangling
edge cases not contemplated by the code. r336789 had most of this
change, but had the wrong commit message. This refines it slightly.
2018-07-27 22:29:15 +00:00
Warner Losh
8c18b82b3d stand debug 2018-07-27 22:00:00 +00:00
Kyle Evans
be2050dab9 lualoader: "nextboot_file" should be spelled "nextboot_conf"
See: /boot/defaults/loader.conf

Reported by:	gtetlow (inadvertently)
2018-07-27 11:35:58 +00:00
Warner Losh
1e354803ee Ignore Device Paths in the Boot Info that don't have Media path
nodes. These show up in default entries on SuperMicro motherboards and
elsewhere. Before, we couldn't find a block device associated with the
device path and return BAD_CHOICE which was an instant
failure. However, a VendHw node isn't specifc, so when we don't find a
media path, return NOT_SPECIFIC so that the rest of the algorithms
work.

Sponsored by: Netflix.
2018-07-26 05:08:58 +00:00
Ruslan Bukin
8e8fbf193d Disable 'C'-compressed ISA extension.
It works excellent, but KDB disassembler and DTrace FBT provider for
RISC-V do lack support for it. They currently handle 4-byte instructions
only, while C-compressed ISA extension introduces 2-byte instructions
freely mixing them together.

So disable it for now.

Reviewed by:	markj@
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D16436
2018-07-25 16:07:35 +00:00
Warner Losh
b43c6042c3 Finalize the boot manager protocol support for next-stage boot
loading.

If we are booting in a conforming UEFI Boot Manager Environment, then
use the BootCurrent variable to find the BootXXXX we're using. Once we
find that, then if it contains more than one EFI_DEVICE_PATH in its
what to boot section, try to use the last one as the kernel to
load. This will also set the default root partition as well. If
there's only one path, or if there's an error along the way, assume
that nothing specific was specified and revert to the old
algorithm. If something was specified, but not found, then fail the
boot. Otherwise you that, specific thing. On FreeBSD, this can be set
using efibootmgr -l <loader> -k <kernel>. We try a few variations of
kernel to cope with the fact that UEFI comes from a DOS world where
paths might be upper case and/or contain back-slashes.

Note: In an ideal world, we'd work out where we are in chain loading
by looking at the passed-in image handle and doing name
matching. However, that's unreliable since at least boot1.efi booted
images don't have that, hence the assumption that loader.efi needs to
load the last thing on the list, if possible.

The reason we fail for something specific is so that we can fully
participate in the UEFI Boot Manager Protocol and fail over to the
next item in the list of BootOrder choices when something goes wrong
at this stage.

This implements was was talked about in freebsd-arch@ last year
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3576+0+archive/2017/freebsd-arch/20171022.freebsd-arch
and documented in full (after changed resulting from the discussion) in
https://docs.google.com/document/d/1aK9IqF-60JPEbUeSAUAkYjF2W_8EnmczFs6RqCT90Jg/edit#
although one or two minor details may have been modified in this
implementation to make it work, and the ZFS MEDIA PATH extension isn't
implemented. This does not yet move things to ESP:\efi\freebsd\loader.efi.

RelNotes: Yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16403
2018-07-23 20:36:59 +00:00
Warner Losh
00a47597a3 Implement efiblk_get_pdinfo_by_device_path
Lookup a block device by it's device path. We use a 'loose' lookup
whereby we scan forward to the first Media Path portion of the device
path, then look at all our handles for one whose first Media Path
matches. This will also work if the device path pointed to has a
following file path (or paths) as that's ignored. It assumes that
there's only one media path node that describes the entire device,
which is true as of the latest UEFI spec (2.7 Errata A) as far as I've
been able to determine.

Sponsored by: Netflix
2018-07-23 20:36:54 +00:00
Warner Losh
c6c2a73c0c Implement efi_devpath_length
Return the total length, in bytes, of the device path (including the
terminating node at the end).

Sponsored by: Netflix
2018-07-23 20:36:50 +00:00
Warner Losh
13850b362f Implement efi_devpath_match_node
Returns true if the first node pointed to by devpath1 is identical to
the first node pointed to by devpath2, with care taken to not read
past the end of the valid parts of either devpath1 or
devpath2. Otherwise, returns false.

Sponsored by: Netflix
2018-07-23 20:36:45 +00:00
Warner Losh
3ef81aa0f5 Store the number of handles we get back in efipart_nhandles rather
than the number of bytes. Don't divide by the element size every time
we have to iterate. Eliminate now-unused variables.

Sponsored by: Netflix
2018-07-23 20:36:41 +00:00
Warner Losh
ee4e1d5807 Implement efi_devpath_to_media_path
Takes a generic device path as its input. Scans through it to find the
first media_path node in it and returns a pointer to it. If none is
found, NULL is returned.

Sponsored by: Netflix
2018-07-23 20:36:25 +00:00
Warner Losh
afe7cf8749 Fix the attempt to see if we're overriding the console in the command
line args. I had thought console would be NULL, but it's efi. Set it
to efi (as a clue) before we initialize the console, then test it to
see if it changed on the command line to do the automatic
override. This gets my serial console back.
2018-07-23 06:38:48 +00:00
Warner Losh
3b74102205 Older zfs boot blocks don't support symlinks. install the link to
zfsloader as a hard link. While newer ones do, the whole point of the
link was to transition to the new world order smoothly. A hard link is
less flexible, but it works and will result in fewer bumps. Adjust
UPDATING entry to match.
2018-07-23 06:04:05 +00:00
Warner Losh
1f9bd5f67c Hoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc 2018-07-20 05:18:03 +00:00
Warner Losh
fdcfd483e3 NM and OBJCOPY are already defined for all builds. There's no need to
conditionally define them here.
2018-07-20 05:17:56 +00:00
Warner Losh
1a14a0bfb7 Eliminate zfsloader man page.
Remove all cross references to zfsloader.8 and /boot/zfsloader.
Move ZFS specific info into loader.8.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16361
2018-07-20 05:17:49 +00:00
Warner Losh
060679ef9c Collapse zfsloader functionality back down into loader.
We no longer really need a separate zfsloader. It was useful when we
were first supporting ZFS and had limited ability to properly boot off
of ZFS without the special boot loader. Now that the boot loader has
matured, go the way loader.efi pioneered and just build one
binary. Change the name of the loader to load in the secondary boot
blocks to be just /boot/loader. Provide a symbolic link from zfsloader
to loader so people who have not upgraded their boot blocks are not
affected. This has the happy benefit of making coexistence easier as
well (fewer binaries in the matrix).

Discussed with: allanjude@, kevans@
RelNotes: Yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16361
2018-07-20 05:17:37 +00:00
Warner Losh
2168b18916 If the console is already set, don't override it.
If console=X is specified on the command line, it's effectively
overridden by the current code. It shouldn't do that.
2018-07-18 22:45:45 +00:00
Warner Losh
e39cc26762 If rootdev is set, use it as currdev.
Setting rootdev in the enviornment should specify things
completely. If it is set, then have it override everything else.

PR: 229770
Differential Review: https://reviews.freebsd.org/D16322
2018-07-18 22:45:26 +00:00
Warner Losh
5a399a1a39 Remove bogus attempt to simulate scrolling. It's not needed and messes
up serial output. Setting the cursor position after every character is
inefficient, and causes all lines to be over-printed in the serial
console for the boot loader. Allow the terminal to do the emulation.

This isn't completely perfect when the size of the terminal attached
to the serial port isn't the same as 80x25 to match the viedoe console
(or whatever the video console is). While imperfect still, these
changes make it much better.

This makes the serial port useful with UEFI.

Differential Revision: https://reviews.freebsd.org/D16309
2018-07-17 21:45:14 +00:00
Warner Losh
11df3a2881 More typos
Noticed by: ian@
2018-07-17 20:26:17 +00:00
Warner Losh
debf8b839b Fix typo in the command summary.
Of course, I can't get the command to work, but it's a start...
2018-07-17 20:11:52 +00:00
Li-Wen Hsu
ceab45b744 zfsboot: fix build with WITHOUT_LOADER_GELI
Reviewed by:	ian
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D16292
2018-07-16 19:21:50 +00:00
Warner Losh
d59db438cb Minor adjustments:
o Fix the parsing of the device path. a last minute change terminated
  it too soon.
o Kill setting LINES. We don't need to do it, and even if we did hard
  coding it to 24 is wrong.
o Now that the console is working again for the loader, adjust the
  printfs to be more in line with other platforms.
2018-07-14 06:43:37 +00:00
Warner Losh
a44c75739d Add reporting of whether or not a keyboard is detected. In addition,
note that r336270's commit message was slightly incorrect. It changed
the default setting of the console to honor the ConOut
variable. Overrides via the command line are still possible, and we
use the devices in ConOut to set the proper console. If, for example,
serial cosnole is specified, we'll set console to "efi" if ConOut has
a serial port list and to either "efi comconsole" or "comconsole efi"
if not depending on whether -D or -D -h was specified.

RelNotes: Yes
Sponsored by: Netflix
2018-07-14 01:46:19 +00:00
Warner Losh
3fecfbebe9 uefi stand: Guess the console better
For server machines, ComOut is set to the set of devices that the efi
console suppots. Parse it to see if we have serial, video or both.
Make that take precidence over the command line args. boot1.efi parses
them, but loader.efi doesn't. It's not clear where to read boot.conf
from, so we don't do that. The command line args can still be set via
efibootmgr, which is more inline with the UEFI boot manager to replace
that. These args are typically used only to set serial vs video and
the com speed line. We can infer that from ComOut, so do so.
Remember the com speed and hw.uart.console to match.

RelNotes: yes
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15917
2018-07-14 00:40:38 +00:00
Warner Losh
f9ac902319 Define ADR subtype of ACPI type for a device path. 2018-07-13 21:03:32 +00:00
Warner Losh
bb50079093 Catch up to the inflate renaming. 2018-07-13 20:08:18 +00:00
Ian Lepore
949662216a Fix glitched indentation (and rewrap as needed due to deeper indent).
No functional changes.

Reported by:	rpokala@
2018-07-13 18:58:37 +00:00
Warner Losh
47bec71dd0 Use if rather than case for a simple boolean. gcc thinks blks is
undefined sometimes with the case, but enc is always 0 or 1, so
and if / else is better anyway.
2018-07-13 18:19:33 +00:00
Ian Lepore
c1418270b2 Extend loader(8) geli support to all architectures and all disk-like devices.
This moves the bulk of the geli support from lib386/biosdisk.c into a new
geli/gelidev.c which implements a devsw-type device whose dv_strategy()
function handles geli decryption. Support for all arches comes from moving
the taste-and-attach code to the devopen() function in libsa.

After opening any DEVT_DISK device, devopen() calls the new function
geli_probe_and_attach(), which will "attach" the geli code to the open_file
struct by creating a geli_devdesc instance to replace the disk_devdesc
instance in the open_file. That routes all IO for the device through the
geli code.

A new public geli_add_key() function is added, to allow arch/vendor-specific
code to add keys obtained from custom hardware or other sources.

With these changes, geli support will be compiled into all variations of
loader(8) on all arches because the default is WITH_LOADER_GELI.

Relnotes:	yes
Sponsored by:	Microchip Technology Inc
Differential Revision:	https://reviews.freebsd.org/D15743
2018-07-13 17:50:25 +00:00
Warner Losh
25bc561e68 There's two files in the sys tree named inflate.c, in addition
to it being a common name elsewhere. Rename the old kzip one
to subr_inflate.c.

This actually fixes the build issues on sparc64 that my inclusion of
.PATH ${SYSDIR}/kern created in r336244, so also revert the broken
workaround I committed in r336249.

This slipped passed me because apparently, I never did a clean build.
2018-07-13 17:41:28 +00:00
Warner Losh
623810105e Fix sparc64 builds
gcc is complaining about struct infate being defined in a parameter
list. It's inclear how long this has been broken, but the fix is
simple enough.
2018-07-13 17:15:14 +00:00
Warner Losh
c96ac12e5c Transition to boot_env_to_howto and boot_howto_to_env in the boot
loader.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205
2018-07-13 16:43:29 +00:00
Warner Losh
4569e91328 Eliminate boot loader copies of boot arg parsing.
Eliminate 4 of the copies of the arg parsing in /boot/laoder
by using boot_parse_cmdline.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205
2018-07-13 16:43:23 +00:00
Warner Losh
52379d36a9 Create helper functions for parsing boot args.
boot_parse_arg		to parse a single arg
boot_parse_cmdline	to parse a command line string
boot_parse_args		to parse all the args in a vector
boot_howto_to_env	Convert howto bits to env vars
boot_env_to_howto	Return howto mask mased on what's set in the environment.

All these routines return an int that's the bitmask of the args
translated to RB_* flags. As a special case, the 'S' flag sets the
comconsole_speed env var. Any arg that looks like a=b will set the env
key 'a' to value 'b'. If =b is omitted, 'a' is set to '1'.  This
should help us reduce the number of redundant copies of these routines
in the tree.  It should also give a more uniform experience between
platforms.

Also, invent a new flag RB_PROBE that's set when 'P' is parsed.  On
x86 + BIOS, this means 'probe for the keyboard, and if it's not there
set both RB_MULTIPLE and RB_SERIAL (which means show the output on
both video and serial consoles, but make serial primary).  Others it
may be some similar concept of probing, but it's loader dependent
what, exactly, it means.

These routines are suitable for /boot/loader and/or the kernel,
though they may not be suitable for the tightly hand-rolled-for-space
environments like boot2.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205
2018-07-13 16:43:05 +00:00
Warner Losh
007b82d7ab Stop using ../zfs/libzfs.h but instead use libzfs.h.
While ../zfs/libzfs.h mostly works, there are a few situations where
it does not. Eliminate the problem by using plain libzfs.h, like we do
for ufs support. This fixes the weird cases, and is easier to
understand. It also follows the general style convetion of avoiding
../ in #includes.
2018-07-08 07:42:58 +00:00
Warner Losh
b8902de147 Move ZFS files into libsa
Move the libzfs stuff into libsa. There's no need for it to be a
separate library. The separate library adds to the issues of build
ordering that we see from time to time. Move the filesystem support
into libsa, like all the other filesystem support rather than making
zfs the odd-duck out.

Discussed with: allanjude@
2018-07-08 07:42:49 +00:00
Emmanuel Vadot
7fcce9c487 loader: fdt: Try to load every possible DTB from u-boot
U-Boot setup a few variables :

 - fdt_addr which is the board static dtb (most of the time loaded before
   u-boot or coming from some hardware like a ROM)
 - fdt_addr_r which is a location in RAM that holds the DTB loaded by
   u-boot or before u-boot

In the case of u-boot + rpi firmware the DTB is loaded in RAM but the location
still end up in the fdt_addr variable and the fdt_addr_r variable exist.

Change the behavior so we test that a DTB exists for every possible variable :

 - fdt_addr_r is checked first as if u-boot needed to modify it the
   correct DTB will live there.
 - fdt_addr is checked second as if we run on a hardware with DTB in ROM
   it means that we what/need to run that
 - fdtaddr looks like a FreeBSD-ism but since I'm not sure leave it.

Reviewed by:	gonzo
Differential Revision:	https://reviews.freebsd.org/D16101
2018-07-04 07:37:45 +00:00
Allan Jude
436dbc4262 stand/common/disk.c: dev->d_offset still needs to be set to 0
With r335868, I thought this was no longer necessary. I was wrong.

Reported by:	ian
Sponsored by:	Klara Systems
2018-07-03 05:53:27 +00:00
Alexander Motin
5e2169bda1 Cut currdev dev and path fields for ZFS on the last colon.
Previously the code cut those fields on second colon, that prevented
boot from boot environments with colon in their names.  This change
moves the limitation from dev field to path, which is empty by default.

Reviewed by:	allanjude, tsoome
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D16068
2018-07-02 20:56:17 +00:00
Emmanuel Vadot
f127d86390 stand: uboot: Do not panic if we can't find a boot device
It is really anoying to panic when there is no boot device as you
cannot see the availables ones.
2018-07-02 18:23:43 +00:00
Allan Jude
32c52b4847 stand/common/disk.c: Read partition table relative to the start of the disk
If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh,
when disk_open() is called on a GELI encrypted partition, attempts to read
the partition table fail, as they pass through the decryption process which
turns the already plaintext data into jibberish.

When reading the partition table, always pass a slice and partition setting
of -1, and an offset of 0. Setting the slice to -1 prevents a false
positive when checking the slice against the cache of GELI encrypted
slices.

Reviewed by:	imp, ian
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15847
2018-07-02 18:19:08 +00:00
Warner Losh
b77bd037a1 Revert preference to be an int.
While in base we use it as a boolean (of the wrong spelling), there's
at least one out of tree user that needs it to be int since priorirty
is a small int, not a 0/1. In deference to the time it's wasted me and
my team, push this up into FreeBSD for whatever short life boot1 may
have in the tree.
2018-06-28 19:42:10 +00:00
Bryan Drewery
96a0acc4ce Don't use CCACHE for linking.
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-27 19:29:15 +00:00
Devin Teske
5cc9fabecf check-password.4th(8): Fix manual [in]accuracy
SVN r280384 updated the maximum password length from 16 bytes to 255. The
manual was not updated to reflect this. Found while working on kern/207069.

MFC after:	3 days
X-MFC-to:	stable/11 stable/10
Sponsored by:	Smule, Inc.
2018-06-24 19:29:29 +00:00
Allan Jude
ec82884e87 Revert r335276
This was causing issues for people booting.
I will likely bring this back as an optional feature, similar to
boot0sio, like gptboot-serial or something.

PR:		221526
Reported by:	O. Hartmann <ohartmann@walstatt.org>, Thomas Laus <lausts@acm.org>
2018-06-20 00:14:54 +00:00
Kyle Evans
80eb81f6f0 lualoader: Correct kernel_options handling
`kernel_options` were being passed as flags to load, rather than to the
kernel being loaded. This is the kernel_options counterpart to r335009.
2018-06-19 15:05:31 +00:00
Warner Losh
52666d3675 Remove stray debugging line.
Noticed by: ian@
2018-06-18 19:53:11 +00:00
Warner Losh
62bd02cee5 stand: move libgeliboot into libsa.
Reduce by 1 the number of crazy libraries we need in stand by moving
geli into libsa (where architecturally it belonged all along). This
just moves things around without any code changes.
2018-06-18 16:24:42 +00:00
Allan Jude
d48c0a685d stand/common/disk.c: Update debug printf
This was missed in r330809 because it is compiled out by default

Sponsored by:	Klara Systems
2018-06-17 19:31:35 +00:00
Allan Jude
6fee3bb8e1 gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
Normally the serial console is not enabled until /boot.config is read and
we know how the serial console should be configured.  Initialize the
consoles early in 'dual' mode (serial & keyboard) with a default serial
rate of 115200. Then serial is re-initialized once the disk is decrypted
and the /boot.config file can be read.

This allows the GELIBoot passphrase to be provided via the serial console.

PR:		221526
Requested by:	many
Reviewed by:	imp
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15862
2018-06-17 03:18:56 +00:00
Warner Losh
02cff72a7b Many netboot scenarios don't have /boot/defaults/loader.conf. As
a fallback, also check /boot/kernel/kernel existing as well, since
that's the fallback behavior of the loader.
2018-06-17 01:26:57 +00:00
Allan Jude
71f0c895c1 Avoid reading past the end of the disk in zfsboot.c and biosdisk.c
The GELI boot code rounds reads up to 4k, since the encrypted sectors are
4k, and must be decrypted as a unit. With oddball sized disks (almost
always virtual), this can lead to reading past the end of the disk.

Reviewed by:	imp, tsoome
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15844
2018-06-16 15:16:02 +00:00
Allan Jude
f567034d1b biosdisk.c: fix type in debug printf
Sponsored by:	Klara Systems
2018-06-16 06:23:07 +00:00
Allan Jude
23e7fe13ee biosdisk.c: add missing \n to error message
Sponsored by:	Klara Systems
2018-06-16 05:58:33 +00:00
Allan Jude
bdeee1b234 biosdisk.c remove redundant variable
`rdev` and `disk` serve the same purpose, read the partition table without
the `d_offset` or `d_slice` set, so the read is relative to the start of
the disk. Reuse the already initialized `disk` instead of making another
copy later.

Sponsored by:	Klara Systems
2018-06-16 04:50:40 +00:00
Allan Jude
86981e426d Correct logic error in biosdisk.c:bd_realstrategy()
The wrong condition is used when evaluating the return of disk_ioctl()
This results in reaching the 'We should not get here' branch in most casts

Reviewed by:	imp
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15839
2018-06-16 02:50:29 +00:00
Warner Losh
ab80f5423d There's no need to walk through the tables looking for the smbios
table if we're just going to ignore it on arm, so expand, slightly,
the reach of the ifdef. Move the buffer to the inner block so we
don't have a separate #ifdef far away from these lines.

The issue on arm is that smbios_detect does unaligned accesses, which
in the u-boot implementing EFI context causes a crash.
2018-06-15 19:07:37 +00:00
Warner Losh
e8282eabad Move arg parsing into its own routine for possible later reuse. 2018-06-15 19:07:31 +00:00
Warner Losh
c2bac3e1ba Provide a more direct interface to tell ZFS what the preferred handle
is. We tell the ZFS code now, and it checks rather than having a
callback to do the checks.

This will allow us to have a more graceful fallback code. In the
future, it's anticipated that we may fallback to a more global search
(or implement a command to do so) when reqeusted by the user, or we
detect a violation of the UEFI Boot Manager protocol severe enough to
warrant this backstop. For now, it just allows us to get rid of img as
a global.

Sponsored by: Netflix
2018-06-15 19:07:26 +00:00
Warner Losh
c0626257af Migrate has_keyboard to bool. 2018-06-15 19:07:06 +00:00
Toomas Soome
3557869e5f libsa: open() should use NULL instead of typecasted 0 2018-06-14 16:11:50 +00:00
Toomas Soome
7f56394a3c libsa: remobe unneeded check before free()
free() is checking for NULL, remove duplicate check.
2018-06-14 09:10:34 +00:00
Toomas Soome
7416e819ad libsa: f_rabuf could be NULL
It is possible that we will not get RA buffer from open(), therefore
we must validate RA.
2018-06-14 09:06:53 +00:00
Toomas Soome
f03b083204 libsa: cstyle cleanup for open/close/read/write sources 2018-06-14 08:58:10 +00:00
Warner Losh
5f88ee4479 bootprog_info is generated in vers.c. Move it's definition to
bootstrap.h and remove all the redundant copies.

Sponsored by: Netflix
2018-06-14 06:41:33 +00:00
Warner Losh
f80aa8cf2d Use bool for vargood, since it's a boolean.
Sponsored by: Netflix
2018-06-14 06:41:22 +00:00
Warner Losh
937a79c149 Remove redundant defs.mk includes. They aren't needed. 2018-06-14 06:14:48 +00:00
Warner Losh
46c0e42b6e Initialize variables we later free so they aren't used
uninitialized in the error path.
Remove unused variables.

Sponsored by: Netflix
2018-06-13 17:42:55 +00:00
Warner Losh
6d423eb2cb Remove unused variables.
Sponsored by: Netflix
2018-06-13 17:42:50 +00:00
Warner Losh
caa999479f Remove fail: label. It's unused.
Sponsored by: Netflix
2018-06-13 17:28:06 +00:00
Kyle Evans
35beb9285b lualoader: Match Forth module-loading behavior w.r.t flags
Also as documented in loader.conf(5), ${module}_flags are actually flags to
be passed to the module, not to `load` as was done thus far.
2018-06-12 18:42:41 +00:00
Kyle Evans
5d2791646b lualoader: More black-on-white fixes
To recap the problem: with a black-on-white xterm, the menu draws terribly.
Ideally, we would try our best for a white-on-black context for the menu
since graphics and whatnot might not be tested for other setups and there's
no reasonable way to sample the terminal at this point for the used color
scheme.

This commit attempts to address that further in two ways:
- Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for
  "default"), issue CSI bg/fg escape sequences for our expected color scheme
- Reset to *our* default color scheme before we even attempt to load the
  local module, so that we personally don't have any earlier text with the
  console default color scheme.

Reported by:	emaste (again)
2018-06-12 03:44:34 +00:00
Kyle Evans
e21e1dbe0c lualoader: Allow brand-*.lua for adding new brands
dteske@, I believe, had originally pointed out that lualoader failed to
allow logo-*.lua for new logos to be added. When correcting this mistake, I
failed to do the same for brands.

Correct the sub-mistake: creating new brands is almost identical to creating
new logos, except one must use `drawer.addBrand` and 'graphic' is the only
valid key for a branddef at the moment.

While here, I've added `drawer.default_brand` to be set to name of brand to
be used (e.g. 'fbsd', project default).

Eventually this whole goolash will be documented.

Reported by:	kmoore, iXsystems
2018-06-11 01:32:18 +00:00
Kyle Evans
deb8c8f55c lualoader: Support variable substitution in env var settings
We support both of the following cases of substitution:

bar="y"
foo="${bar}"
foo="$bar"

The latter substitution syntax is, of course, not recommended- all
punctuation must be considered potential variable names, and we do not go
through the effort of searching the different combinations of, for instance,
"$x.y.z" to determine if the variable is $x, $x.y, or $x.y.z.

This is not officially documented as supported, but it has worked in
forthloader for what is most likely a long time as `evaluate` is used to
process the right hand side of the assignment.
2018-06-10 02:36:38 +00:00
Kyle Evans
4072dcb3c7 lualoader: Process loader_conf_files properly
loader.conf(5) documents loader_conf_files to mean "additional configuration
files to be processed right after the present file." However, lualoader
ignored loader_conf_files after processing /boot/defaults/loader.conf.

Rewrite these bits to process loader_conf_files after each loaded file.
2018-06-10 01:38:52 +00:00
Kyle Evans
d4f745563d lualoader: Add cli.lua(8) to the tree
Reviewed by:	rpokala
Differential Revision:	https://reviews.freebsd.org/D14818
2018-06-09 19:51:09 +00:00
Kyle Evans
3db6d179e8 stand: One more trivial consolidation (setting environment from howto) 2018-06-09 15:52:29 +00:00
Kyle Evans
28ee318d9c stand: Fix build after r334882
Not sure how this was not caught in Universe.
2018-06-09 15:28:37 +00:00
Kyle Evans
593e2c6ece stand: Consolidate checking for boot flags driven by environment vars
e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these
in multiple places, consolidate into common/ and allow a setting of "NO" for
any of these to turn them off. This allows systems with multiple
loader.conf(5) or loader.conf(5) overlay systems to easily turn off
variables in later processed files by setting it to NO.

Reported by:	Nick Wolff @ iXsystems
Reviewed by:	imp
2018-06-09 15:10:39 +00:00
Kyle Evans
7150314eae lualoader: Add hook.lua(8) to tree
Reviewed by:	rpokala (w/ "All Rights Reserved" previously added)
Differential Revision:	https://reviews.freebsd.org/D14815
2018-06-09 14:26:30 +00:00
Kyle Evans
f6b2a4291b libsa(3): Correct statement about FS Write-support, name change
- jhb implemented UFS write support a little over 16 years ago.
- Update the library name while we're here.

Reviewed by:	jhb, rpokala
Differential Revision:	https://reviews.freebsd.org/D14476
2018-06-09 14:24:16 +00:00
Simon J. Gerraty
5ad42d0f47 Add st_mtime, st_ino and st_dev for ufs_stat
Differential Revision:	D15064
2018-06-09 02:41:51 +00:00
Kyle Evans
7aba5b2f6a lualoader: Add a loaded hook for others to execute upon config load
This will not be executed on reload, though later work could allow for that.
It's intended/expected that later work won't generally need to happen on
every config load, just once (for, e.g., menu initialization) or just when
config is reloaded but not upon the initial load.
2018-06-06 18:28:17 +00:00
Ian Lepore
9f6fd8397c Remove comments and assertions that are no longer valid after r330809.
r330809 replaced duplication of devdesc struct fields with an embedded copy
of the devdesc struct, to avoid fragility.  That means all the scattered
comments indicating that structs must match are no longer valid.  Likewise
asserts that attempted to mitigate some of the old fragility.

Reviewed by:	imp@
2018-06-05 22:13:45 +00:00
Ian Lepore
3e9c7874ce Make the v*printf() functions in libsa return int instead of void.
This makes them compatible with the C standard signatures, avoiding
spurious mismatch errors in the places where the oddball requirements
of standalone code end up putting two declarations of the same function
in play.
2018-06-05 17:18:10 +00:00
Ian Lepore
1851d70d31 Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h.
I'm not sure why the v*printf() functions in libsa return void instead of
int, but this maintains that convention for the new function.
2018-06-05 14:47:13 +00:00
Dimitry Andric
073193ed51 Fix build of stand with base gcc
* Make autoboot() a static function in stand/common/boot.c, so it does
  not shadow local variables in gptboot.c and zfsboot.c.
* Remove -Winline from the Makefiles for gptboot, gptzfsboot and
  zfsboot, as gcc will always fail to inline some functions, and there
  is nothing we can do about it.
* For gcc <= 4.2.1, silence -Wuninitialized for isoboot, as it produces
  a false positive warning.
* Remove deprecated and unnecessary -mcpu=i386 flag from stand/defs.mk,
  as there is already a -march=i386 flag further in the file.

Reviewed by:	imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D15628
2018-05-31 14:38:13 +00:00
Warner Losh
3dfe152d8d Pass a struct devdesc to the format commands. Use proper type rather
than doing weird type-punning that happened to work because the size
was right. We copied a zfs devdesc into a disk_devdesc and then after
passing through a NULL pointer reinterpreted it as a
zfs_devdesc. Instead, pass the base devdesc around and 'upcase' when
we know the types are right.

This has the happy side effect of fixing a gcc warning about bad
type punning.

Differential Revision: https://reviews.freebsd.org/D15629
2018-05-31 02:54:11 +00:00
Warner Losh
9958932695 Teach ufs_module.c about bsd labels and probe 'a' partition.
If the check for a UFS partition at offset 0 on the disk fails, check
to see if there's a BSD disklabel at block 1 (standard) or at offset
512 (install images assume 512 sector size). If found, probe for UFS
on the 'a' partition.

This fixes UEFI booting images from a BSD labeled MBR slice when the
'a' partiton isn't at offset 0. This is a stop-gap fix since we plan
on removing boot1.efi in FreeBSD 12. We can't easily do that for 11.2,
however, hence the short MFC window.

Tested by: emaste@
MFC After: 3 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15598
2018-05-29 03:58:29 +00:00
Marius Strobl
dd5dbb3199 - Unbreak booting sparc64 kernels after the metadata unification in
r329190; sparc64 kernels are always 64-bit but with that revision
  in place, the loader was treating them as 32-bit ones.
- In order to reduce the likelihood of this kind of breakage in the
  future, #ifdef out md_load() on sparc64 and make md_load_dual() -
  which is currently local to metadata.c anyway - static.
- Make md_getboothowto() - also local to metadata.c - static.
- Get rid of the unused DTB pointer on sparc64.
2018-05-21 01:20:19 +00:00
Ed Maste
408c1ff8f4 Clarify that boot_mute / boot -m mutes kernel console only
Perhaps RB_MUTE could mute user startup (rc) output as well, but right
now it mutes only kernel console output, so make the documentation match
reality.

PR:		228193
Sponsored by:	The FreeBSD Foundation
2018-05-16 02:15:18 +00:00
Warner Losh
09001b5c78 Revert r333365
Even though we don't use it, it appears something else requires it to
be != 0 to work. This breaks tftp boot in loader.efi, so revert until
that can be sorted out.
2018-05-10 20:27:12 +00:00
Mariusz Zaborski
31f7586d73 Introduce the 'n' flag for the geli attach command.
If the 'n' flag is provided the provided key number will be used to
decrypt device. This can be used combined with dryrun to verify if the key
is set correctly. This can be also used to determine which key slot we want to
change on already attached device.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D15309
2018-05-09 20:53:38 +00:00
Kyle Evans
4b3c64f722 Remove "All Rights Reserved" on files that I hold sole copyright on
See r333391 for more detail; in summary: it holds no weight and may be
removed.
2018-05-09 16:44:19 +00:00
Warner Losh
a1947307e7 We don't use f_devdata, so don't set it. Should that need to change
later, we can. This leaves ZFS as the only irregular f_devdata
user in the tree.
2018-05-08 16:16:56 +00:00
Warner Losh
e4eef18848 Use M. Warner Losh everywhere on my copyrights.
Remove 'All Rights Reserved' where I can.
2018-05-01 16:29:22 +00:00
Warner Losh
ad7d33c45b No need to make objects here. 2018-04-27 22:15:18 +00:00
Kyle Evans
fb205d37d7 forthloader: Remove "EFI boot environment message"
Contrary to what the message says, this is not only executed in an EFI
context- it provides functions for use in an EFI environment. I don't think
there's much reason to broadcast this fact when we haven't in the past, so
just remove it.

Reported by:	emaste (a while ago), cperciva
2018-04-25 02:42:57 +00:00
Ed Maste
b25a46f7f7 Add support for linker-type-specific flags
r332090 added a LINKER_TYPE test to add the --no-rosegment flag when
linking the i386 loader components with lld.  Instead, introduce a
general mechanism for setting LDFLAGS for a specific linker type,
and use it for --no-rosegment.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14998
2018-04-19 20:58:09 +00:00
Kyle Evans
807dbf2b94 efi loader: Address two nits with recent graphics changes
- We should be setting a known graphics mode on conout, but we aren't.
- We shouldn't be setting gop mode if we didn't find a good resolution to
  set, but we were. This made efi_max_resolution=1x1 effectively worthless,
  since it would always set gop mode 0 if nothing else.
2018-04-19 03:31:41 +00:00
Kyle Evans
87c0258beb Regenerate FAT templates after r332561 2018-04-16 15:13:18 +00:00
Toomas Soome
b67d407ac7 loader: cstyle cleanup of command.c
just clean it up. no functional changes intended.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D15087
2018-04-16 14:10:19 +00:00
Kyle Evans
db911ed570 Rename volume label for ESP
Harry Schmalzbauer reports that some firmware, in his experience, trips
over the ESP we install due to the volume label. It has been theorized that
this is due to some confusion with the label and the path on the ESP to
boot1.efi.

Regardless, Harry found that renaming the label seems to fix it.

PR:		214282
MFC after:	3 days
2018-04-16 13:18:18 +00:00
Toomas Soome
6d68f8acf4 loader: make sure we do not return garbage from help_getnext
Since we do free subtopic and desc in help_getnext(), we need to set them also
NULL, so we make sure we dont get double free().

Approved by:	bapt
Differential Revision:	https://reviews.freebsd.org/D15082
2018-04-16 12:46:14 +00:00
Toomas Soome
746dddb134 loader: command_errmsg should be const
Use const char * for command_errmsg.
2018-04-16 08:41:44 +00:00
Toomas Soome
faa5306390 loader: make sure we use snprintf() in commands.c
Safeguard against memory corruptions.
2018-04-16 08:15:50 +00:00
Toomas Soome
5276f60430 loader: provide values in help_getnext()
With r328289 we attempt to make sure we free the resources allocated in
help_getnext(), however, it is possible that we get no resources allocated
and help_getnext() will return early.

Make sure we have pointers set to NULL early in help_getnext().

Reported by:	Andy Fiddaman
2018-04-16 07:26:23 +00:00
Brooks Davis
3a4fc8a8a1 Remove support for the Arcnet protocol.
While Arcnet has some continued deployment in industrial controls, the
lack of drivers for any of the PCI, USB, or PCIe NICs on the market
suggests such users aren't running FreeBSD.

Evidence in the PR database suggests that the cm(4) driver (our sole
Arcnet NIC) was broken in 5.0 and has not worked since.

PR:		182297
Reviewed by:	jhibbits, vangyzen
Relnotes:	yes
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D15057
2018-04-13 21:18:04 +00:00
Warner Losh
fa9dc8d3ed Refactor currdev setting
Refactor the currdev setting to find the device we booted from. Limit
searching when we don't already have a reasonable currdev from that to
the same device only. Search a little harder for ZFS volumes as that's
needed for loader.efi to live on an ESP.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D13784
2018-04-11 19:46:24 +00:00
Warner Losh
7afc7a8717 Revert r332275, r332272, r332270
There's problems with them. The order of efi stuff isn't quite right,
and there's various problems. Revert until thos problems can be fixed.

Reviewed by: kevans@
2018-04-11 18:02:13 +00:00
Toomas Soome
74837c798c loader: 332270 did left out stand/i386/loader/loader.rc
we have 2 instances of loader.rc...
2018-04-08 13:40:38 +00:00
Toomas Soome
ff77d7a560 loader: 332270 did use wrong path for efi.4th
The correct  path is still /boot/efi.4th
2018-04-08 11:55:27 +00:00
Toomas Soome
cae0ecf693 loader: include efi.4th only if we do have uefi
Also simplify efi.4th.
2018-04-08 11:39:27 +00:00
Toomas Soome
b1e0bc1210 libsa: name is not used in dirmatch()
Seems like variable 'name' is leftover.
2018-04-07 14:42:47 +00:00
Toomas Soome
213f235f49 libsa: cd9660: warning: 'lenskip' may be used uninitialized in this function
We better provide value for lenskip in both instances.
2018-04-07 14:40:09 +00:00
Kyle Evans
814a016d28 lualoader: Fix menu skipping with loader.conf(5) vars
Earlier efforts to stop loading the menu broke the ability to skip the menu
with, e.g., beastie_disable in loader.conf(5) as it was decided before
configuration was read.

Defer bringing in the menu module until we've loaded configuration so that
we can make a more informed decision on whether the menu should be skipped
or not.
2018-04-06 15:19:48 +00:00
Ed Maste
93b980a802 stand: pass --no-rosegment for i386 bits when linking with lld
btxld does not correctly handle input with other than 2 PT_LOAD
segments.  Passing --no-rosegment lets lld produce output eqivalent to
ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO.

PR:		225775
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D14956
2018-04-06 02:57:58 +00:00
Benno Rice
48990fce8e Add an ISO9660 "partition table" type to loader.
When booted via isoboot(8) loader will be handed a disk that simply contains
an ISO9660 image. Currently this confuses it greatly. Teach it how to spot
that it's in this situation and that ISO9660 has one "partition" covering
the whole disk.

Reviewed by:	imp
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14915
2018-04-05 19:45:30 +00:00
Benno Rice
7acb51f681 Add isoboot(8) for booting BIOS systems from HDDs containing ISO images.
This is part of a project for adding the ability to create hybrid CD/USB boot
images. In the BIOS case when booting from something that isn't a CD we need
some extra boot code to actually find our next stage (loader) within an
ISO9660 filesystem. This code will reside in a GPT partition (similar to
gptboot(8) from which it is derived) and looks for /boot/loader in an
ISO9660 filesystem on the image.

Reviewed by:	imp
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14914
2018-04-05 19:40:46 +00:00
Benno Rice
288013f54c Various style(9) fixes.
Reviewed by:	strip --strip-debug -o - gptboot.o | md5
Sponsored by:	iXsystems, Inc.
2018-04-05 19:29:22 +00:00
Benno Rice
8e48426cae Use consistent whitespace.
Reviewed by:	strip --strip-debug -o - gptboot.o | md5
Sponsored by:	iXsystems, Inc.
2018-04-05 19:27:24 +00:00
Kyle Evans
643dc495a0 Default loader.conf: Drop efi_max_resolution to 1x1
Effectively disabling the mode changing bits in the loader. No matter which
way we go with it, it seems to be wrong- either the firmware doesn't change
the resolution and reports the resolution we requested, or the firmware
changes the resolution and doesn't report the resolution we requested. It
some cases, it does the right thing, but the bad cases outweight those.

Interested individuals can still set efi_max_resolution to 1080p or whatnot
in loader.conf(5) to restore the new behavior, but the new behavior does not
work out well for many cases.

Discussed with: imp
2018-04-03 02:41:32 +00:00
Kyle Evans
bbb516ae23 lualoader: Don't try to lookup a nil logo 2018-04-01 01:21:00 +00:00
Kyle Evans
1091c8fe47 lualoader: Split logodefs out into logo-* files
This commit splits all of the logodefs/graphics out into their own own files
and provides a method for these files to register their logodefs with the
drawer. Graphics are now loaded on demand if they don't exist in the current
set of logodefs.

The drawer module becomes a little easier to navigate through without all of
the graphics mixed in. It's also easy to do one-off graphics like the
9.2 Die Hard tribute by dteske@ without adding even more to our memory
requirements.
2018-04-01 01:07:15 +00:00
Kyle Evans
8d21763e08 lualoader: Simplify some expressions
- No need for a 'goto' when our entire loop body is then wrapped in a
  conditional.

- No need to leave commented out prints laying around

- If an expression is clearly going to be either nil or an expression that
  isn't likely to be a boolean, we might as well use `or` to specify a
  default value for the expression. e.g. `loader.getenv(...) or "no"`
2018-04-01 00:22:51 +00:00
Kyle Evans
9994e26f37 lualoader: revert whitespace change that snuck in 2018-03-31 23:50:20 +00:00
Kyle Evans
509b21c338 lualoader: Don't assume that {module}_load is set
The previous iteration of this assumed that {module}_load was set. In the
old world order of default loader.conf(5), this was probably a safe
assumption given that we had almost every module explicitly not-loaded in
it.

In the new world order, this is no longer the case, so one could delete a
_load line inadvertently while leaving a _name, _type, _flags, _before,
_after, or _error. This would have caused a confusing Lua error and borked
module loading.
2018-03-31 23:49:00 +00:00
Kyle Evans
9c2d9b9e6d lualoader: Do case-insensitive comparison of "yes" 2018-03-31 23:40:05 +00:00
Warner Losh
80105e4e72 fwohcireg.h is 99% the same between the boot loader and the
kernel. Delete it and fix up the 1% difference because there's no need
for them to be different.
2018-03-31 22:02:59 +00:00
Emmanuel Vadot
c5cf2b33fe efinet: Do not return only if ReceiveFilter fails
If the network interface or the uefi implementation do not support the
ReceiveFilter interface do not return only and just print a message.
U-Boot doesn't support is and likely never will. Also even if this fails
it doesn't mean that network in EFI isn't supported.
2018-03-30 16:37:08 +00:00
Kyle Evans
3bb88c3c7f stand: Add workaround for HP BIOS issues
hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
boot immediately after installation with the claim that it can't work out
which disk they are booting from.

They tracked it down to a buffer overrun, and found that it could be
alleviated by doing a dummy read before-hand.

Submitted by:	kuriyama
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14341
2018-03-29 00:55:11 +00:00
Eugene Grosbein
34a1f87bdd Fix instructions in the zfsboot manual page.
zfsloader(8) fails to probe a slice containing ZFS pool if its second sector
contains traces of BSD label (DISKMAGIC == 0x82564557).
Fix manual page to show working example erasing such traces.

PR:		226714
Approved by:	avg (mentor)
MFC after:	3 days
2018-03-27 17:37:08 +00:00
Kyle Evans
892b3a5272 lualoader: Actually re-raise error in try_include
It was previously only printed, but we do actually want to raise it as a
full blown error so that things don't look OK when they've actually gone
wrong.

The second parameter to error, level, is set to 2 here so that the error
message reflects the position of the try_include caller, rather than the
try_include itself. Example:

LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a
nil value (global 'cxcint').
2018-03-26 19:06:25 +00:00
Kyle Evans
07faaf7815 lualoader: Implement try_include and use it for including the local module
This provides a way to optionally include a module without having to wrap it
in filesystem checks. try_include is a little more robust, using the lua
search path instead of forcing us to explicitly consider all of the places
we could want to include a module. Errors are still generally raised from
trying to load the module, but ENOENT will not get raised unless we're doing
a verbose load.

This will also be used to split out logo/brand graphics into their own files
so that we can safely scale up the number of graphics included without
worrying about the extra memory consumption- opting to lazily load graphics
instead.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D14658
2018-03-26 19:01:22 +00:00
Kyle Evans
76e00374d2 loader efifb: implement uga_autoresize as a call to text_autoresize
UGA does not have the same kind of mode enumeration that GOP does. Implement
it instead as a call to text_autoresize so that firmwares with only UGA
present still get some kind of autoresizing behavior.

While here, rename a typo'd "gop" to "uga", although it will remain unused
for the time being.
2018-03-26 13:45:17 +00:00
Kyle Evans
dbef52531e lualoader: Privatize some more config.lua bits
These functions are also not quite suitable for a public API, so privatize
them to config.
2018-03-24 04:03:55 +00:00
Kyle Evans
64c91742f3 lualoader: Make config env-related bits private API
This pertains exclusively to the set/restore functionality that we offer,
where any changes made by loader.conf previously will be effectively removed
upon reload of the configuration. We don't currently have a need to export
these, so don't bother.
2018-03-24 04:00:01 +00:00
Kyle Evans
bc40337bb0 loader consoles: Implement SGR 24, 25
Mostly for completeness sake- implement 24 (no underline) and 25 (no blink)

MFC after:	3 days
2018-03-24 02:01:25 +00:00
Kyle Evans
1c1692795a efi loader: Choose a console mode instead if hw.vga.textmode is set
Not all systems use efifb; pull hw.vga.textmode and choose a good console
mode instead if it's set to something non-zero. This is basically a revival
of the code that used to live in boot1, but instead rebased onto this
different way of doing mode selection in loader.efi.

Interestingly enough, the regression that was previously introduced where
GOP would not reflect the console setting does not seem to exist when
console mode selection is done here. I've not done any investigation as to
why this is the case. Nevertheless, boot1.efi is still not the best place to
do mode selection.
2018-03-24 01:53:43 +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
05e8899d7d efi loader: Respect efi_max_resolution in loader.conf(5)
Default the max resolution to 1080p, we'll accept Width x Height
specifications along with the following presets:

- 480p
- 720p
- 1080p
- 2160p or 4k
- 5k

PR:		224825
Differential Revision:	https://reviews.freebsd.org/D14801
2018-03-23 21:02:46 +00:00
Kyle Evans
171403a3b3 Match broken style of vidconsole.c
This particular function uses a broken mix of indentation styles. Match it
for the newly added SGR 22 bits.

Reported by:	jkim
X-MFC-With:	r331416
2018-03-23 17:22:28 +00:00
Kyle Evans
88ccfa7497 Loader consoles: Implement SGR 22, reset intensity
MFC after:	3 days
2018-03-23 03:48:45 +00:00
Kyle Evans
9afece1e2f forthloader: Don't break BIOS boots...
I thought I tested this scenario, but clearly I failed to. =(

BIOS boots won't have efi-autoresizecons, so trying to use it as a forth
word fails during include. Use evaluate on "efi-autoresizecons" as a string
instead to move any potential errors to runtime- safely after we've already
checked that we're booting UEFI.

Pointy hat to:	me
Reported by:	cy
2018-03-22 04:16:14 +00:00