History log of /freebsd-11-stable/stand/common/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
361856 06-Jun-2020 kevans

MFC r361763: lualoader: drop the filename and word "LUA" from errors

The filename is nearly always wrong since it's /boot/lua/loader.lua, which
is not useful for diagnostics. The actual errmsg will include a lua filename
if this is relevant.

Dropping "LUA" while we're here because that's almost universally
irrelevant to whatever error follows, unless the error states that it's
actually a lua problem.

Both of these are minor nits that just detract from identifying the
pertinent information.

361538 26-May-2020 kevans

loader: fix userboot's ability to detect a guest's interpreter

Some time after r338418, I believe with -Os/-Oz -ffunction-sections
-fdata-sections, the bootprog_interp variable that held our "$Interpreter:"
marker started getting strip from all loaders, with exception to userboot
since it used bootprog_interp to determine what flavor of userboot it was.

At some point, it had been brought to my attention that this was no longer
working and I had worked up some potential solutions to use the variable
that involved printing it out. My vague recollection is that this was
rejected, and I forgot to explore the alternatives; I cannot find records of
this discussion anymore.

Fast forward to present day, Andrew reported that it was non-functional and
offered (effectively) this patch (sans comment) to stop the compiler from
optimizing it out by assigning it to a volatile variable. This removes
concerns about user-facing change while retaining the interpreter marker.
Furthermore, it could certainly be uglier.

358442 28-Feb-2020 kevans

MFC r357828: interp_lua: fix bogus indentation, NFC

358198 21-Feb-2020 kevans

MFC r357827: lualoader: disable autoboot on high-level interpreter errors

If we hit an error at this level, we are almost certainly not in any kind
of sane state where autoboot can do the right thing. Instead of letting it
try and probably failing, disable autoboot so they immediately get kicked
into a loader prompt for manual remediation/diagnosis.

355345 03-Dec-2019 kevans

MFC r354245, r354833, r354837: add flua to the base system

r354245: stand: consolidate knowledge of lua path

Multiple places coordinate to 'know' where lua scripts are installed. Knock
this down to being formally defined (and overridable) in exactly one spot,
defs.mk, and spread the knowledge to loaders and liblua alike. A future
commit will expose this to lua as loader.lua_path, so it can build absolute
paths to lua scripts as needed.

r354833: Add flua to the base system, install to /usr/libexec

FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever
extensions we need for base system operations. We currently support a subset
of lfs and lposix that are used in the rewrite of makesyscall.sh into lua,
added in r354786.

flua is intentionally written such that one can install standard lua and
some set of lua modules from ports and achieve the same effect.

linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added
in. This is similar to what we do in stand/. linit.c has been renamed to
make it clear that this has flua-specific bits.

luaconf has been slightly obfuscated to make extensions more difficult. Part
of the problem is that flua is already hard enough to use as a bootstrap
tool because it's not in PATH- attempting to do extension loading would
require a special bootstrap version of flua with paths changed to protect
the innocent.

src.lua.mk has been added to make it easy for in-tree stuff to find flua,
whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.

r354837: flua: newer GCC complains about format-nonliteral at WARNS=2

Disable that one, too.

348866 10-Jun-2019 kevans

MFC r348569: [zfsboot] Fix boot env back compat (#190)

* Fix boot env back compat

zfsboot must try zfsloader before loader in order to remain compatible
with boot environments created prior to zfs functionality being rolled
into loader proper.

* Improve comments in zfsboot

Explain the significance of the load path order, and put the comment
about looping through the paths in the appropriate scope.

Approved by: re (gjb)

347182 06-May-2019 tsoome

MFC r347142:

loader: validate sectorsize argument in disk_open()

The bug and patch is reported against 11.2, but it is good idea to have
the check in place for all versions.

PR: 236585
Submitted by: john@feith.com
Reported by: john@feith.com

346483 21-Apr-2019 kevans

MFC r343911, r344238-r344241, r344247, r344254-r344255, r344260, r344268,
r344335, r344839, r345066, r345330

r343911:
Allow reading the UEFI variable size

When loading bigger variables form UEFI it is necessary to know their
size beforehand, so that an appropriate amount of memory can be
allocated. The easiest way to do this is to try to read the variable
with buffer size equal 0, expecting EFI_BUFFER_TOO_SMALL error to be
returned. Allow such possible approach in efi_getenv routine.

Extracted from a bigger patch as suggested by imp.

r344238:
Restore loader(8)'s ability for lsdev to show partitions within a bsd slice.

I'm pretty sure this used to work at one time, perhaps long ago. It has
been failing recently because if you call disk_open() with dev->d_partition
set to -1 when d_slice refers to a bsd slice, it assumes you want it to
open the first partition within that slice. When you then pass that open
dev instance to ptable_open(), it tries to read the start of the 'a'
partition and decides there is no recognizable partition type there.

This restores the old functionality by resetting d_offset to the start
of the raw slice after disk_open() returns. For good measure, d_partition
is also set back to -1, although that doesn't currently affect anything.

I would have preferred to make disk_open() avoid such rude assumptions and
if you ask for partition -1 you get the raw slice. But the commit history
shows that someone already did that once (r239058), and had to revert it
(r239232), so I didn't even try to go down that road.

r344239:
Use a couple local variables to avoid repetitive long expressions that
cause line-wrapping.

r344240:
Make lsdev -v output line up in neat columns by using a fixed width for
the size field and a tab between the partition type and the size.

Changes this

disk devices:
disk0 (MMC)
disk0s1: DOS/Windows 49MB
disk0s2: FreeBSD 14GB
disk0s2a: FreeBSD UFS 14GB
disk0s2b: Unknown 2048KB
disk0s2d: FreeBSD UFS 2040KB

to this

disk devices:
disk0 (MMC)
disk0s1: DOS/Windows 49MB
disk0s2: FreeBSD 14GB
disk0s2a: FreeBSD UFS 14GB
disk0s2b: Unknown 2048KB
disk0s2d: FreeBSD UFS 2040KB

r344241:
Garbage collection no-longer-used constant.

r344247:
Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot
loaderdev variable works correctly.

The uboot_devdesc struct is variously cast back and forth between
uboot_devdesc and disk_devdesc as pointers are handed off through various
opaque interfaces. uboot_devdesc attempted to mimic the layout of
disk_devdesc by having a devdesc struct, followed by a union of some
device-specific stuff that included a struct that contains the same fields
as a disk_devdesc. However, one of those fields inside the struct is 64-bit
which causes the entire union to be 64-bit aligned -- 32 bits of padding
is added between the struct devdesc and the union, so the whole mess ends
up NOT properly mimicking a disk_devdesc after all. (In disk_devdesc there
is also 32 bits of padding, but it shows up immediately before the d_offset
field, rather than before the whole collection of d_* fields.)

This fixes the problem by using an anonymous union to overlay the devdesc
field uboot network devices need with the disk_devdesc that uboot storage
devices need. This is a different solution than the one contributed with
the PR (so if anything goes wrong, the blame goes to me), but 95% of the
credit for this fix goes to Pawel Worach and Manuel Stuhn who analyzed the
problem and proposed a fix.

r344254:
Use DEV_TYP_NONE instead of -1 to indicate no device was specified.

DEV_TYP_NONE has a value of zero, which makes more sense since the device
type is a bunch of bits describing the device, crammed into an int.

r344255:
Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'.

r344260:
Allow the u-boot loaderdev env var to be formatted in the "usual" loader(8)
way: device<unit>[s|p]<slice><partition>. E.g., disk0s2a or disk3p12.
The code first tries to parse the variable in this format using the
standard disk_parsedev(). If that fails, it falls back to parsing the
legacy format that has been supported by ubldr for years.

In addition to 'disk', all the valid uboot device names can also be used:
mmc, sata, usb, ide, scsi. The 'disk' device serves as an alias for all
those types and will match the Nth storage-type device found (where N is
the unit number).

r344268:
loader: ptable_close() should check its argument

If the passed in table is NULL, just return.

r344335:
Fix the handling of legacy-format devices in the u-boot loaderdev variable.
When I added support for the standard loader(8) disk0s2a: type formats,
the parsing of legacy format was broken because it also contains a colon,
but it comes before the slice and partition. That would cause disk_parsedev()
to return success with the slice and partition set to wildcard values.

This change examines the string first, and if it contains spaces, dots, or
a colon at any position other than the end, it must be a legacy-format
string and we don't even try to use disk_parsedev() on it.

r344839:
Add retry loop around GetMemoryMap call to fix fragmentation bug

The call to BS->AllocatePages can cause the memory map to become framented,
causing BS->GetMemoryMap to return EFI_BUFFER_TOO_SMALL more than once. For
example this can happen on the MinnowBoard Turbot, causing the boot to stop
with an error. Avoid this by calling GetMemoryMap in a loop.

r345066:
stand: Improve some debugging experience

Some of these files using <FOO>_DEBUG defined a DEBUG() macro to serve as a
debug-printf. -DDEBUG is useful to enable some debugging output across
multiple ELF/common parts, so switch the DEBUG-as-printf macros over to
something more like DPRINTF that is more commonly used for this kind of
thing and less likely to conflict.

userboot/elf64_freebsd debugging also assumed %llx for uint64; use PRIx64
instead.

r345330:
loader: fix loading of kernels with . in path

The loader indended to search the kernel file name (only) for . but
instead searched the entire path, so paths like
"boot/test.elfv2/kernel" would not work.

PR: 233097

346482 21-Apr-2019 kevans

MFC r341101, r341231, r341276, r341329, r341433, r341780, r342054-r342055,
r342721, r342742, r342840, r343008, r343225

r341101:
powerpcspe: Don't crash the loader on ubldr with SPE instructions.

-msoft-float seems to be insufficient for disabling the SPE on powerpcspe.
Force it off with -mno-spe as well. This prevents a crash in ubldr on
powerpcspe.

r341231:
loader: command_bcache() should print unsigned values

All bcache counters are unsigned.

r341276:
When handling CMD_CRIT error set command_errmsg to NULL after we dump it out,
so that it does not result in error message printed twice.

OK load doodoo
can't find 'doodoo'
can't find 'doodoo'
OK

r341329:
loader.efi: fix EFI getchar() for multiple consoles

This fix is ported from illumos (issue #9970), the analysis and initial
implementation was done by John Levon.

See also: https://www.illumos.org/issues/9970

Currently, efi_cons_getchar() will wait for a key. While this seems to make
sense, the implementation of getchar() in common/console.c will loop across
getchar() for all consoles without doing ischar() first.

This means that if we've configured multiple consoles, we can't input into
the serial, as getchar() will be sat waiting for input only from efi_console.c

This patch does implement a bit more generic key buffer to support
translation of input keys, and we use generic efi_readkey() to reduce
duplication from calls from getchar() and poll().

r341433:
Move inclusion of src.opts.mk later.

src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD
depending on the MK_CTF value. We then set MK_CTF to no, which has no
real effect. The solution is to set all the MK_foo values before
including src.opts.mk.

This should stop the cdboot binary from exploding in size for releases
built WITH_CTF=yes in src.conf.

r341780:
powerpc/ubldr: Teach powerpc's ubldr to boot 64-bit kernels

This is just a copy of powerpc/ofw's ppc64_elf_freebsd.c modified to fit
ubldr's boot format.

r342054:
Print an error message in efi_main.c if we can't allocate memory for the heap

With the default Qemu parameters, only 128MB RAM gets given to a VM. This causes
the loader to be unable to allocate the 64MB it needs for the heap. This change
makes the cause of the error more obvious.

r342055:
Cast error message in efi_main.c to CHAR16* to avoid build error

r342721:
loader.efi: update memmap command to recognize new attributes

Also move memory type to string translation to libefi for later use.

r342742:
loader.efi: efi variable rework and lsefi command added

This update does add diag and debug capabilities to interpret the efi
variables, configuration and protocols (lsefi).

The side effect is that we add/update bunch of related headers.

r342840:
Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader
code.

r343008:
Add Dell Chromebook to the list of devices with E820 extmem quirk enabled

Just like for Acer C270 chromebook the E820 extmem workaround is required for
FreeBSD to boot on Dell chromebook.

r343225:
Unbreak mip64 build after r328437

Add exit and getchar functions to beri/boot2 code. They are required by
panic_action functin introduced in r328437

PR: 18498, 204916

346480 21-Apr-2019 kevans

MFC r338262, r339334, r339796, r340240, r340857, r340917, r341007

r338262:
stand: fdt: Drop some write-only assignments/variables and leaked bits

Generally straightforward enough; a copy of argv[1] was being made in
command_fdt_internal, solely used for a comparison within the
handler-search, then promptly leaked.

r339334:
loader.efi: add poweroff command

Add poweroff command to make life a bit easier.

r339796:
Simplify the EFI delay() function by calling BS->Stall()

r340240:
loader: ptable_open() check for ptable_cd9660read result is wrong

The ptable_*read() functions return NULL on read errors (and partition table
closed as an side effect). The ptable_open must check the return value and
act properly.

r340857:
Nuke out buffer overflow safety marker code, it duplicates similar code in
the malloc()/free() as well as having potential of softening the handling
in case error is detected down to a mere warning as compared to hard panic
in free().

r340917:
Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.

r341007:
Bump the date of pxeboot(8) manual page for r340917.

PR: 123484, 232483

346476 21-Apr-2019 kevans

MFC r341253, r341328, r342619, r342626, r342707, r342785, r342865

r341253:
The libstand's panic() appends its own '\n' to the message, so that users of the API
don't need to supply one.

r341328:
loader: create separate lists for fd, cd and hd, merge bioscd with biosdisk

Create unified block IO implementation in BIOS version, like it is done in UEFI
side. Implement fd, disk and cd device lists, this will split floppy devices
from disks and will allow us to have consistent, predictable device naming
(modulo BIOS issues).

r342619:
loader: create bio_alloc and bio_free for bios bounce buffer

We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement
bio_alloc()/bio_free() interface to make it possible to use this space for
other BIOS calls (notably, from biosdisk.c).

r342626:
Add Copyright.

r342707:
i386_parsedev() needs to support fd devices

r342785:
With buggy int13 ah=15, we can mis-identify the floppy devices.

We have no option than trust INT13 ah=08 return code during the init phase.

r342865:
biospci_write_config args were backwards

biospci_write_config args swapped length and value to write. Some
hardware coped just fine, while other hardware had issues.

PR: 155441, 234460

346475 21-Apr-2019 kevans

MFC r339658, r339959, r340047, r340049, r340215

r339658:
loader: biosdisk interface should be able to cope with 4k sectors

The 4kn support in current bios specific biosdisk.c is broken, as the code
is only implementing the support for the 512B sector size.

This work is building the support for custom size sectors, we still do assume
the requested data to be multiple of 512B blocks and we only do address the
biosdisk.c interface here.

For reference, see also:
https://www.illumos.org/issues/8303
https://www.illumos.org/rb/r/547

As the GELI is moved above biosdisk "layer", the GELI should just work

r339959:
loader: issue edd probe before legacy ah=08 and detect no media

while probing for drives, use int13 extended info before standard one and
provide workaround for case we are not getting needed information in case
of floppy drive.

In case of INT13 errors, there are (at least) 3 error codes appearing in case
of missin media - 20h, 31h and 80h. Flag the no media and do not print an
error.

r340047:
loader: do not probe floppy devices for zfs

The subject is telling it all.

r340049:
loader: biosdisk should check if the media is present

The bd_print/bd_open/bd_strategy need to make sure the device does have
media, before getting into performing IO operations. Some systems can
hung if the device without a media is accessed.

r340215:
loader: always set media size from partition.

The disk access is validated by using partition table definitions, therefore
we have no need for if statements, just set the disk size.

Of course the partition table itself may be incorrect/inconsistent, but if
so, we are in trouble anyhow.

346042 08-Apr-2019 kevans

MFC r344161: stand: dev_net: correct net_open's interpretation of params

net_open previously casted the first vararg to a char * and this was
half-OK: at first, it is passed to netif_open, which would cast it back to
the struct devdesc * that it really is and use it properly. It is then
strdup()d and used as the netdev_name, which is objectively wrong.

Correct it so that the first vararg is properly casted to a struct devdesc *
and the netdev_name gets set properly to make it more clear at a glance that
it's not doing something horribly wrong.

344413 21-Feb-2019 kevans

MFC Loader Interpreter Coexistance: r337806, r337868, r337914, r337927,
r337989, r338052, r338064, r338407, r338418, r338474

r337806:
Create a loader for each interpreter for x86 BIOS and all EFI

Create loader_{4th,lua,simp}{,.efi}. All of these are installed by
default. Create LOADER_DEFAULT_INTERP to specify the default
interpreter when no other is specified. LOADER_INTERP is the current
interpreter language building. Turn building of lua on by default to
match 4th. simploader is a simplified loader build w/o any interpreter
language (but with a simple loader). This is the historic behavir you
got with WITHOUT_FORTH. Make a hard link to the default loader. This
has to be a hard link rather than the more desirable soft link because
older zfsboot blocks don't support symlinks.

r337868:
stand: Use -Oz/-Os for all loader/stand builds.

While we're not super size constrained, the x86 BIOS /boot/loader has
to be less than about 520k-530k to be reliable. The LUA loader is at
this size today. -Oz saves 15-20% on the size, keeping us safely small
enough (comparable to where we were with the 4th loader). This will
also help with sjg's work on bringing in bearssl, though we may again
be looking for space in the LUA loader.

Size table for clang 6.0.0:
default -O1 -Os -Oz
4th 442368 417792 389120 376832
lua 524288 479232 446464 430080

r337914:
Install links for loader.efi.

r337927:
Add ashldi3 and ashrdi3 to mips.

Now that we're using -Os, mips needs these routines.

r337989:
Copy the boot loader from the new location for the co-existing
loaders.

r338052:
libsa: Add lshrdi3.c for powerpc* and mips

r338064:
Turn back the clock just a little: make userboot.so always be 4th

Turns out there was a hidden dependency we hasn't counted upon. The
host load /boot/userboot.so to boot the VMs it runs. This means that
the change to lua meant suddently that nobody could run their older
VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or
whatever. Even more than for the /boot/loader* binaries, we need a
good coexistance strategy for this. While that's being designed and
implemented, drop back to always 4th for userboot.so. This will fail
safe in all but the most extreme environments (but lua-only hacks
to .lua files won't be processes in VMs until we fix it).

r338407:
lualoader: Print error messages from command failures at the prompt

Previously lualoader would remain silent, rather than printing
command_errmsg or noting that a command had failed or was not found.

r338418:
userboot: handle guest interpreter mismatches more intelligently

The switch to lualoader creates a problem with userboot: the host is
inclined to build userboot with Lua, but the host userboot's interpreter
must match what's available on the guest. For almost all FreeBSD guests in
the wild, Lua is not yet available and a Lua-based userboot will fail.

This revision updates userboot protocol to version 5, which adds a
swap_interpreter callback to request a different interpreter, and tries to
determine the proper interpreter to be used based on how the guest
/boot/loader is compiled. This is still a bit of a guess, but it's likely
the best possible guess we can make in order to get it right. The
interpreter is now embedded in the resulting executable, so we can open
/boot/loader on the guest and hunt that down to derive the interpreter it
was built with.

Using -l with bhyveload will not allow an intepreter swap, even if the
loader specified happens to be a userboot with the wrong interpreter. We'll
simply complain about the mismatch and bail out.

For legacy guests without the interpreter marker, we assume they're 4th.
For new guests with the interpreter marker, we'll read it and swap over
to the proper interpreter if it doesn't match what the userboot we're using
was compiled with.

Both flavors of userboot are installed by default, userboot_4th.so and
userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which
was broken by userboot being forced to 4th.

r338474:
Be a little conservative about when to force size optimizations.

Reports have come in that there's issue with powerpc and sparc64 since
we've switched to using -Oz / -Os. We don't strictly need them for
!x86, so be conservative about when we enable them.

344399 21-Feb-2019 kevans

MFC GELI Loader Improvements: r336252, r336254, r336256, r336354,
r336532-r336534, r336537, r336626, r337326, r337349, r341071, r341160,
r341420, r341473, r341651, r342793

Note that this MFC contains some seemingly unrelated zfsloader bits -- this
was needed in order to pull in some later fixes for GELI hand-off w/ ZFS
bits included.

r336252:
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.

r336254:
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.

r336256:
Fix glitched indentation (and rewrap as needed due to deeper indent).
No functional changes.

r336354:
zfsboot: fix build with WITHOUT_LOADER_GELI

r336532:
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).

r336533:
Eliminate zfsloader man page.

Remove all cross references to zfsloader.8 and /boot/zfsloader.
Move ZFS specific info into loader.8.

r336534:
NM and OBJCOPY are already defined for all builds. There's no need to
conditionally define them here.

r336537:
Mention zfsloader being folded into loader in UPDATING.

r336626:
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.

r337326:
loader: biosdisk.c has leftover geli header.

A small cleanup, remove unneeded #include.

r337349:
zfsboot: Fix startup crash

On a FreeNAS mini XL, with geli encrypted drives the loader crashed in
geli_read().

When we iterate over the list of disks and allocate the zfsdsk structures we
don’t zero out the gdev pointer. In one case that resulted in geli_read()
(called on the bogus pointer) dividing by zero.

Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is
initialised to NULL. As a side benefit it gets rid of one #ifdef
LOADER_GELI_SUPPORT.

r341071:
Restore the ability to override the disk unit/partition at the boot: prompt
in gptboot.

When arch-independent geli support was added, a new static 'gdsk' struct
was added, but there was still a static 'dsk' struct, and when you typed
in an alternate disk/partition, the string was parsed into that struct,
which was then never used for anything. Now the string gets parsed into
gdsk.dsk, the struct that's actually used.

r341160:
Add comments describing the bootargs handoff between loader(8) and gptboot
or zfsboot, when loader(8) is the BTX loader. No functional changes.

r341420:
Eliminate duplicated code and struct member definitions in the handoff
of args data between gptboot/zfsboot and loader(8).

Despite what seems like a lot of changes here, there are no actual
changes in behavior, or in the data layout in the structures involved.
This is just eliminating identical code pasted into multiple locations.

In detail, the changes are...

- Move struct zfs_boot_args definition from libsa/zfs/libzfs.h to
i386/common/bootargs.h because it is specific to x86 booting and the
handoff between zfsboot and loader, and has no relation to the zfs
library code in general.

- The geli_boot_args and zfs_boot_args structs both contain an identical
set of member variables containing geli information. Extract this out
to a new geli_boot_data struct, and embed it in the arg-passing structs.

- Provide new routines geli_import_boot_data() and geli_export_boot_data()
that can be shared between gptboot, zfsboot, and loader instead of
pasting identical code into several different .c files.

- Remove some checks for a NULL pointer that can never be true because the
pointer being tested was set using pointer math (kargs + 1) and that can
never result in NULL in this code.

r341473:
Fix args cross-threading between gptboot(8) and loader(8) with zfs support.

When loader(8) is built with zfs support enabled, it assumes that any extarg
data present is a zfs_boot_args struct, but if the first-stage loader was
gptboot(8) the extarg data is actually a geli_boot_args struct. Luckily,
zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with
KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the
extarg data is a zfs_boot_args struct.

To avoid similar problems in the future, gptboot(8) now passes a new
KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args. In
loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but
extarg data is present (which will be the case for gptboot compiled before
this change), we now check for the known size of the geli_boot_args struct
passed by the older versions of gptboot as a way of confirming what type of
extarg data is present.

In a semi-related tidying up, since loader's main() has already decided
what type of extarg data is present and set the global 'zargs' var
accordingly, don't repeat the check in extract_currdev, just check whether
zargs is NULL or not.

r341651:
Don't reference zfs-specific variables if LOADER_ZFS_SUPPORT is undefined
because the variables will be undefined too.

r342793:
MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel
ZFS but keep the boot-loaders when using ZoL port.

Relnotes: yes (GELI support extended)
Relnotes: yes (zfsloader has been collapsed into loader and may be
removed after boot blocks have been updated)


/freebsd-11-stable/.gitattributes
/freebsd-11-stable/UPDATING
/freebsd-11-stable/share/mk/src.opts.mk
devopen.c
metadata.c
paths.h
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/bootinfo.c
/freebsd-11-stable/stand/i386/Makefile
/freebsd-11-stable/stand/i386/boot2/Makefile
/freebsd-11-stable/stand/i386/common/bootargs.h
/freebsd-11-stable/stand/i386/gptboot/Makefile
/freebsd-11-stable/stand/i386/gptboot/gptboot.c
/freebsd-11-stable/stand/i386/gptzfsboot/Makefile
/freebsd-11-stable/stand/i386/gptzfsboot/gptzfsboot.8
/freebsd-11-stable/stand/i386/isoboot/Makefile
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biosdisk.c
/freebsd-11-stable/stand/i386/libi386/bootinfo32.c
/freebsd-11-stable/stand/i386/libi386/bootinfo64.c
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/loader/main.c
/freebsd-11-stable/stand/i386/zfsboot/Makefile
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.8
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.c
/freebsd-11-stable/stand/i386/zfsloader/Makefile
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/geli/Makefile.inc
/freebsd-11-stable/stand/libsa/geli/geli_metadata.c
/freebsd-11-stable/stand/libsa/geli/geliboot.c
/freebsd-11-stable/stand/libsa/geli/geliboot.h
/freebsd-11-stable/stand/libsa/geli/geliboot_crypto.c
/freebsd-11-stable/stand/libsa/geli/geliboot_internal.h
/freebsd-11-stable/stand/libsa/geli/gelidev.c
/freebsd-11-stable/stand/libsa/zfs/libzfs.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/lua/core.lua.8
/freebsd-11-stable/stand/man/Makefile
/freebsd-11-stable/stand/man/loader.8
/freebsd-11-stable/stand/man/zfsloader.8
/freebsd-11-stable/stand/sparc64/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/sparc64/zfsloader/Makefile
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/userboot/userboot/bootinfo32.c
/freebsd-11-stable/tools/build/options/WITHOUT_LOADER_ZFS
/freebsd-11-stable/tools/build/options/WITHOUT_ZFS
344378 20-Feb-2019 kevans

MFC r336244, r336246-r336247: Standardize boot arg parsing

r336244:
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.

r336246:
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.

r336247:
Transition to boot_env_to_howto and boot_howto_to_env in the boot
loader.

344377 20-Feb-2019 kevans

MFC r336084-r336085, r336118: Move zfs impl into libsa

r336084:
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@

r336085:
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.

r336118:
Remove dirs that git svn should have removed but didn't.

344295 19-Feb-2019 kevans

MFC r335245-r335248, r335254, r335276, r335298, r335398, r335868, r335883

r335245:
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

r335246:
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.

r335247:
biosdisk.c: add missing \n to error message

r335248:
biosdisk.c: fix type in debug printf

r335254:
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.

r335276:
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.

r335298:
stand/common/disk.c: Update debug printf

This was missed in r330809 because it is compiled out by default

r335398:
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.

r335868:
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.

r335883:
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.

344290 19-Feb-2019 kevans

MFC r335117: stand bootprog_info consolidation

bootprog_info is generated in vers.c. Move it's definition to
bootstrap.h and remove all the redundant copies.

344286 19-Feb-2019 kevans

MFC r332557-r332558, r332560, r332565: loader command cleanup-lite

r332557:
loader: make sure we use snprintf() in commands.c

Safeguard against memory corruptions.

r332558:
loader: command_errmsg should be const

Use const char * for command_errmsg.

r332560:
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().

r332565:
loader: cstyle cleanup of command.c

just clean it up. no functional changes intended.

344285 19-Feb-2019 kevans

MFC r332555: 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().

344283 19-Feb-2019 kevans

MFC r330757: stand/interp_lua: correct errorr => error

344220 17-Feb-2019 kevans

MFC lualoader: r326353, r328440, r328443, r329166-r329167, r329274, r329329,
r329349-r329352, r329355-r329359, r329366-r329369, r329386-r329387, r329393,
r329413-r329415, r329417, r329424-r329436, r329457, r329473-r329474,
r329496-r329501, r329503-r329504, r329543, r329547-r329551, r329576-r329578,
r329580, r329583, r329585-r329590, r329592-r329596, r329609-r329611,
r329614, r329619, r329621-r329622, r329624, r329626-r329627,
r329629-r329632, r329640-r329641, r329643-r329646, r329649-r329650, r329654,
r329656, r329662, r329669-r329671, r329673-r329674, r329680,
r329684-r329689, r329692-r329693, r329696-r329700, r329709, r329716,
r329731, r329733-r329734, r329747-r329748, r329756, r329779, r329782,
r329784, r329786, r329804, r329806, r329809, r329811, r329836,
r329850-r329852, r329854, r329856-r329858, r329861, r329895,
r329897-r329899, r329901-r329903, r329922-r329924, r329927-r329928,
r329944-r329949, r329986-r329987, r330008-r330010, r330012, r330020,
r330082-r330084, r330087-r330088, r330098-r330101, r330138-r330139,
r330261-r330263, r330267-r330269, r330281-r330284, r330287, r330339-r330342,
r330345-r330346, r330369-r330370, r330434-r330435, r330564, r330616-r330618,
r330620, r330625, r330690, r330701, r330703, r330825, r331211, r331257,
r331259, r331281-r331282, r331304, r331314, r331476-r331477,
r331563-r331564, r331854-r331857, r331859-r331860, r332106, r334723,
r334879, r334891, r334907, r334912, r334939, r334986, r335009, r335371,
r336759, r337711, r337807-r337810, r338054, r338063, r338065-r338067,
r338083, r338085-r338086, r338108, r338167-r338168, r338173, r338203,
r338255, r338259, r338309, r338394, r338438, r338886, r338893, r339173,
r339200, r339218, r339222, r339301, r339307, r339677-r339678, r339702,
r339805, r339831, r339849, r340040, r340152

Some notes for this MFC:
- This is still pre-forth/lua coexistance; that will come shortly-ish so
that forth/lua may be installed together (with forth remaining the default)

- module_blacklist support for lualoader has been MFC'd, but the drm modules
are not blacklisted in this stable branch.

r326353: Import lua 5.3.4 to contrib
r328440: Preserve the original luaconf.h in a convenient place. Clients will
r328443: Gross hack to omit printing hex floating point when the lua number
r329166: Add Lua as a scripting langauge to /boot/loader
r329167: Add the lua scripts from the lua-bootloader SoC
r329274: stand/lua: Exit sub-menus on backspace
r329329: stand/lua: Always boot on 'enter' keypress in menus
r329349: stand/lua: Reduce magic numbers
r329350: stand/lua: Don't descend into an empty kernels submenu
r329351: stand/lua: Set reasonable ACPI default based on presence
r329352: stand/lua: Consistently use semicolons for line endings
r329355: stand/lua: Move kernel selection into main menu
r329356: stand/lua: Allow menu items to not have explicit aliases
r329357: stand/lua: Remove explicit alias from "Back to main menu"
r329358: stand/lua: Say "loader prompt" instead of "lua interpreter"
r329359: stand/lua: Remove a magic number/string (not a trivial literal)
r329366: stand/lua: Set ACPI's default the proper way (setACPI)
r329367: stand/lua: Create a "carousel" menu entry type
r329368: stand/lua: Create/use some MENU_ constants where applicable
r329369: stand/lua: Remove sneaky kernel assignment
r329386: stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys
r329387: stand/lua: Chop off the decimal for numbers passed to setcursor
r329393: stand/lua: Use escaped dot instead of single character class
r329413: stand/lua: Allow MENU_RETURN items to have func, fix esc. to prompt
r329414: stand/lua: Don't try to divide by 0; do nothing
r329415: stand/lua: Don't reload kernel config if we only have one kernel
r329417: stand/lua: Make CAROUSEL_ENTRY func parameters consistent with name
r329424: stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence
r329425: stand/lua: Enable menu autoboot; it seems to work
r329426: stand/lua: Correct interpretation of autoboot_delay
r329427: stand/lua: Color non-default kernels blue
r329428: stand/lua: Correct some trivial errors in config
r329429: stand/lua: Add debug method to dump modules
r329430: stand/lua: Address some nits
r329431: stand/lua: Correct test sense, this should have been 'not nil'
r329432: stand/lua: Try to load alternate kernels as directories first
r329433: stand/lua: Add optional GELI passphrase prompt
r329434: stand/lua: Check for nil (GELI prompt)
r329435: stand/lua: Style pass
r329436: stand/lua: Debugging string snuck in...
r329457: stand/lua: dumpModules => lsModules
r329473: liblua: Clean up io/loader C module registration
r329474: liblua: Emulate DIR, opendir, fdopendir, closedir
r329496: stand/lua: Fix verbiage and some typos
r329497: stand/lua: Fix module_path handling with multiple kernels
r329498: stand/lua: Remove some debugging bits that snuck in... gr...
r329499: interp_lua: Register io/loader with regular Lua module system
r329500: Lua loader: Add barebones "lfs" module
r329501: lua loader: Auto detect eligible list of kernels to boot
r329503: liblua: Fix missing '}' in lutil.c after r329499
r329504: stand/lua: More style nits, config.lua
r329543: Create style.lua(9)
r329547: stand/lua: Allow menu items to be conditionally (in)visible
r329548: stand/lua: Addres style.lua(9) concern
r329549: stand/lua: Clear the screen before prompting for passwords
r329550: stand/lua: Store the loaded kernel as config.kernel_loaded
r329551: stand/lua: reload previously loaded kernel at config-load/reload
r329576: stand/lua: Defer kernel/module loading until boot or menu escape
r329577: stand/lua: Rename bootserial for clarity
r329578: stand/lua: Menu style.lua(9) nits
r329580: stand/lua: Remove some unused local declarations
r329583: stand/lua: Store menu entries in an "entries" table
r329585: stand/lua: Add core.isSingleUserBoot
r329586: stand/lua: Call menu_entries if it's a function
r329587: stand/lua: Swap single-/multi- user boot entries as needed
r329588: stand/lua: Re-wrap menu.lua now that I've added indentation...
r329589: stand/lua: Track env changes that come in via loader.conf(5)
r329590: stand/lua: Restore environment upon config reload
r329592: stand/lua: Remove inaccurate comment after r329590
r329593: stand/lua: Change boot menu items' names when swapped
r329594: stand/lua: Round up some more style.lua(9) concerns
r329595: stand/lua: Re-order locals after copyright notice; require first
r329596: stand/lua: Add copyright notice in places
r329609: stand/lua: Cache swapped menu, and don't create locals for swapping
r329610: style.lua(9): Note that wrapping at 80-columns is not rigid
r329611: stand/lua: Wrap tuple assignment earlier for readability
r329614: stand/lua: Don't set ACPI off just because we can't detect it.
r329619: stand/lua: Extract menu handlers out into menu.handlers table
r329621: stand/lua: Add and use drawer.menu_name_handlers
r329622: stand/lua: Move drawer.menu_name_handlers further up
r329624: stand/lua: Reduce exposure of the drawer module
r329626: stand/lua: Refactor logos into drawer.logodefs table
r329627: stand/lua: Refactor brands into drawer.branddefs
r329629: stand/lua: Use 'graphic' instead of 'logo' for depicting graphics
r329630: stand/lua: Stick a copyright notice on drawer.lua
r329631: stand/lua: Insert helpful comment for drawer.branddefs
r329632: style.lua(9): Clarify local variable guideline
r329640: stand/lua: Consistently declare local functions at module scope
r329641: stand/lua: Consistently organize modules
r329643: Implement loader.command
r329644: lualoader: Add ability to intercept cli commands
r329645: lualoader: Move carousel storage out into config
r329646: lualoader: Eliminate global namespace pollution in loader.lua
r329649: Lua lfs.attributes: Provide a more consistent error return
r329650: liblua: Add loader.machine and loader.machine_arch properties
r329654: lualoader: Ignore ACPI bits on !i386
r329656: loader.lua: Expose errno table to lua
r329662: lualoader: Replace invalid construct with valid construct
r329669: lualoader: Prefer selected kernel to currently loaded
r329670: lualoader: Don't try so hard to load a kernel
r329671: lualoader: Prepare for interception of "boot" CLI cmd
r329673: lualoader: Intercept boot cli command
r329674: lualoader: Intercept the 'autoboot' cli command
r329680: lualoader: When restoring environment, only restore unchanged vars
r329684: lualoader: Drop terminating semicolons
r329685: lualoader: Drop excessive parenthesizing
r329686: style.lua(9): Drop notes about semicolons
r329687: lualoader: Drop explicit boolean tests; b or not b
r329688: lualoader: Don't return false for failure to open config on silent
r329689: lualoader: Output "Failed to parse" messages
r329692: lualoader: Bring in local.lua module if it exists
r329693: lualoader: Return only argstr if with_kernel not requested
r329696: lualoader: Add "menu.default", initialized to menu.welcome
r329697: lualoader: Drop name requirement for menu separators
r329698: lualoader: Directly reference submenu definition with submenu key
r329699: lualoader: Simplify menu definitions a little further
r329700: lualoader: Allow carousel 'items' to be a table as well
r329709: lualoader: Don't autodetect kernels if 'kernels' is explicitly set
r329716: lualoader: Use the key that interrupts autoboot as a menu choice
r329731: lualoader: Add boot environment support
r329733: lualoader: Make kernel autodetect. contingent on loader.conf(5) var
r329734: lualoader: Don't execute menu.autoboot() for every opened menu
r329747: lualoader: Replace 8-space indentation with a single tab
r329748: lualoader: Drop password length restrictions
r329756: lualoader: Remove nasty hack for not printing out ".0"
r329779: lualoader: Split cli bits out into a cli module
r329782: lualoader: Unbreak 'boot [kernel]' by including config
r329784: lualoader: Pull argument extraction for cli funcs to cli.arguments
r329786: lualoader: Attach cli command functions to cli module
r329804: lualoader: Eliminate some unused locals
r329806: lualoader: Consistently use double quotes
r329809: lualoader: Address some 'luacheck' concerns
r329811: lualoader: Clear up an empty conditional branch
r329836: lualoader: Attend to some 80-col issues, pointed out by luacheck
r329850: lualoader: Drop unused return values; we'll only use the first
r329851: Add SPDX tags to lua files
r329852: Add copyright notice to core.lua
r329854: lualoader: shallowCopyTable => deepCopyTable
r329856: lualoader: Use "local function x()" instead "local x = function()"
r329857: Centralize lua defines
r329858: When the LUA_FLOAT_TYPE != LUA_FLOAT_INT64, we can't ref. float
r329861: lualoader: Track effective line number, use it for drawing
r329895: liblua: Implement write support
r329897: lualoader: Add nextboot support
r329898: lualoader: Plug file handle not properly closed
r329899: lualoader: Correct test and name
r329901: lualoader: Add comment on trailing space, don't operate on nil
r329902: lualoader: Remove unused variable; we now use effective line number
r329903: lualoader: Explain nextboot stuff a little bit more
r329922: lualoader: Split config file I/O out into a separate function
r329923: lualoader: Strip config.parse of its I/O privileges
r329924: lualoader: throw out nextboot's usage of standard config processing
r329927: lualoader: Clean up naming conventions a little bit
r329928: lualoader: Remove inaccurate part of comment
r329944: lualoader: Don't explicitly index tables without reason
r329945: lualoader: menu: Terminate final values in tables with a comma
r329946: lualoader: Clean up menu handling a little bit
r329947: lualoader: Pull menu redrawing specifics out of menu.process
r329948: lualoader: Pull autoboot handling out into menu.run()
r329949: lualoader: Explain deviation from naming guidelines
r329986: lualoader: Invalidate the screen from menu perspective mnu exit
r329987: lualoader: Track the menu currently drawn, instead of validity
r330008: lualoader: A little more general menu cleanup
r330009: lualoader: More argument name expansion, part 2
r330010: lualoader: screen argument fixes
r330012: style.lua(9): Add some additional notes about naming and commas
r330020: lualoader: Re-work menu skipping bits
r330082: lualoader: Add a twiddle at password prompt
r330083: lualoader: Remove remnants of testing...
r330084: lualoader: Replace instances of \027 with KEYSTR_ESCAPE
r330087: lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSI
r330088: lualoader: Correct test sense, comments, and add some more comments
r330098: lualoader: Re-do twiddle
r330099: lualoader: Further screen cleanup
r330100: lualoader: Remove debug function
r330101: lualoader: Add note that \027 is a decimal representation
r330138: lualoader: Dedup these "Return to main menu" entries
r330139: lualoader: config: Pull some messages out into constants
r330261: lualoader: Fix some lint-mentioned errors
r330262: lualoader: Use #str instead of tracking length with 'n'
r330263: lualoader: Use string literal \xNN instead of string.char()
r330267: Add core.lua(8), but do not add to distribution
r330268: Add menu.lua(8), but do not add to distribution
r330269: core.lua(8): Add missing note about core.KEYSTR_CSI
r330281: lualoader: Steamroll the box-drawing
r330282: lualoader: Register loader.printc as global printc
r330283: lualoader: Use global printc instead of loader.printc
r330284: liblua: Use putc instead of printf for printc
r330287: lualoader: Reset the cursor position after the menu is drawn
r330339: liblua: Add loader.interpret
r330340: lualoader: Execute menu_timeout_command at the end of menu autoboot
r330341: lualoader: Respect loader_menu_title, prepare for align
r330342: lualoader: Respect loader_menu_title_align
r330345: lualoader: Tweak positioning and fix an off-by-one
r330346: lualoader: Shift menu+brand even for logo=none with customized pos
r330369: lualoader: Return meaningful value in cli_execute
r330370: lualoader: logdef -> logodef typo
r330434: lualoader: Add note about importance of including cli module early
r330435: lualoader: Use FILESDIR instead of BINDIR
r330564: lualoader: Only loadelf before boot/autoboot if no kernel loaded
r330616: lualoader: Expose loader.parse and add cli_execute_unparsed
r330617: lualoader: Fix name, cli.execute_unparsed -> cli_execute_unparsed
r330618: lualoader: Use cli_execute_unparsed instead of loader.interpret
r330620: lualoader: Use cli_execute_unparsed for commands via loader.conf
r330625: lualoader: Return status in cli_execute_unparsed properly
r330690: stand: Fix copy-paste-o, unbreaks libi386 lualoader build
r330701: lualoader: Don't redraw the autoboot message every .05s
r330703: lualoader: Cache kernel list
r330825: lualoader: Sprinkle some verbose_loading salt
r331211: lualoader: Setup default color scheme if we're using colors
r331257: lualoader: Reset attributes and color scheme with color.highlight()
r331259: lualoader: Use less atomic options for resetting colors/attributes
r331281: lualoader: Add primitive hook module to untangle bogus reference
r331282: core.lua(8): Update to reflect recently added function
r331304: lualoader: Clear up some possible naming confusion
r331314: lualoader: Use printc when we expect ANSI escape sequences
r331476: lualoader: Make config env-related bits private API
r331477: lualoader: Privatize some more config.lua bits
r331563: lualoader: Implement try_include and use it for including local
r331564: lualoader: Actually re-raise error in try_include
r331854: lualoader: Do case-insensitive comparison of "yes"
r331855: lualoader: Don't assume that {module}_load is set
r331856: lualoader: revert whitespace change that snuck in
r331857: lualoader: Simplify some expressions
r331859: lualoader: Split logodefs out into logo-* files
r331860: lualoader: Don't try to lookup a nil logo
r332106: lualoader: Fix menu skipping with loader.conf(5) vars
r334723: lualoader: Add a loaded hook for others to execute upon config load
r334879: lualoader: Add hook.lua(8) to tree
r334891: lualoader: Add cli.lua(8) to the tree
r334907: lualoader: Process loader_conf_files properly
r334912: lualoader: Support variable substitution in env var settings
r334939: lualoader: Allow brand-*.lua for adding new brands
r334986: lualoader: More black-on-white fixes
r335009: lualoader: Match Forth module-loading behavior w.r.t flags
r335371: lualoader: Correct kernel_options handling
r336759: lualoader: "nextboot_file" should be spelled "nextboot_conf"
r337711: lualoader: Fix parsing of negative number loader.conf(5) variables
r337807: Prevent a wanring about checkdp being unused.
r337808: When the LUA floating point model is INT64, we don't need to do the
r337809: For our INT64 implementation, we can compare integers and numbers
r337810: MFV r337586: lua: Update to 5.3.5
r338054: Add config.lua(8) to the tree
r338063: lualoader: Stop exporting drawer.draw
r338065: lualoader: Hide most of the internal drawing functions
r338066: lualoader: Hide the rest of the private interfaces
r338067: lualoader: Add drawer-exported variables for default logodefs
r338083: Add drawer.lua(8)
r338085: Add color.lua(8), password.lua(8), and screen.lua(8)
r338086: lualoader: Install all manpages
r338108: Serial console menus for lua.
r338167: lualoader: Just compare expression directly
r338168: lualoader: Refactor config line expressions
r338173: lualoader: Fix loader.conf(5) EOL validation for 'exec' lines
r338203: Turn off LOADER_GELI and LOADER_LUA for sparc64, until functional
r338255: lualoader: Fix (add) Xen support
r338259: lualoader: Accept that people use unquoted values in loader.conf
r338309: lualoader: Fix override of module_path on loader prompt
r338394: lualoader: fix color usage
r338438: lualoader: Handle comma-separated kernels as well
r338886: Improve loader passwords:
r338893: Set the default loader for powerpc(32- and 64-bit) back to to forth
r339173: Set the default loader for powerpc64 back to to forth too.
r339200: lualoader: Don't draw loader menu with autoboot_delay=-1
r339218: lualoader: Create a module blacklist, add DRM modules to it
r339222: lualoader: Honor boot_* variables at lua init
r339301: Loader GELI support, like lua loader, seems to be broken on PowerPC
r339307: lualoader: Provide a 'menu' command to redraw the menu at prompt
r339677: lualoader: unload upon kernel change if a kernel was loaded
r339678: menu.lua: Abort autoboot sequence on failed command
r339702: lualoader: Improve module loading diagnostics
r339805: lualoader: Always return a proper dictionary for blacklist
r339831: Move LUA_ROOT to /boot/lua
r339849: lualoader: Fix try_include error handling
r340040: lualoader: Implement boot-conf
r340152: lualoader: Add chainload menu entry

Relnotes: yes ("lualoader has been merged to stable/11, off by
default, to facilitate testing")


/freebsd-11-stable/UPDATING
/freebsd-11-stable/contrib/lua
/freebsd-11-stable/contrib/lua/README
/freebsd-11-stable/contrib/lua/doc/contents.html
/freebsd-11-stable/contrib/lua/doc/lua.css
/freebsd-11-stable/contrib/lua/doc/manual.html
/freebsd-11-stable/contrib/lua/doc/readme.html
/freebsd-11-stable/contrib/lua/src/Makefile
/freebsd-11-stable/contrib/lua/src/lapi.c
/freebsd-11-stable/contrib/lua/src/lapi.h
/freebsd-11-stable/contrib/lua/src/lauxlib.c
/freebsd-11-stable/contrib/lua/src/lauxlib.h
/freebsd-11-stable/contrib/lua/src/lbaselib.c
/freebsd-11-stable/contrib/lua/src/lbitlib.c
/freebsd-11-stable/contrib/lua/src/lcode.c
/freebsd-11-stable/contrib/lua/src/lcode.h
/freebsd-11-stable/contrib/lua/src/lcorolib.c
/freebsd-11-stable/contrib/lua/src/lctype.c
/freebsd-11-stable/contrib/lua/src/lctype.h
/freebsd-11-stable/contrib/lua/src/ldblib.c
/freebsd-11-stable/contrib/lua/src/ldebug.c
/freebsd-11-stable/contrib/lua/src/ldebug.h
/freebsd-11-stable/contrib/lua/src/ldo.c
/freebsd-11-stable/contrib/lua/src/ldo.h
/freebsd-11-stable/contrib/lua/src/ldump.c
/freebsd-11-stable/contrib/lua/src/lfunc.c
/freebsd-11-stable/contrib/lua/src/lfunc.h
/freebsd-11-stable/contrib/lua/src/lgc.c
/freebsd-11-stable/contrib/lua/src/lgc.h
/freebsd-11-stable/contrib/lua/src/linit.c
/freebsd-11-stable/contrib/lua/src/liolib.c
/freebsd-11-stable/contrib/lua/src/llex.c
/freebsd-11-stable/contrib/lua/src/llex.h
/freebsd-11-stable/contrib/lua/src/llimits.h
/freebsd-11-stable/contrib/lua/src/lmathlib.c
/freebsd-11-stable/contrib/lua/src/lmem.c
/freebsd-11-stable/contrib/lua/src/lmem.h
/freebsd-11-stable/contrib/lua/src/loadlib.c
/freebsd-11-stable/contrib/lua/src/lobject.c
/freebsd-11-stable/contrib/lua/src/lobject.h
/freebsd-11-stable/contrib/lua/src/lopcodes.c
/freebsd-11-stable/contrib/lua/src/lopcodes.h
/freebsd-11-stable/contrib/lua/src/loslib.c
/freebsd-11-stable/contrib/lua/src/lparser.c
/freebsd-11-stable/contrib/lua/src/lparser.h
/freebsd-11-stable/contrib/lua/src/lprefix.h
/freebsd-11-stable/contrib/lua/src/lstate.c
/freebsd-11-stable/contrib/lua/src/lstate.h
/freebsd-11-stable/contrib/lua/src/lstring.c
/freebsd-11-stable/contrib/lua/src/lstring.h
/freebsd-11-stable/contrib/lua/src/lstrlib.c
/freebsd-11-stable/contrib/lua/src/ltable.c
/freebsd-11-stable/contrib/lua/src/ltable.h
/freebsd-11-stable/contrib/lua/src/ltablib.c
/freebsd-11-stable/contrib/lua/src/ltm.c
/freebsd-11-stable/contrib/lua/src/ltm.h
/freebsd-11-stable/contrib/lua/src/lua.c
/freebsd-11-stable/contrib/lua/src/lua.h
/freebsd-11-stable/contrib/lua/src/luac.c
/freebsd-11-stable/contrib/lua/src/luaconf.h
/freebsd-11-stable/contrib/lua/src/luaconf.h.dist
/freebsd-11-stable/contrib/lua/src/lualib.h
/freebsd-11-stable/contrib/lua/src/lundump.c
/freebsd-11-stable/contrib/lua/src/lundump.h
/freebsd-11-stable/contrib/lua/src/lutf8lib.c
/freebsd-11-stable/contrib/lua/src/lvm.c
/freebsd-11-stable/contrib/lua/src/lvm.h
/freebsd-11-stable/contrib/lua/src/lzio.c
/freebsd-11-stable/contrib/lua/src/lzio.h
/freebsd-11-stable/share/man/man9/Makefile
/freebsd-11-stable/share/man/man9/style.lua.9
/freebsd-11-stable/share/mk/src.opts.mk
/freebsd-11-stable/stand/Makefile
interp_lua.c
/freebsd-11-stable/stand/defaults/loader.conf
/freebsd-11-stable/stand/defaults/loader.conf.5
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/liblua
/freebsd-11-stable/stand/liblua/Makefile
/freebsd-11-stable/stand/liblua/lerrno.c
/freebsd-11-stable/stand/liblua/lerrno.h
/freebsd-11-stable/stand/liblua/lfs.c
/freebsd-11-stable/stand/liblua/lfs.h
/freebsd-11-stable/stand/liblua/lstd.c
/freebsd-11-stable/stand/liblua/lstd.h
/freebsd-11-stable/stand/liblua/luaconf.h
/freebsd-11-stable/stand/liblua/lutils.c
/freebsd-11-stable/stand/liblua/lutils.h
/freebsd-11-stable/stand/liblua32
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/lua
/freebsd-11-stable/stand/lua.mk
/freebsd-11-stable/stand/lua/Makefile
/freebsd-11-stable/stand/lua/cli.lua
/freebsd-11-stable/stand/lua/cli.lua.8
/freebsd-11-stable/stand/lua/color.lua
/freebsd-11-stable/stand/lua/color.lua.8
/freebsd-11-stable/stand/lua/config.lua
/freebsd-11-stable/stand/lua/config.lua.8
/freebsd-11-stable/stand/lua/core.lua
/freebsd-11-stable/stand/lua/core.lua.8
/freebsd-11-stable/stand/lua/drawer.lua
/freebsd-11-stable/stand/lua/drawer.lua.8
/freebsd-11-stable/stand/lua/hook.lua
/freebsd-11-stable/stand/lua/hook.lua.8
/freebsd-11-stable/stand/lua/loader.lua
/freebsd-11-stable/stand/lua/logo-beastie.lua
/freebsd-11-stable/stand/lua/logo-beastiebw.lua
/freebsd-11-stable/stand/lua/logo-fbsdbw.lua
/freebsd-11-stable/stand/lua/logo-orb.lua
/freebsd-11-stable/stand/lua/logo-orbbw.lua
/freebsd-11-stable/stand/lua/menu.lua
/freebsd-11-stable/stand/lua/menu.lua.8
/freebsd-11-stable/stand/lua/password.lua
/freebsd-11-stable/stand/lua/password.lua.8
/freebsd-11-stable/stand/lua/screen.lua
/freebsd-11-stable/stand/lua/screen.lua.8
/freebsd-11-stable/sys/sys/param.h
/freebsd-11-stable/tools/build/options/WITH_LOADER_LUA
339406 17-Oct-2018 imp

Direct commit since these files have gone away in head

Move pc98's biosdisk.c to the new style disk access. This is missing
support in common/part.c, however, for pc98 partitions, so it's
unlikely to actually work. Lack of a pc98 machine that's in sevice
limits my ability to test, but this allows pc98 to compile again.

335755 28-Jun-2018 kevans

MFC r334882, r334884-r334885: loader(8) boot flag <-> environment fixes

r334882:
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

r334884:
stand: Fix build after r334882

Not sure how this was not caught in Universe.

r334885:
stand: One more trivial consolidation (setting environment from howto)

334935 10-Jun-2018 ian

MFC r334656, r334665, r334695

r334656:
Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h.

r334665:
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.

r334695:
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@

334572 03-Jun-2018 dim

MFC r334432:

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
Differential Revision: https://reviews.freebsd.org/D15628

334191 24-May-2018 marius

MFC: r333955

- Unbreak booting sparc64 kernels after the metadata unification in
r329190 (MFCed to stable/11 in r332150); 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.

Approved by: re (kib)

332956 24-Apr-2018 benno

MFC r332085

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.

Sponsored by: iXsystems, Inc.

332420 11-Apr-2018 jhb

MFC 328101,328911: Require SHF_ALLOC for kernel object module sections.

328101:
Require the SHF_ALLOC flag for program sections from kernel object modules.

ELF object files can contain program sections which are not supposed
to be loaded into memory (e.g. .comment). Normally the static linker
uses these flags to decide which sections are allocated to loadable
program segments in ELF binaries and shared objects (including kernels
on all architectures and kernel modules on architectures other than
amd64).

Mapping ELF object files (such as amd64 kernel modules) into memory
directly is a bit of a grey area. ELF object files are intended to be
used as inputs to the static linker. As a result, there is not a
standardized definition for what the memory layout of an ELF object
should be (none of the section headers have valid virtual memory
addresses for example).

The kernel and loader were not checking the SHF_ALLOC flag but loading
any program sections with certain types such as SHT_PROGBITS. As a
result, the kernel and loader would load into RAM some sections that
weren't marked with SHF_ALLOC such as .comment that are not loaded
into RAM for kernel modules on other architectures (which are
implemented as ELF shared objects). Aside from possibly requiring
slightly more RAM to hold a kernel module this does not affect runtime
correctness as the kernel relocates symbols based on the layout it
uses.

Debuggers such as gdb and lldb do not extract symbol tables from a
running process or kernel. Instead, they replicate the memory layout
of ELF executables and shared objects and use that to construct their
own symbol tables. For executables and shared objects this works
fine. For ELF objects the current logic in kgdb (and probably lldb
based on a simple reading) assumes that only sections with SHF_ALLOC
are memory resident when constructing a memory layout. If the
debugger constructs a different memory layout than the kernel, then it
will compute different addresses for symbols causing symbols in the
debugger to appear to have the wrong values (though the kernel itself
is working fine). The current port of mdb does not check SHF_ALLOC as
it replicates the kernel's logic in its existing kernel support.

The bfd linker sorts the sections in ELF object files such that all of
the allocated sections (sections with SHF_ALLOCATED) are placed first
followed by unallocated sections. As a result, when kgdb composed a
memory layout using only the allocated sections, this layout happened
to match the layout used by the kernel and loader. The lld linker
does not sort the sections in ELF object files and mixed allocated and
unallocated sections. This resulted in kgdb composing a different
memory layout than the kernel and loader.

We could either patch kgdb (and possibly in the future lldb) to use
custom handling when generating memory layouts for kernel modules that
are ELF objects, or we could change the kernel and loader to check
SHF_ALLOCATED. I chose the latter as I feel we shouldn't be loading
things into RAM that the module won't use. This should mostly be a
NOP when linking with bfd but will allow the existing kgdb to work
with amd64 kernel modules linked with lld.

Note that we only require SHF_ALLOC for "program" sections for types
like SHT_PROGBITS and SHT_NOBITS. Other section types such as symbol
tables, string tables, and relocations must also be loaded and are not
marked with SHF_ALLOC.

328911:
Ignore relocation tables for non-memory-resident sections.

As a followup to r328101, ignore relocation tables for ELF object
sections that are not memory resident. For modules loaded by the
loader, ignore relocation tables whose associated section was not
loaded by the loader (sh_addr is zero). For modules loaded at runtime
via kldload(2), ignore relocation tables whose associated section is
not marked with SHF_ALLOC.

332155 06-Apr-2018 kevans

MFC r331331: Apply r228478 (CTASSERT => _Static_assert()) to bootstrap.h

332154 06-Apr-2018 kevans

MFC r330806-r330815, r330837, r330864, r330883

pc98 changes associated with the named commits are also included in this
commit, despite not having been made with the original commits due to its
removal in head.

r330806:
Minor cosmetic changes.

Make sure { on the same line as struct for all struct *devdesc. Move
some type definitions to next to the dv_type define, since that's what
sets the d_type.

r330807:
We can't use d_opendata for blkio storage.

open_disk uses d_opendata for it's own purpse. We can't store blkio
there. Fortunately, blkio is stored elsewhere and we never actually
retrieve blkio from d_opendata. Eliminate it as a source of confusion.
Eliminate all stores of d_opendata in efi since this layer doesn't own
that field.

r330808:
Make struct libi386_devdesc match the struct devdesc better

Move data to top and call it d_opendata.

r330809:
Use the actual struct devdesc at the start of all *_devdesc structs

The current system is fragile and requires very careful layout of all
*_devdesc structures. It also makes it hard to change the base
devdesc. Take a page from CAM and put the 'header' in all the derived
classes and adjust the code to match.

For OFW, move the iHandle h_handle out of a slot conflicting with
d_opendata. Due to quirks in the alignment rules, this worked.
However changing the code to use d_opendata storage now that it's a
pointer is hard, so just have a separate field for it.

All other cleanups were to make the *_devdesc structures match where
they'd taken some liberties that were none-the-less compatible enough
to work.

r330810:
Remove d_type from devdesc. It's not needed as we can fetch it from
d_dev->dv_type when we need it.

r330811:
GC unused routines.

Sponsored by: Netflix

r330812:
Use the one-line-per-file pattern here, and sort the file names.

Sponsored by: Netflix

r330813:
Move the env convenience routines out of boot1.c.

These routines are more generally useful. Even though boot1 is on its
way out, it's better to make these common during the transition than
copy them.

r330814:
Star BootCurrent entry when booting.

Sponsored by: Netflix

r330815:
Print the load and device path as well as BootCurrent and BootOrder

Sponsored by: Netflix

r330837:
biosdisk.c should not set d_opendata.

Same as 330807, d_opendata is owned by open_disk and we should not
set it.

M stand/i386/libi386/biosdisk.c

r330864:
Prefer uintXX_t to u_intXX_t

A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. -- Ralph Waldo Emerson

r330883:
Fix typo that misteriously passes compilation.


bootstrap.h
disk.c
disk.h
isapnp.c
load_elf.c
load_elf_obj.c
metadata.c
misc.c
pnp.c
/freebsd-11-stable/stand/efi/boot1/boot1.c
/freebsd-11-stable/stand/efi/boot1/ufs_module.c
/freebsd-11-stable/stand/efi/include/efilib.h
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/libefi/devicename.c
/freebsd-11-stable/stand/efi/libefi/efienv.c
/freebsd-11-stable/stand/efi/libefi/efipart.c
/freebsd-11-stable/stand/efi/libefi/efizfs.c
/freebsd-11-stable/stand/efi/libefi/env.c
/freebsd-11-stable/stand/efi/loader/arch/arm/exec.c
/freebsd-11-stable/stand/efi/loader/main.c
/freebsd-11-stable/stand/ficl/aarch64/sysdep.c
/freebsd-11-stable/stand/ficl/amd64/sysdep.c
/freebsd-11-stable/stand/ficl/arm/sysdep.c
/freebsd-11-stable/stand/ficl/i386/sysdep.c
/freebsd-11-stable/stand/ficl/mips/sysdep.c
/freebsd-11-stable/stand/ficl/mips64/sysdep.c
/freebsd-11-stable/stand/ficl/powerpc/sysdep.c
/freebsd-11-stable/stand/ficl/riscv/sysdep.c
/freebsd-11-stable/stand/ficl/sparc64/sysdep.c
/freebsd-11-stable/stand/i386/btx/lib/btxv86.h
/freebsd-11-stable/stand/i386/libi386/biosacpi.c
/freebsd-11-stable/stand/i386/libi386/bioscd.c
/freebsd-11-stable/stand/i386/libi386/biosdisk.c
/freebsd-11-stable/stand/i386/libi386/biospnp.c
/freebsd-11-stable/stand/i386/libi386/bootinfo32.c
/freebsd-11-stable/stand/i386/libi386/bootinfo64.c
/freebsd-11-stable/stand/i386/libi386/devicename.c
/freebsd-11-stable/stand/i386/libi386/elf64_freebsd.c
/freebsd-11-stable/stand/i386/libi386/libi386.h
/freebsd-11-stable/stand/i386/libi386/multiboot.c
/freebsd-11-stable/stand/i386/libi386/pxe.c
/freebsd-11-stable/stand/i386/loader/chain.c
/freebsd-11-stable/stand/i386/loader/main.c
/freebsd-11-stable/stand/libsa/arp.c
/freebsd-11-stable/stand/libsa/bootp.c
/freebsd-11-stable/stand/libsa/bootparam.c
/freebsd-11-stable/stand/libsa/dosfs.h
/freebsd-11-stable/stand/libsa/ext2fs.c
/freebsd-11-stable/stand/libsa/net.h
/freebsd-11-stable/stand/libsa/rpc.c
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/mips/beri/loader/beri_disk_cfi.c
/freebsd-11-stable/stand/mips/beri/loader/beri_disk_sdcard.c
/freebsd-11-stable/stand/mips/beri/loader/devicename.c
/freebsd-11-stable/stand/ofw/libofw/devicename.c
/freebsd-11-stable/stand/ofw/libofw/libofw.h
/freebsd-11-stable/stand/ofw/libofw/openfirm.c
/freebsd-11-stable/stand/pc98/libpc98/bioscd.c
/freebsd-11-stable/stand/pc98/libpc98/biosdisk.c
/freebsd-11-stable/stand/pc98/loader/main.c
/freebsd-11-stable/stand/powerpc/boot1.chrp/boot1.c
/freebsd-11-stable/stand/powerpc/kboot/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/main.c
/freebsd-11-stable/stand/powerpc/ofw/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/sparc64/boot1/boot1.c
/freebsd-11-stable/stand/sparc64/loader/main.c
/freebsd-11-stable/stand/uboot/common/main.c
/freebsd-11-stable/stand/uboot/lib/devicename.c
/freebsd-11-stable/stand/uboot/lib/disk.c
/freebsd-11-stable/stand/uboot/lib/elf_freebsd.c
/freebsd-11-stable/stand/uboot/lib/libuboot.h
/freebsd-11-stable/stand/userboot/userboot/bootinfo32.c
/freebsd-11-stable/stand/userboot/userboot/bootinfo64.c
/freebsd-11-stable/stand/userboot/userboot/devicename.c
/freebsd-11-stable/stand/userboot/userboot/elf64_freebsd.c
/freebsd-11-stable/stand/userboot/userboot/main.c
/freebsd-11-stable/stand/userboot/userboot/userboot_disk.c
/freebsd-11-stable/stand/zfs/libzfs.h
/freebsd-11-stable/stand/zfs/zfs.c
332150 06-Apr-2018 kevans

MFC r329190, r329315, r330131: metadata load file unification

r329190: Unify metadata load files for arm, mips, powerpc, sparc64

Summary:
All metadata.c files are very similar, with only trivial changes. Unify them
into a single common file, with minor special-casing where needed.

r329315: stand: Fix ubldr after r329190

metadata load files were consolidated in r329190, and these relocation fixup
bits were inadvertently dropped in the process. Re-add them to fix boot with
ubldr.

r330131: Fix module loading on arm after the metadata.c unification in
r329190. Arm modules need an additional address fixup not needed by other
platforms.

332132 06-Apr-2018 kevans

MFC r329745: load_elf.c: Use consistent indentation

As noted in D14267 load_elf.c has a variety of indentation styles. Move
to standard 8 column hard tab indents, 4 space second level indents.
Also includes some whitespace cleanups found by clang-format.

332128 06-Apr-2018 kevans

MFC r329725, r329831

r329725:
Consolidate three copies of ZFS commands into a central location.

There's no reason to have multiple copies of lszfs and
reloadbe. Consolidate them into one location. Also ldi_get_size is the
same everywhere (except sparc64). Make it the same everywhere as the
common definition is more general and will work on spar64.

r329831:
Fix userboot w/ ZFS after r329725

r329725 cleaned up ZFS commands duplicated in multiple places, but userboot
was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to
boot (as seen in PR 226118) in bhyve, with the following message:

/boot/userboot.so: Undefined symbol "ldi_get_size"

329191 13-Feb-2018 kevans

Revert MFC r328911 from r329183

jhb@ had specified an MFC timer of 1-month, and I clobbered his efforts by
MFC'ing it way prematurely. Back out that part of r329183 so it may be MFC'd
when jhb is ready.

329183 12-Feb-2018 kevans

MFC Loader Fixes Final: r327612,r327703,r327704,r327878,r327879,r327881,
r328007,r328029,r328030,r328031,r328061,r328156,r328169,r328288,r328289,
r328290,r328291,r328292,r328411,r328536,r328603,r328614,r328642,r328769,
r328779,r328780,r328781,r328782,r328783,r328806,r328808,r328826,r328835,
r328911,r328986,r328987,r328990,r328999,r329000,r329019,r329050,r329054,
r329060

r327612: Invent new #defines for the biospci_{read,write}_config function

r327703: Define __dmadat after #include'ing ufsread.c.

r327704: Fix printf missing format variables warnings.

r327878: Add GUID for UEFI boot manager variables.

r327879: Report the boot order and where we are in that boot order.

r327881: Allow this file to be included

r328007: Fix booting on some arm64 systems after r327879 by fixing the call
to utf8_to_ucs2

r328029: When returning an error and freeing allocated memory from
ucs2_to_utf8, NULL the return pointer.

r328030: Check the return value from utf8_to_ucs2 instead of whether or not
uv is NULL.

r328031: Need to free uv after we're done using it.

r328061: utf8_to_ucs2() should check for malloc failure

r328156: stand: Move sections around to fix stand/ build with ld.lld on
armv7

r328169: Remove extra copy of bootinfo.c. It's a bit rotted copy of the one
in efi/loader.

r328288: Fix some resource leaks.

r328289: Don't leak memory when displaying help.

r328290: On malloc failure, be sure to close the include file that triggered
it.

r328291: getenv does not return tainted data in the boot loader. Attempt to
clue Coverity into that fact.

r328292: There's no tainted data here, tag it as such to avoid false
positives.

r328411: loader.efi: add missing EFI GUIDs

r328536: loader: support for mixed-endianness ELF/loader and POWER8

r328603: Add missing non-POWERPC case to give the scr value something
non-zero.

r328614: Move libstand.3 to libsa.3. Update libsa.3 to include functions

r328642: Break out the interpreters (simple and forth) w/o ifdefs.

r328769: Centralize several variables.

r328779: Retire pnp.4th and the code needed only for 4th words used here.

r328780: These 4th words were an attempt to allow integration into the boot
loader scripts. However, that path won't be taken after all it
seems.

r328781: Remove pcibios forth support.

r328782: Now that we no longer conditionally compile some files outside of
ficl

r328783: Invent new LDR_INTERP for the loader interpreter to use.

r328806: We need more heap space to properly load newer powerpc kernels.

r328808: Implement strcoll as strcmp.

r328826: Make cross-endian loader changes apply only to powerpc

r328835: Fix regression introduced in r328806, preventing boot on many
platforms.

r328911: Ignore relocation tables for non-memory-resident sections.

r328986: Fix relative location of USB sources after recent move.

r328987: A more definitions to kernel emulation shim in order to build
stand/usb.

r328990: Move the stand/usb test loader into its own directory.

r328999: Fix indentation to FreeBSD standard for interp files

r329000: Move simple interpreter 'perform' into interp.c and call it

r329019: Move to tabs for indentation and to 8-space notches, per style(9).

r329050: Fix build of userboot.so

r329054: Set script.lang in the environment to either 'forth' or 'simple' to
reflect what scripting language was compiled into the loader.

r329060: loader: fix endianness conversion

PR: 225323


/freebsd-11-stable/ObsoleteFiles.inc
/freebsd-11-stable/stand/arm/uboot/Makefile
/freebsd-11-stable/stand/arm/uboot/ldscript.arm
boot.c
bootstrap.h
commands.c
install.c
interp.c
interp_backslash.c
interp_forth.c
interp_parse.c
interp_simple.c
load_elf.c
load_elf_obj.c
misc.c
pnp.c
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/boot1/boot1.c
/freebsd-11-stable/stand/efi/fdt/Makefile
/freebsd-11-stable/stand/efi/include/efi.h
/freebsd-11-stable/stand/efi/include/efiapi.h
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/libefi/efichar.c
/freebsd-11-stable/stand/efi/libefi/env.c
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/arch/arm/ldscript.arm
/freebsd-11-stable/stand/efi/loader/arch/i386/bootinfo.c
/freebsd-11-stable/stand/efi/loader/main.c
/freebsd-11-stable/stand/fdt/Makefile
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl/Makefile
/freebsd-11-stable/stand/forth/Makefile
/freebsd-11-stable/stand/forth/loader.4th
/freebsd-11-stable/stand/forth/pcibios.4th
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/geli/Makefile
/freebsd-11-stable/stand/i386/boot0/Makefile
/freebsd-11-stable/stand/i386/btx/btx/Makefile
/freebsd-11-stable/stand/i386/btx/btxldr/Makefile
/freebsd-11-stable/stand/i386/btx/lib/Makefile
/freebsd-11-stable/stand/i386/cdboot/Makefile
/freebsd-11-stable/stand/i386/kgzldr/Makefile
/freebsd-11-stable/stand/i386/libfirewire/Makefile
/freebsd-11-stable/stand/i386/libfirewire/firewire.c
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biospci.c
/freebsd-11-stable/stand/i386/libi386/comconsole.c
/freebsd-11-stable/stand/i386/libi386/libi386.h
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/mbr/Makefile
/freebsd-11-stable/stand/i386/pmbr/Makefile
/freebsd-11-stable/stand/kshim/bsd_kernel.h
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/environment.c
/freebsd-11-stable/stand/libsa/libsa.3
/freebsd-11-stable/stand/libsa/libstand.3
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/mips/beri/boot2/Makefile
/freebsd-11-stable/stand/mips/beri/boot2/boot2.c
/freebsd-11-stable/stand/mips/beri/loader/Makefile
/freebsd-11-stable/stand/mips/beri/loader/exec.c
/freebsd-11-stable/stand/mips/uboot/Makefile
/freebsd-11-stable/stand/ofw/common/main.c
/freebsd-11-stable/stand/ofw/libofw/Makefile
/freebsd-11-stable/stand/ofw/libofw/elf_freebsd.c
/freebsd-11-stable/stand/ofw/libofw/libofw.h
/freebsd-11-stable/stand/ofw/libofw/ofw_copy.c
/freebsd-11-stable/stand/ofw/libofw/ofw_memory.c
/freebsd-11-stable/stand/ofw/libofw/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/stand/powerpc/kboot/Makefile
/freebsd-11-stable/stand/powerpc/kboot/conf.c
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.S
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.h
/freebsd-11-stable/stand/powerpc/kboot/hostdisk.c
/freebsd-11-stable/stand/powerpc/kboot/kerneltramp.S
/freebsd-11-stable/stand/powerpc/kboot/main.c
/freebsd-11-stable/stand/powerpc/kboot/metadata.c
/freebsd-11-stable/stand/powerpc/kboot/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/Makefile
/freebsd-11-stable/stand/powerpc/ofw/ldscript.powerpc
/freebsd-11-stable/stand/powerpc/uboot/Makefile
/freebsd-11-stable/stand/sparc64/boot1/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/uboot/fdt/Makefile
/freebsd-11-stable/stand/uboot/lib/Makefile
/freebsd-11-stable/stand/usb/Makefile.test
/freebsd-11-stable/stand/usb/bsd_usbloader_test.c
/freebsd-11-stable/stand/usb/test
/freebsd-11-stable/stand/usb/usbcore.mk
/freebsd-11-stable/stand/userboot/test/Makefile
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/zfs/Makefile
/freebsd-11-stable/sys/kern/link_elf_obj.c
329175 12-Feb-2018 kevans

MFC Loader Fixes 2017q4p7: r324844,r326089,r326926,r326440,r326484,r326494,
r326588,r326708,r326784,r326914,r327390,r328446,r326090,r326143,r326144,
r326182,r326384,r326421,r326440,r326441,r326442,r326443,r326444,r326445,
r326446,r326447,r326448,r326484,r326485,r326486,r326487,r326488,r326490,
r326491,r326492,r326493,r326494,r326495,r326504,r326507,r326509,r326584,
r326585,r326586,r326587,r326588,r326589,r326590,r326591,r326592,r326593,
r326594,r326600,r326616,r326671,r326707,r326708,r326709,r326710,r326711,
r326712,r326714,r326720,r326768,r326772,r326784,r326792,r326812,r326854,
r326855,r326856,r326858,r326886,r326887,r326914,r326926,r326927,r326960,
r326961,r326962,r326963,r327351,r327453,r327390,r327523,r327524,r326489,
r327880,r328437,r328438,r328439,r328441,r328446,r328448,r328449,r328612,
r328613,r328615

While here, undo our libfdt hack of not including <stdlib.h> if we're
compiling _STANDALONE.

r324844: When building standalone, don't define errno. Let the definition from
stand.h override. This is similar to what we do in the kernel.

r326089: loader.efi: efipart does not recognize partitionless disks

r326090: net_parse_rootpath() has no parameters

r326143: Fix theoretical integer overflow issues. If the product here is

r326144: Mark the func pointer as __dead2. It looks up loader_main, which

r326182: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems

r326384: Use const pointers to avoid casting away constness.

r326421: loader.efi: efipart should exclude iPXE stub block protocol

r326440: Remove stale dependency on ufsread.c

r326441: Minor flags cleanup

r326442: Cleanup CFALGS usage here

r326443: We don't need both _STAND and _STANDALONE, use the latter.

r326444: Move geli to common DO32 stuff

r326445: Fix random() and srandom() prototypes to match the standard.

r326446: Undefine _STANDALONE since this is test code.

r326447: Tweaks to the beri boot loader so that it builds w/o warnings.

r326448: Fix all warnings related to geli and ZFS support on x86.

r326484: Const poison the propname.

r326485: Delcare md_load in libofw.h. Make all prototypes match for ofw

r326486: Include machine/md_var to pick up __syncicache prototype.

r326487: Cast mdp (a vm_offset_t) to void * to match prototype.

r326488: e_entry can be smaller than a pointer. Cast it to an intptr_t

r326490: Declare our strange brand of main().

r326491: Disconnet ps3 from the build. There's too many warnings to fix.

r326492: Cast void * pointer to char * so the arg matches the %s format.

r326493: Provide a md_load64 prototype.

r326494: Mark two things as unused (since they are only sometimes used)

r326495: Now it's safe to bump WARNS to 1.

r326504: Switch to proper MK_LOADER_GELI tests.

r326507: increase maximum size of zfsboot

r326509: loader.efi: add note about iPXE into the efipart.c

r326584: When building standalone, include stand.h rather than the kernel

r326585: Include ficl.h before anything else

r326586: No need to include the userland md5.h, the kernel one is just fine.

r326587: Use the kernel relative paths, rather than the userland relative
paths

r326588: Need to include skein in the include path

r326589: Make sure we include the right path for skein.h

r326590: Prefer stdint.h to inttypes.h

r326591: This isn't NetBSD specific code. Include these for any kernel /

r326592: Don't inherit CFLAGS. This a specialized test program.

r326593: Stop building with the standard system headers.

r326594: Now that we offer a semi-sane standards-ish set of #include files,
stop hacking includes with sed.

r326600: Since this is contrib code, create an upstreamable version of my

r326616: dhcp_try_rfc1048() is not used any more

r326671: Avoid setting -Wno-tentative-definition-incomplete-type with gcc.

r326707: Add partial support signal.h functioanlity. Pull in
machine/signal.h

r326708: Remove _KERNEL hack now that errno.h does the right thing when
built standalone.

r326709: Provide implementations for iscntrl, ispunct and isgraph.

r326710: Put the files we're copying over into a few variables and clean
hings up.

r326711: Const poison a couple of interfaces.

r326712: Create interp class.

r326714: boot1.c needs EFI_ZFS_BOOT too, so add it globally.

r326720: This path belongs in ficl/Makefile, not the common defines for
users

r326768: Fix a comment to be more accurate

r326772: Fix regression with lua import

r326784: Revert part of 362772. It was causing problems for includes

r326792: Attempt to unbreak buildworld

r326812: Revert r326792, r326784, r326772, r326712

r326854: libefi: make efichar.h more usable in stand code

r326855: Cargo cut a fix for the regressions r326585 caused.

r326856: Fix comments after bump in size.

r326858: Revert r326855: Cargo cut a fix for the regressions r326585 caused.

r326886: Panic in sbrk if setheap hasn't been called yet. This is preferable
o a mysterious crash

r326887: Remove the 'mini libstand in libstand' that util.[ch] provided.

r326914: Move loader-only defines to loader.mk from defs.mk

r326926: Move loader help file definitions to being 100% inside of
loader.mk.

r326927: libficl is only ever used in a loader (never a boot) program. Move
it.

r326960: Simplify things a little. The RETURN macro isn't required.

r326961: Interact is always called with NULL. Simplify code a little

r326962: Hoist btx include stuff to i386/Makefile.inc

r326963: No need to use relative paths like this here.

r327351: Fix ubldr. uboot/lib uses defines for the loader.

r327453: Add a validbcd() routine that uses the bcd2bin_data[] array

r327390: Garbage-collect loader.ps3. It is currently disconnected from the
build and kboot replaces.

r327523: Don't clobber system LDFLAGS for beri boot loaders.

r327524: Use 'extern uint8_t' instead of 'extern void' for external symbols.

r326489: Allow this file to be used in libsa without warning...

r327880: Move getsecs() prototype to stand.h from net.h so it can be used

r328437: Split panic routine

r328438: Implement abort() as a call to panic.

r328439: Provide abs form stdlib.h.

r328441: abort() should be marked __dead2 since it won't return.

r328446: Now that exit is __dead2, we need to tag ub_exit() as __dead2.

r328448: Make exit() never return until host_exit can be written.

r328449: Tag unreachable places as such. I left the while (1); in place

r328612: Move strtold wrapper from strtol.c to its own strtold.c.

r328613: Kill copies of strtol and strtoul.

r328615: Update stand.h for changes for strto*l

PR: 223969


/freebsd-11-stable/contrib/compiler-rt/lib/builtins/int_lib.h
/freebsd-11-stable/lib/libc/stdlib/Makefile.inc
/freebsd-11-stable/lib/libc/stdlib/strtol.c
/freebsd-11-stable/lib/libc/stdlib/strtold.c
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/arm/uboot/Makefile
bootstrap.h
dev_net.c
interp.c
interp_backslash.c
interp_forth.c
interp_parse.c
load_elf.c
load_elf_obj.c
reloc_elf.c
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/boot1/boot1.c
/freebsd-11-stable/stand/efi/include/efichar.h
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/libefi/efichar.c
/freebsd-11-stable/stand/efi/libefi/efipart.c
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/main.c
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl/Makefile
/freebsd-11-stable/stand/ficl/float.c
/freebsd-11-stable/stand/geli/Makefile
/freebsd-11-stable/stand/geli/geliboot.c
/freebsd-11-stable/stand/geli/geliboot_internal.h
/freebsd-11-stable/stand/i386/Makefile.inc
/freebsd-11-stable/stand/i386/boot2/Makefile
/freebsd-11-stable/stand/i386/common/cons.c
/freebsd-11-stable/stand/i386/common/drv.c
/freebsd-11-stable/stand/i386/gptboot/Makefile
/freebsd-11-stable/stand/i386/gptboot/gptboot.c
/freebsd-11-stable/stand/i386/gptboot/gptldr.S
/freebsd-11-stable/stand/i386/gptzfsboot/Makefile
/freebsd-11-stable/stand/i386/libfirewire/Makefile
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biosdisk.c
/freebsd-11-stable/stand/i386/libi386/multiboot.c
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/loader/main.c
/freebsd-11-stable/stand/i386/zfsboot/Makefile
/freebsd-11-stable/stand/i386/zfsboot/zfsboot.c
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/abort.c
/freebsd-11-stable/stand/libsa/bootp.c
/freebsd-11-stable/stand/libsa/bootp.h
/freebsd-11-stable/stand/libsa/cd9660.c
/freebsd-11-stable/stand/libsa/gpt.c
/freebsd-11-stable/stand/libsa/net.h
/freebsd-11-stable/stand/libsa/panic.c
/freebsd-11-stable/stand/libsa/sbrk.c
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/libsa/strtol.c
/freebsd-11-stable/stand/libsa/strtoul.c
/freebsd-11-stable/stand/libsa/util.c
/freebsd-11-stable/stand/libsa/util.h
/freebsd-11-stable/stand/libsa/xlocale_private.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/mips/beri/boot2/Makefile
/freebsd-11-stable/stand/mips/beri/boot2/boot2.c
/freebsd-11-stable/stand/mips/beri/common/altera_jtag_uart.c
/freebsd-11-stable/stand/mips/beri/common/cfi.c
/freebsd-11-stable/stand/mips/beri/common/sdcard.c
/freebsd-11-stable/stand/mips/beri/loader/Makefile
/freebsd-11-stable/stand/mips/beri/loader/devicename.c
/freebsd-11-stable/stand/mips/beri/loader/exec.c
/freebsd-11-stable/stand/mips/beri/loader/loader.h
/freebsd-11-stable/stand/mips/beri/loader/main.c
/freebsd-11-stable/stand/mips/uboot/Makefile
/freebsd-11-stable/stand/mips/uboot/conf.c
/freebsd-11-stable/stand/ofw/common/main.c
/freebsd-11-stable/stand/ofw/libofw/elf_freebsd.c
/freebsd-11-stable/stand/ofw/libofw/libofw.h
/freebsd-11-stable/stand/ofw/libofw/openfirm.c
/freebsd-11-stable/stand/ofw/libofw/openfirm.h
/freebsd-11-stable/stand/ofw/libofw/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/Makefile
/freebsd-11-stable/stand/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/stand/powerpc/boot1.chrp/boot1.c
/freebsd-11-stable/stand/powerpc/kboot/Makefile
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.h
/freebsd-11-stable/stand/powerpc/kboot/hostdisk.c
/freebsd-11-stable/stand/powerpc/kboot/kbootfdt.c
/freebsd-11-stable/stand/powerpc/kboot/main.c
/freebsd-11-stable/stand/powerpc/kboot/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/Makefile
/freebsd-11-stable/stand/powerpc/ofw/start.c
/freebsd-11-stable/stand/powerpc/ps3
/freebsd-11-stable/stand/powerpc/uboot/Makefile
/freebsd-11-stable/stand/sparc64/boot1/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/sparc64/loader/main.c
/freebsd-11-stable/stand/sparc64/loader/metadata.c
/freebsd-11-stable/stand/uboot/common/main.c
/freebsd-11-stable/stand/uboot/lib/glue.c
/freebsd-11-stable/stand/uboot/lib/glue.h
/freebsd-11-stable/stand/userboot/test/Makefile
/freebsd-11-stable/stand/userboot/test/test.c
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/userboot/userboot/main.c
/freebsd-11-stable/stand/zfs/zfsimpl.c
/freebsd-11-stable/sys/cddl/boot/zfs/zfssubr.c
/freebsd-11-stable/sys/contrib/libfdt/libfdt_env.h
/freebsd-11-stable/sys/geom/eli/g_eli_hmac.c
/freebsd-11-stable/sys/geom/eli/pkcs5v2.c
/freebsd-11-stable/sys/opencrypto/xform_userland.h
/freebsd-11-stable/sys/sys/errno.h
/freebsd-11-stable/sys/sys/libkern.h
/freebsd-11-stable/sys/sys/syslimits.h
329145 12-Feb-2018 kevans

MFC r325834,r325997,326502: Move sys/boot to stand/

This is effectively a direct commit to stable/11, due to differences between
stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often
accompanied by kernel changes. Many of these were also risc-v updates that
likely had many more dependencies to MFC.

Because of this, sys/boot/fdt/dts remains as-is while everything else in
sys/boot relocates to stand/.

r325834: Move sys/boot to stand. Fix all references to new location

r325997: Remove empty directories.

r326502: Document the sys/boot -> stand move in hier.7 and the top-level README.


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/Makefile.inc1
/freebsd-11-stable/README
/freebsd-11-stable/lib/libefivar/Makefile
/freebsd-11-stable/release/powerpc/generate-hfs.sh
/freebsd-11-stable/release/tools/vmimage.subr
/freebsd-11-stable/share/examples/bootforth/README
/freebsd-11-stable/share/examples/etc/make.conf
/freebsd-11-stable/share/man/man5/make.conf.5
/freebsd-11-stable/share/man/man7/hier.7
/freebsd-11-stable/share/man/man8/diskless.8
/freebsd-11-stable/stand
/freebsd-11-stable/stand/Makefile
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.arm
/freebsd-11-stable/stand/Makefile.arm64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/Makefile.mips
/freebsd-11-stable/stand/Makefile.pc98
/freebsd-11-stable/stand/Makefile.powerpc
/freebsd-11-stable/stand/Makefile.sparc64
/freebsd-11-stable/stand/arm
/freebsd-11-stable/stand/arm64
/freebsd-11-stable/stand/common
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi
/freebsd-11-stable/stand/fdt
/freebsd-11-stable/stand/fdt.mk
/freebsd-11-stable/stand/fdt/Makefile
/freebsd-11-stable/stand/fdt/Makefile.depend
/freebsd-11-stable/stand/fdt/fdt_loader_cmd.c
/freebsd-11-stable/stand/fdt/fdt_platform.h
/freebsd-11-stable/stand/fdt/help.fdt
/freebsd-11-stable/stand/ficl
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl32
/freebsd-11-stable/stand/forth
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/forth/support.4th
/freebsd-11-stable/stand/geli
/freebsd-11-stable/stand/i386
/freebsd-11-stable/stand/i386/Makefile.inc
/freebsd-11-stable/stand/kshim
/freebsd-11-stable/stand/libsa
/freebsd-11-stable/stand/libsa32
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/man
/freebsd-11-stable/stand/mips
/freebsd-11-stable/stand/ofw
/freebsd-11-stable/stand/pc98
/freebsd-11-stable/stand/pc98/Makefile.inc
/freebsd-11-stable/stand/powerpc
/freebsd-11-stable/stand/sparc64
/freebsd-11-stable/stand/uboot
/freebsd-11-stable/stand/uboot.mk
/freebsd-11-stable/stand/usb
/freebsd-11-stable/stand/userboot
/freebsd-11-stable/stand/userboot/ficl
/freebsd-11-stable/stand/userboot/libstand
/freebsd-11-stable/stand/userboot/zfs
/freebsd-11-stable/stand/zfs
/freebsd-11-stable/stand/zfs32
/freebsd-11-stable/sys/Makefile
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.mips
/freebsd-11-stable/sys/boot/Makefile.pc98
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm
/freebsd-11-stable/sys/boot/arm64
/freebsd-11-stable/sys/boot/common
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/fdt/Makefile.depend
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/fdt/fdt_platform.h
/freebsd-11-stable/sys/boot/fdt/help.fdt
/freebsd-11-stable/sys/boot/ficl
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl32
/freebsd-11-stable/sys/boot/forth
/freebsd-11-stable/sys/boot/geli
/freebsd-11-stable/sys/boot/i386
/freebsd-11-stable/sys/boot/kshim
/freebsd-11-stable/sys/boot/libsa
/freebsd-11-stable/sys/boot/libsa32
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man
/freebsd-11-stable/sys/boot/mips
/freebsd-11-stable/sys/boot/ofw
/freebsd-11-stable/sys/boot/pc98
/freebsd-11-stable/sys/boot/powerpc
/freebsd-11-stable/sys/boot/sparc64
/freebsd-11-stable/sys/boot/uboot
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/usb
/freebsd-11-stable/sys/boot/userboot
/freebsd-11-stable/sys/boot/zfs
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/contrib/dev/acpica/acpica_prep.sh
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/tools/bootparttest/Makefile
/freebsd-11-stable/tools/tools/zfsboottest/Makefile
/freebsd-11-stable/usr.sbin/bhyveload/Makefile
329140 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p6: r324649,r324650,r324651,r324652,r324653,r324654,
r324700,r324702,r324709,r324717,r324719,r324841,r324842,r324843,r324845,
r324850,r324876,r324877,r324878,r324879,r324880,r324881,r324883,r324980,
r324981,r324982,r324995,r325014,r325093,r325094,r325114,r325170,r325171,
r325172,r325173,r325174,r325175,r325176,r325248,r325286,r325310,r325332,
r325338,r325339,r325376,r325377,r325379,r325380,r325382,r325478,r325479,
r325480,r325482,r325483,r325484,r325485,r325556,r325641,r325681,r325685,
r325686,r325687,r325688,r325689,r325690,r325691,r325692,r325693,r325694,
r325743,r325744,r325748,r325775,r325779,r325780

r324649: Move common/Makefile.inc to sys/boot/loader.mk.

r324650: tweak style

r324651: create defs.mk for common definitions

r324652: Move all the ficl common code into ficl.mk

r324653: LOADER_foo_SUPPORTED

r324654: Explicitly inlcude SYSDIR in the include path

r324700: loader: initialize dv_cleanup in md.c to eliminate clang warning

r324702: We need to include disk.o in libuboot.a when we're building with
support for disk access.

r324709: Revert "Unify boot1 with loader" change r324646

r324717: libsa/ip.c: misplaced comment, ip_v is half char, not ip_p

r324719: libsa/ip: stop read loop on bad fragments

r324841: Use BOOTDIR more consistently in defs.mk rather than repeat
sys/boot.

r324842: Introduce BOOTOBJ: The top level object directory for the boot tree

r324843: Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and
LOADER_NO_GELI_SUPPORT.

r324845: Use BOOTOBJ and BOOTDIR to find geli includes and libraries.

r324850: Define LIBSA32 to LIBSA on i386 to fix build.

r324876: Move fdt and uboot defines into common uboot.mk.

r324877: End source directories with SRC rather than a hodgepodge of names

r324878: Make at91 boot loader compile again.

r324879: Prefer SRCTOP paths for bits we're grabbing from libc.

r324880: Use BOOTSRC here.

r324881: Use SYSDIR instead of ${.CURDIR}/../..<etc>/sys.

r324883: Use preferred defined paths, rather than relative paths in fdt.

r324980: Use BOOTDIR consistently.

r324981: Move BINDIR definition to defs.mk, and override where it isn't
/boot

r324982: Remove sys/boot/arm/at91 and ixp425

r324995: loader.efi: Make framebuffer commands available for arm64

r325014: Add a 'place holder' arm struct efi_fb until a real one comes

r325093: Define new EFI variables

r325094: Cleanup non-arch Makefiles

r325114: Use defs.mk defins in most MD code

r325170: Use defs.mk values for userboot

r325171: Use defs.mk name and prefer bsd.init.mk

r325172: Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be
honored correctly with the new Makefile.inc include order.

r325173: We don't need to build a special ficl for userboot.

r325174: Minor cleanup

r325175: For amd64, compile both zfs and zfs32 libraries.

r325176: Actually add zfs32/Makefile

r325248: loader ptblread() is broken with >512B sectors

r325286: efipart_strategy is using wrong offset with >512B sectors

r325310: zfs.c:vdev_read() needs to be careful about large sectors

r325332: loader: re-enable gzip support for x86

r325338: loader: fix BOOTSRC -> BOOTOBJ in a library path

r325339: This used to have bzip2 support too.

r325376: WIP: centralize machine links

r325377: mostly libsa

r325379: Revert "mostly libsa"

r325380: Revert "WIP: centralize machine links"

r325382: Cleanup stray libstand names to be libsa names.

r325478: Powerpc is a 32-bit boot loader.

r325479: Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64.

r325480: Use DO32 for all the places that we need to flag we're building a
32-bit version of a library.

r325482: Move machine and other link creation to defs.mk

r325483: MACHINE can never be powerpc64, so cleanup code that thinks it can.

r325484: Prefer bsd.init.mk to src.opts.mk

r325485: Centralize all 32-bit builds on 64-bit platform stuff.

r325556: loader: set options before including bsd.init.mk

r325641: loader.efi: efi_devpath_is_prefix should return bool

r325681: boot1: avoid using NULL device path

r325685: libsa32 isn't needed for i386. It's already a 32-bit platform.

r325686: Simplify this if to a direct assignment.

r325687: Remove all the empty help files from the powerpc build.

r325688: FDT support doesn't make sense for ps3, remove it.

r325689: Remove LOADER_FDT_SUPPORT as a Makefile variable.

r325690: Remove LOADER_ZFS_SUPPORT as a Makefile variable

r325691: Remove useless PNP define here.

r325692: Replace LOADER_FIREWIRE_SUPPORT variable

r325693: Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI

r325694: Install the 4th files in sys/boot/forth instead of each loader

r325743: Make sure the proper loader.rc gets installed.

r325744: boot1: also check for NULL device

r325748: Use proper include file.

r325775: Add loader.conf to the list of files that are MD.

r325779: Add /boot/dts to the list of default modules.

r325780: Don't add /boot/dt*s* but /boot/dt*b*. Stupid think-o.


/freebsd-11-stable/UPDATING
/freebsd-11-stable/share/mk/src.opts.mk
/freebsd-11-stable/sys/arm/include/metadata.h
/freebsd-11-stable/sys/arm64/include/metadata.h
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm/at91/Makefile
/freebsd-11-stable/sys/boot/arm/at91/Makefile.inc
/freebsd-11-stable/sys/boot/arm/at91/boot0/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0/README
/freebsd-11-stable/sys/boot/arm/at91/boot0/linker.cfg
/freebsd-11-stable/sys/boot/arm/at91/boot0/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot0iic/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0iic/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot0spi/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot0spi/main.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/Makefile
/freebsd-11-stable/sys/boot/arm/at91/boot2/board.h
/freebsd-11-stable/sys/boot/arm/at91/boot2/boot2.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/bwct_board.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/centipad_board.c
/freebsd-11-stable/sys/boot/arm/at91/boot2/kb920x_board.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/Makefile
/freebsd-11-stable/sys/boot/arm/at91/bootiic/README
/freebsd-11-stable/sys/boot/arm/at91/bootiic/env_vars.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/env_vars.h
/freebsd-11-stable/sys/boot/arm/at91/bootiic/loader_prompt.c
/freebsd-11-stable/sys/boot/arm/at91/bootiic/loader_prompt.h
/freebsd-11-stable/sys/boot/arm/at91/bootiic/main.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/Makefile
/freebsd-11-stable/sys/boot/arm/at91/bootspi/README
/freebsd-11-stable/sys/boot/arm/at91/bootspi/ee.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/ee.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/env_vars.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/env_vars.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/loader_prompt.c
/freebsd-11-stable/sys/boot/arm/at91/bootspi/loader_prompt.h
/freebsd-11-stable/sys/boot/arm/at91/bootspi/main.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/Makefile
/freebsd-11-stable/sys/boot/arm/at91/libat91/arm_init.S
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/delay.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/eeprom.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/emac_init.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/getc.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/lib.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/lib_AT91RM9200.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/mci_device.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/memcmp.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/memcpy.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/memset.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/p_string.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/printf.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/putchar.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/reset.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/sd-card.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/sd-card.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/spi_flash.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/spi_flash.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcmp.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcpy.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strcvt.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/strlen.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/tag_list.c
/freebsd-11-stable/sys/boot/arm/at91/libat91/tag_list.h
/freebsd-11-stable/sys/boot/arm/at91/libat91/xmodem.c
/freebsd-11-stable/sys/boot/arm/at91/linker.cfg
/freebsd-11-stable/sys/boot/arm/ixp425/Makefile.inc
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/Makefile
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/arm_init.S
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/boot2.c
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/cf_ata.h
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/ixp425_board.c
/freebsd-11-stable/sys/boot/arm/ixp425/boot2/lib.h
/freebsd-11-stable/sys/boot/arm/loader
/freebsd-11-stable/sys/boot/arm/loader/loader.conf
/freebsd-11-stable/sys/boot/arm/uboot/Makefile
/freebsd-11-stable/sys/boot/arm/uboot/loader.conf
/freebsd-11-stable/sys/boot/common/Makefile.inc
/freebsd-11-stable/sys/boot/common/disk.c
/freebsd-11-stable/sys/boot/common/md.c
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi/Makefile
/freebsd-11-stable/sys/boot/efi/Makefile.inc
/freebsd-11-stable/sys/boot/efi/boot1/Makefile
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/boot1/boot_module.h
/freebsd-11-stable/sys/boot/efi/boot1/ufs_module.c
/freebsd-11-stable/sys/boot/efi/boot1/zfs_module.c
/freebsd-11-stable/sys/boot/efi/fdt/Makefile
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efi_main.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.h
/freebsd-11-stable/sys/boot/efi/loader/arch/arm/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/arm64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/bootinfo.c
/freebsd-11-stable/sys/boot/efi/loader/efi_main.c
/freebsd-11-stable/sys/boot/efi/loader/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/framebuffer.h
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl/Makefile
/freebsd-11-stable/sys/boot/ficl32/Makefile
/freebsd-11-stable/sys/boot/forth/Makefile
/freebsd-11-stable/sys/boot/forth/Makefile.inc
/freebsd-11-stable/sys/boot/forth/loader.conf
/freebsd-11-stable/sys/boot/geli/Makefile
/freebsd-11-stable/sys/boot/i386/Makefile
/freebsd-11-stable/sys/boot/i386/Makefile.inc
/freebsd-11-stable/sys/boot/i386/boot0/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btx/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/i386/btx/lib/Makefile
/freebsd-11-stable/sys/boot/i386/cdboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/kgzldr/Makefile
/freebsd-11-stable/sys/boot/i386/libfirewire/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/mbr/Makefile
/freebsd-11-stable/sys/boot/i386/pmbr/Makefile
/freebsd-11-stable/sys/boot/i386/pxeldr/Makefile
/freebsd-11-stable/sys/boot/i386/zfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/zfsloader/Makefile
/freebsd-11-stable/sys/boot/libsa/Makefile
/freebsd-11-stable/sys/boot/libsa/ip.c
/freebsd-11-stable/sys/boot/libsa32/Makefile
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man/Makefile
/freebsd-11-stable/sys/boot/mips/beri/Makefile.inc
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/loader/Makefile
/freebsd-11-stable/sys/boot/mips/uboot/Makefile
/freebsd-11-stable/sys/boot/ofw/Makefile.inc
/freebsd-11-stable/sys/boot/ofw/libofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/Makefile
/freebsd-11-stable/sys/boot/powerpc/Makefile.inc
/freebsd-11-stable/sys/boot/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/help.kboot
/freebsd-11-stable/sys/boot/powerpc/ofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/ofw/help.ofw
/freebsd-11-stable/sys/boot/powerpc/ps3/Makefile
/freebsd-11-stable/sys/boot/powerpc/ps3/help.ps3
/freebsd-11-stable/sys/boot/powerpc/uboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/uboot/help.uboot
/freebsd-11-stable/sys/boot/sparc64/Makefile
/freebsd-11-stable/sys/boot/sparc64/Makefile.inc
/freebsd-11-stable/sys/boot/sparc64/boot1/Makefile
/freebsd-11-stable/sys/boot/sparc64/loader/Makefile
/freebsd-11-stable/sys/boot/sparc64/zfsloader/Makefile
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/uboot/Makefile
/freebsd-11-stable/sys/boot/uboot/Makefile.inc
/freebsd-11-stable/sys/boot/uboot/common/Makefile.inc
/freebsd-11-stable/sys/boot/uboot/fdt/Makefile
/freebsd-11-stable/sys/boot/uboot/lib/Makefile
/freebsd-11-stable/sys/boot/userboot/Makefile
/freebsd-11-stable/sys/boot/userboot/ficl/Makefile
/freebsd-11-stable/sys/boot/userboot/ficl/Makefile.depend
/freebsd-11-stable/sys/boot/userboot/test/Makefile
/freebsd-11-stable/sys/boot/userboot/test/test.c
/freebsd-11-stable/sys/boot/userboot/userboot/Makefile
/freebsd-11-stable/sys/boot/userboot/zfs/Makefile
/freebsd-11-stable/sys/boot/userboot/zfs/Makefile.depend
/freebsd-11-stable/sys/boot/zfs/Makefile
/freebsd-11-stable/sys/boot/zfs/zfs.c
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/boot/zfs32/Makefile
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/build/options/WITHOUT_LOADER_GEIL
/freebsd-11-stable/tools/build/options/WITH_LOADER_FIREWIRE
329136 11-Feb-2018 kevans

MFC r324648: Rename top level Makefile.ficl to ficl.mk.

329135 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p5: r324557,r324558,r324559,r324646,r324647

r324557: Rename exit to efi_exit to avoid clashing with libsa exit
definition

r324558: Define prototype for exit and ensure references

r324559: Move panic back into libsa. It's documented in libstand(3) to
belong there.

r324646: Unify boot1 with loader.

r324647: Move orphaned man pages into new man directory from common.

329134 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p4: r324552,r324553,r324554,r324555,r324556

r324552: Kill the userboot copy of libstand.

r324553: Rename libstand.a to libsa.a and libstand32.a to libsa32.a

r324554: Move crc32.c, util.c and gpt.c over to libsa.

r324555: Honor CFLAGS modifications in Makefile.inc by using += here.

r324556: Move ufsread.c

329131 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p3: r324460,r324471

r324460: Rather than laying whack-a-mole with including the path to stand.h,
always include it.

r324471: Fix typos: `stand alon{e,g}` should be spelled like `standalone`

329129 11-Feb-2018 kevans

MFC Loader Fixes 2017q4p1: r324321,r324359,r324360,r324388,r324449,r324450,
r324451,r324452

r324321: This README file was quite relevant for FreeBSD 3 or 4. No more.

r324359: Add efi_devpath_is_prefix

r324360: Encapsulate ZFS preferences into efi_zfs_is_preferred

r324388: Unbreak building efiboot with MK_ZFS == no

r324449: Prefer ${LIBSTAND} to -lstand

r324450: Define SASRC and use it

r324451: Add missing -I${SASRC} in a couple of places so that stand.h
doesn't accidentally come in via host pollution.

r324452: Define LIBSA* and use them instead of overloaded LIBSTAND


/freebsd-11-stable/sys/boot/Makefile.ficl
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/README
/freebsd-11-stable/sys/boot/arm/uboot/Makefile
/freebsd-11-stable/sys/boot/common/Makefile.inc
/freebsd-11-stable/sys/boot/efi/boot1/Makefile
/freebsd-11-stable/sys/boot/efi/fdt/Makefile
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/include/efizfs.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efizfs.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libfirewire/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/zfsboot/Makefile
/freebsd-11-stable/sys/boot/libstand32/Makefile
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/loader/Makefile
/freebsd-11-stable/sys/boot/mips/uboot/Makefile
/freebsd-11-stable/sys/boot/ofw/libofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/ofw/Makefile
/freebsd-11-stable/sys/boot/powerpc/ps3/Makefile
/freebsd-11-stable/sys/boot/powerpc/uboot/Makefile
/freebsd-11-stable/sys/boot/sparc64/loader/Makefile
/freebsd-11-stable/sys/boot/uboot/fdt/Makefile
/freebsd-11-stable/sys/boot/uboot/lib/Makefile
/freebsd-11-stable/sys/boot/userboot/Makefile.inc
/freebsd-11-stable/sys/boot/userboot/libstand/Makefile
/freebsd-11-stable/sys/boot/userboot/userboot/Makefile
/freebsd-11-stable/sys/boot/userboot/zfs/Makefile
/freebsd-11-stable/sys/boot/zfs/Makefile
329114 11-Feb-2018 kevans

MFC Loader Fixes 2017q3: r320547,r320553,r321621,r321844,r321969,r321991,
r322037,r322038,r322039,r322040,r322056,r322074,r322542,r322592,r322593,
r322896,r322923,r323671,r322930,r322931,r322932,r322933,r322934,r322935,
r322936,r322937,r322938,r322939,r322941,r323062,r323063,r323064,r323065,
r323100,r323131,r323174,r323258,r323261,r323272,r323367,r323379,r323389,
r323407,r323428,r323436,r323494,r323496,r323497,r323541,r323554,r323589,
r323707,r323867,r323885,r323886,r323895,r323896,r323897,r323905,r323906,
r323907,r323908,r323909,r323952,r323991,r324099,r324558,r326445,r326609,
r326610

This batch includes a special kludge to fix powerpc loader build; <stdlib.h>
was included after <stand.h> there, causing problems with DEBUG_MALLOC bits.
Include <stdlib.h> a little bit earlier to fix the build with the intention
of removing this when eventually libsa silently replaces stdlib.h with
stand.h.

r320547: Link EFI/uboot loaders with -znotext

r320553: Integer underflow in efipart_realstrategy when I/O starts after end
of disk

r321621: Always set the receive mask in loader.efi.

r321844: Clean up style in print_state(..) and pager_printf(..)

r321969: Fix the return types for printf and putchar to match their libc

r321991: Revert r321969

r322037: Add stpcpy and stpncpy to libstand

r322038: Add definitions and utilities for EFI drivers

r322039: Move EFI ZFS functions to libefi

r322040: Add EFI utility functions to libefi

r322056: Move EFI fmtdev functionality to libefi

r322074: libefi/time.c cstyle cleanup

r322542: loader.efi: repace XXX with real comments in trap.c

r322592: Remove unused defines.

r322593: Define proposed GUID for FreeBSD boot loader variables.

r322896: Make spinconsole platform independent and hook it up into EFI
loader

r322923: Hide length of geli passphrase during boot.

r323671: Fix language used in the r322923.

r322930: Move efi_main into efi/loader

r322931: Cleanup efi_main return type

r322932: Use the loader.efi conventions for the various EFI tables.

r322933: No need for MK_ZFS around these: they are by their nature only
active when MK_ZFS is true.

r322934: _STAND is sometimes defined on the command line. Make the define
here match.

r322935: Fix warnings due to type mismatch.

r322936: Remove useless 'static' for an enum definition.

r322937: Forward declare struct dsk to avoid warnings when building libi386.

r322938: Link in libefi for boot1

r322939: Use efi_devpath_str for debug path info.

r322941: Eliminate redunant device path matching.

r323062: Make efichar.c routines available to libefi.

r323063: boot1.efi: print more info about where boot1.efi is loaded from

r323064: Exit rather than panic for most errors.

r323065: Save where we're booted from

r323100: libstand: nfs_readlink() should return proper return code

r323131: Revert r322941: Eliminate redundant device matching functions

r323174: Fix loader bug causing too many pages allocation when bootloader
is U-Boot

r323258: ucs2len

r323261: Fix armv6 build

r323272: Be consistent and do return (1);

r323367: Mark init_chroot and init_script variables as deprecated.

r323379: It's been pointed out that init_script at least is useful w/o

r323389: loader.efi: chain loader should provide proper device handle

r323407: boot1 generate-fat: generate all templates at once

r323428: r323389 breaks the kernel build when WITHOUT_ZFS is defined in
src.conf

r323436: boot1: remove BOOT1_MAXSIZE default value

r323494: loader should support large_dnode

r323496: libstand: tftp_open() can leak pkt on error

r323497: libefi: efipart_open should check the status from disk_open

r323541: libefi: efipart_realstrategy rsize pointer may be NULL

r323554: Increase EFI boot file size frok 128k to 384k

r323589: loader: biosmem.c cstyle cleanup

r323707: loader: biosmem allocate heap just below 4GB

r323867: libefi: devicename.c cleanups

r323885: libefi: efi_devpath_match() should return bool

r323886: libefi: efipart.c should use calloc()

r323895: libefi: efi_devpath_match local len should be unsigned

r323896: r323885 did miss efilib.h update

r323897: efilib.h: typo in structure member description

r323905: libefi: pdinfo_t pd_unit and pd_open should be unsigned

r323906: libefi: efipart_strategy() should return ENXIO when there is no
media

r323907: libefi: efipart.c cstyle fix for efipart_print_common()

r323908: libefi: efipart_hdinfo_add_filepath should check strtol result

r323909: libefi: define EISA PNP constants

r323952: After the r317886 support for TFTP and NFS can be enable
simultaneously.

r323991: libefi: efipart_floppy() will should not pass acpi pointer if the
HID test fails

r324099: Compile loader as Little-Endian on PPC64/POWER8

r324558: Define prototype for exit and ensure references

r326445: Fix random() and srandom() prototypes to match the standard.

r326609: Make putenv and getenv match the userland definition

r326610: Fix random() prototype to match the system.

PR: 219000 221001 222215
Relnotes: yes ("The length of the geli passphrase is hidden during boot")


/freebsd-11-stable/UPDATING
/freebsd-11-stable/lib/libstand/Makefile
/freebsd-11-stable/lib/libstand/environment.c
/freebsd-11-stable/lib/libstand/libstand.3
/freebsd-11-stable/lib/libstand/nfs.c
/freebsd-11-stable/lib/libstand/random.c
/freebsd-11-stable/lib/libstand/stand.h
/freebsd-11-stable/lib/libstand/tftp.c
/freebsd-11-stable/sbin/geom/class/eli/geli.8
/freebsd-11-stable/sbin/geom/class/eli/geom_eli.c
/freebsd-11-stable/share/mk/src.opts.mk
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/arm/uboot/Makefile
/freebsd-11-stable/sys/boot/arm/uboot/conf.c
/freebsd-11-stable/sys/boot/common/loader.8
/freebsd-11-stable/sys/boot/efi/boot1/Makefile
/freebsd-11-stable/sys/boot/efi/boot1/Makefile.fat
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/boot1/boot_module.h
/freebsd-11-stable/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu
/freebsd-11-stable/sys/boot/efi/boot1/fat-amd64.tmpl.xz
/freebsd-11-stable/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu
/freebsd-11-stable/sys/boot/efi/boot1/fat-arm.tmpl.xz
/freebsd-11-stable/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu
/freebsd-11-stable/sys/boot/efi/boot1/fat-arm64.tmpl.xz
/freebsd-11-stable/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu
/freebsd-11-stable/sys/boot/efi/boot1/fat-i386.tmpl.xz
/freebsd-11-stable/sys/boot/efi/boot1/generate-fat.sh
/freebsd-11-stable/sys/boot/efi/boot1/ufs_module.c
/freebsd-11-stable/sys/boot/efi/boot1/zfs_module.c
/freebsd-11-stable/sys/boot/efi/include/efi.h
/freebsd-11-stable/sys/boot/efi/include/efi_driver_utils.h
/freebsd-11-stable/sys/boot/efi/include/efi_drivers.h
/freebsd-11-stable/sys/boot/efi/include/efiapi.h
/freebsd-11-stable/sys/boot/efi/include/efichar.h
/freebsd-11-stable/sys/boot/efi/include/efidevp.h
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/include/efiprot.h
/freebsd-11-stable/sys/boot/efi/include/efizfs.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devicename.c
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efi_driver_utils.c
/freebsd-11-stable/sys/boot/efi/libefi/efichar.c
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/libefi/efizfs.c
/freebsd-11-stable/sys/boot/efi/libefi/errno.c
/freebsd-11-stable/sys/boot/efi/libefi/libefi.c
/freebsd-11-stable/sys/boot/efi/libefi/time.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/trap.c
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/bootinfo.c
/freebsd-11-stable/sys/boot/efi/loader/conf.c
/freebsd-11-stable/sys/boot/efi/loader/devicename.c
/freebsd-11-stable/sys/boot/efi/loader/efi_main.c
/freebsd-11-stable/sys/boot/efi/loader/loader_efi.h
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/geli/geliboot.c
/freebsd-11-stable/sys/boot/geli/geliboot.h
/freebsd-11-stable/sys/boot/geli/geliboot_crypto.c
/freebsd-11-stable/sys/boot/geli/geliboot_internal.h
/freebsd-11-stable/sys/boot/geli/pwgets.c
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/biosmem.c
/freebsd-11-stable/sys/boot/i386/libi386/spinconsole.c
/freebsd-11-stable/sys/boot/mips/uboot/conf.c
/freebsd-11-stable/sys/boot/powerpc/ofw/conf.c
/freebsd-11-stable/sys/boot/powerpc/ofw/ofwfdt.c
/freebsd-11-stable/sys/boot/powerpc/uboot/conf.c
/freebsd-11-stable/sys/boot/userboot/test/test.c
/freebsd-11-stable/sys/boot/userboot/userboot.h
/freebsd-11-stable/sys/boot/userboot/userboot/main.c
/freebsd-11-stable/sys/boot/zfs/zfsimpl.c
/freebsd-11-stable/sys/cddl/boot/zfs/zfsimpl.h
/freebsd-11-stable/sys/geom/eli/g_eli.c
/freebsd-11-stable/sys/geom/eli/g_eli.h
/freebsd-11-stable/sys/geom/eli/g_eli_ctl.c
/freebsd-11-stable/usr.sbin/bhyveload/bhyveload.c
329100 10-Feb-2018 kevans

MFC Loader Fixes 2017q2: r316437,r316577,r316578,r316585,r316590,r316612,
r316625,r316628,r316654,r316682,r316704,r316771,r317092,r317097,r317099,
r317652,r317785,r317886,r317887,r318142,r318320,r318356,r318678,r318754,
r318982,r318986,r318987,r318988,r318989,r318990,r318991,r318992,r318993,
r318994,r318999,r319083,r319084,r319085,r320011,r320234,r320288,r320304,
r320467,r320482

r316437: Small cleanup to make i386/loader match efi/loader boot environment
code

r316577: loader: part.c cstyle cleanup

r316578: loader: want mechanism to avoid RA with bcache

r316585: loader: zfs reader should check all labels

r316590: libstand/dosfs: cache FAT32 in 128 Kb blocks to save loader memory

r316612: In r298230 the value of HEAP_MIN was changed from 3MB to 64MB.
Correct a comment.

r316625: Do not use -msoft-float with intention of disabling FP on aarch64

r316628: Silence GCC warning by initializing the local variable.

r316654: loader: r316585 did miss userboot update

r316682: loader: r316585 did miss sparc/ofw

r316704: loader.efi: only fetch zfs pool guid for the actual boot device

r316771: loader: Avoid possible overflow via environment variable

r317092: loader: zfs reader vdev_probe should check for minimum device size

r317097: loader: F_READ/F_WRITE should be checked against masked flag

r317099: loader: uboot disk ioctl should call disk_ioctl

r317652: loader.efi: ResetSystem does not use data with EFI_SUCCESS

r317785: zfsboot: drvsize() may be unusable on some systems

r317886: distinguish NFS versus TFTP boot by rootpath

r317887: loader: network read rework

r318142: libstand: NULL pointer dereference in rarp

r318320: loader: add ip layer code into libstand

r318356: libstand: increase nfs max read size to 16k

r318678: Replacing iterating over rootpath by strsep(3).

r318754: Pass -N directly to ld via -Wl rather than passing it to the
compiler driver.

r318982: Pass a "FREEBSD" user-class in PXE dhcp request

r318986: add a comment on vendor index 19 and 20 to avoid confusion

r318987: Support URI scheme for root-path in netbooting

r318988: Always build tftpfs support along with nfs for pxeboot

r318989: Always issue the pxe request

r318990: Partially revert r314948

r318991: Document recent changes on pxeboot

r318992: Capitalize DHCP

r318993: Use the usual FreeBSD spelling for the DHCP user class

r318994: Catch with the change in the user class

r318999: Update the comments concerning net_parse_rootpath to reflect what
it is now

r319083: Followup on the user-class changes

r319084: Small cleanup in dev_net.c

r319085: use the same option list for dhcp discovery and request

r320011: Add chain loader support for loader

r320234: Make structure padding explicit in EFI_MEMORY_DESCRIPTOR

r320288: Allow Clang's integrated assembler to assemble boot0

r320304: loader.efi: Disable smbios for arm

r320467: loader: chain load relocate data declaration is bad

r320482: As with arm64 mark the EFI PE header as allocated on arm.

PR: 218473


/freebsd-11-stable/lib/libstand/Makefile
/freebsd-11-stable/lib/libstand/arp.c
/freebsd-11-stable/lib/libstand/bootp.c
/freebsd-11-stable/lib/libstand/bootp.h
/freebsd-11-stable/lib/libstand/bootparam.c
/freebsd-11-stable/lib/libstand/dosfs.c
/freebsd-11-stable/lib/libstand/dosfs.h
/freebsd-11-stable/lib/libstand/ether.c
/freebsd-11-stable/lib/libstand/globals.c
/freebsd-11-stable/lib/libstand/ip.c
/freebsd-11-stable/lib/libstand/net.c
/freebsd-11-stable/lib/libstand/net.h
/freebsd-11-stable/lib/libstand/netif.c
/freebsd-11-stable/lib/libstand/netif.h
/freebsd-11-stable/lib/libstand/nfs.c
/freebsd-11-stable/lib/libstand/rarp.c
/freebsd-11-stable/lib/libstand/rpc.c
/freebsd-11-stable/lib/libstand/rpc.h
/freebsd-11-stable/lib/libstand/stand.h
/freebsd-11-stable/lib/libstand/tftp.c
/freebsd-11-stable/lib/libstand/udp.c
/freebsd-11-stable/share/mk/bsd.stand.mk
/freebsd-11-stable/sys/boot/common/bcache.c
/freebsd-11-stable/sys/boot/common/commands.c
/freebsd-11-stable/sys/boot/common/dev_net.c
/freebsd-11-stable/sys/boot/common/disk.c
/freebsd-11-stable/sys/boot/common/md.c
/freebsd-11-stable/sys/boot/common/part.c
/freebsd-11-stable/sys/boot/efi/Makefile.inc
/freebsd-11-stable/sys/boot/efi/boot1/Makefile
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/boot1/zfs_module.c
/freebsd-11-stable/sys/boot/efi/fdt/Makefile
/freebsd-11-stable/sys/boot/efi/include/efidef.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/libefi/time.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/arch/arm/start.S
/freebsd-11-stable/sys/boot/efi/loader/arch/arm64/Makefile.inc
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/forth/menu.rc
/freebsd-11-stable/sys/boot/i386/boot0/Makefile
/freebsd-11-stable/sys/boot/i386/common/drv.h
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/bioscd.c
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/biosmem.c
/freebsd-11-stable/sys/boot/i386/libi386/libi386.h
/freebsd-11-stable/sys/boot/i386/libi386/pxe.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.h
/freebsd-11-stable/sys/boot/i386/libi386/relocater_tramp.S
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/loader/chain.c
/freebsd-11-stable/sys/boot/i386/loader/help.i386
/freebsd-11-stable/sys/boot/i386/loader/main.c
/freebsd-11-stable/sys/boot/i386/pxeldr/pxeboot.8
/freebsd-11-stable/sys/boot/i386/zfsboot/zfsboot.c
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_cfi.c
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_sdcard.c
/freebsd-11-stable/sys/boot/ofw/libofw/ofw_disk.c
/freebsd-11-stable/sys/boot/ofw/libofw/ofw_net.c
/freebsd-11-stable/sys/boot/ofw/libofw/openfirm.c
/freebsd-11-stable/sys/boot/ofw/libofw/openfirm.h
/freebsd-11-stable/sys/boot/powerpc/ps3/ps3cdrom.c
/freebsd-11-stable/sys/boot/powerpc/ps3/ps3disk.c
/freebsd-11-stable/sys/boot/sparc64/loader/main.c
/freebsd-11-stable/sys/boot/uboot/lib/disk.c
/freebsd-11-stable/sys/boot/uboot/lib/net.c
/freebsd-11-stable/sys/boot/usb/storage/umass_loader.c
/freebsd-11-stable/sys/boot/userboot/userboot/main.c
/freebsd-11-stable/sys/boot/userboot/userboot/userboot_disk.c
/freebsd-11-stable/sys/boot/zfs/libzfs.h
/freebsd-11-stable/sys/boot/zfs/zfsimpl.c
329099 10-Feb-2018 kevans

MFC Loader Fixes 2017q1: r311458,r312237,r312314,r312374,r312947,r313042,
r313047,r313166,r313328,r313332,r313333,r313337,r313348,r313349,r313389,
r313442,r313451,r313575,r313645,r313710,r314114,r314213,r314275,r314945,
r314948,r315008,r315408,r315427,r315645,r315646,r315648,r315653,r315850,
r316064,r316078,r316079,r316100,r316104,r316111,r316112,r316171,r316279,
r316280,r316287,r316311,r316343,r316424,r316436

r311458: Use compiler driver to link BERI boot loaders

r312237: loader.efi: find_currdev() can leak memory

r312314: loader: move device path definitions to include/efidevp.h

r312374: loader: efi devpath api usage should be more aware of NULL pointers

r312947: Remove "-Xassembler -G0" from CFLAGS.

r313042: loader.efi environment related cleanups

r313047: loader: disk/part api needs to use uint64_t offsets

r313166: loader: libefi/env.c warnings in arm build

r313328: loader: Implement disk_ioctl() to support DIOCGSECTORSIZE and
DIOCGMEDIASIZE.

r313332: loader: bcache read ahead block count should take account the large
sectors

r313333: loader: Replace EFI part devices.

r313337: loader: 313329 missed ZFS guard in loader/main.c

r313348: loader: biosdisk fix for 2+TB disks

r313349: loader: disk io should not use alloca()

r313389: efipart is also using the '%S' printf format, add -Wno-format for
it.

r313442: loader: possible NULL pointer dereference in efipart.c

r313451: loader: possible NULL pointer dereference in bcache.c

r313575: makefs: make the buffer functions look exactly like the kernel ones

r313645: loader: implement MEDIA_FILEPATH_DP support in efipart

r313710: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t

r314114: Use LDFLAGS with CC instead of _LDFLAGS.

r314213: Remove control+r handling from geliboot's pwgets()

r314275: Remove unused macro from common/drv.c.

r314945: Some style(9) fixes. No functional changes.

r314948: Try to extract the RFC1048 data from PXE.

r315008: r314948 seems to be missing a variable or two that will break

r315408: loader: remove open_disk cache

r315427: loader: biosdisk should report IO error from INT13

r315645: loader: disk_cleanup was left in userboot_disk.c

r315646: loader: pxe.h constants have wrong values

r315648: libstand: verify value provided by nfs.read_size

r315653: loader: verify the value from dhcp.interface-mtu and use snprintf
o set mtu

r315850: The original author abused Nd (one-line description, used by
makewhatis)

r316064: Fix build with path names with 'align' or 'nop' in them.

r316078: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is
specified

r316079: Simply retire the sedification of the boot2.s file.

r316100: Remove -fno-guess-branch-probability and -fno-unit-at-a-time.

r316104: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align
in CFLAGS

r316111: loader: move bios getsecs into time.c

r316112: loader: ls command should display file types properly

r316171: xfsread inlined uses more space, so remove the inline tag.

r316279: loader: efipart should check disk size from partition table

r316280: loader: simplify efi_zfs_probe and avoid double probing for zfs.

r316287: Remove OLD_NFSV2 from loader and libstand

r316311: Add explicit_bzero() to libstand, and switch GELIBoot to using it

r316343: Implement boot-time encryption key passing (keybuf)

r316424: Fix sparc64 build broken by r316343 and r316076

r316436: Restore EFI boot environment functionality broken in r313333

PR: 216940 217298 217935


/freebsd-11-stable/lib/libstand/Makefile
/freebsd-11-stable/lib/libstand/bootp.c
/freebsd-11-stable/lib/libstand/bootp.h
/freebsd-11-stable/lib/libstand/nfs.c
/freebsd-11-stable/lib/libstand/nfsv2.h
/freebsd-11-stable/lib/libstand/stand.h
/freebsd-11-stable/sys/boot/common/bcache.c
/freebsd-11-stable/sys/boot/common/bootstrap.h
/freebsd-11-stable/sys/boot/common/dev_net.c
/freebsd-11-stable/sys/boot/common/disk.c
/freebsd-11-stable/sys/boot/common/disk.h
/freebsd-11-stable/sys/boot/common/ls.c
/freebsd-11-stable/sys/boot/common/part.c
/freebsd-11-stable/sys/boot/common/part.h
/freebsd-11-stable/sys/boot/efi/include/efidevp.h
/freebsd-11-stable/sys/boot/efi/include/efilib.h
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/devpath.c
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/efi/libefi/efipart.c
/freebsd-11-stable/sys/boot/efi/libefi/env.c
/freebsd-11-stable/sys/boot/efi/libefi/wchar.c
/freebsd-11-stable/sys/boot/efi/loader/conf.c
/freebsd-11-stable/sys/boot/efi/loader/devicename.c
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/forth/beastie.4th.8
/freebsd-11-stable/sys/boot/forth/loader.4th
/freebsd-11-stable/sys/boot/geli/Makefile
/freebsd-11-stable/sys/boot/geli/geliboot.c
/freebsd-11-stable/sys/boot/geli/geliboot.h
/freebsd-11-stable/sys/boot/geli/geliboot_crypto.c
/freebsd-11-stable/sys/boot/geli/geliboot_internal.h
/freebsd-11-stable/sys/boot/geli/pwgets.c
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/boot2.c
/freebsd-11-stable/sys/boot/i386/btx/lib/btxv86.h
/freebsd-11-stable/sys/boot/i386/common/bootargs.h
/freebsd-11-stable/sys/boot/i386/common/drv.c
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/gptboot.c
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/bioscd.c
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/bootinfo32.c
/freebsd-11-stable/sys/boot/i386/libi386/bootinfo64.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.h
/freebsd-11-stable/sys/boot/i386/libi386/time.c
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/i386/loader/main.c
/freebsd-11-stable/sys/boot/i386/zfsboot/zfsboot.c
/freebsd-11-stable/sys/boot/mips/beri/boot2/Makefile
/freebsd-11-stable/sys/boot/mips/beri/common/common.ldscript
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_cfi.c
/freebsd-11-stable/sys/boot/mips/beri/loader/beri_disk_sdcard.c
/freebsd-11-stable/sys/boot/mips/beri/loader/loader.ldscript
/freebsd-11-stable/sys/boot/sparc64/loader/Makefile
/freebsd-11-stable/sys/boot/uboot/lib/disk.c
/freebsd-11-stable/sys/boot/usb/storage/umass_loader.c
/freebsd-11-stable/sys/boot/userboot/userboot/userboot_disk.c
/freebsd-11-stable/sys/boot/zfs/libzfs.h
/freebsd-11-stable/sys/boot/zfs/zfs.c
/freebsd-11-stable/sys/crypto/intake.h
/freebsd-11-stable/sys/geom/eli/g_eli.c
/freebsd-11-stable/sys/geom/eli/g_eli.h
/freebsd-11-stable/sys/opencrypto/crypto.c
/freebsd-11-stable/sys/sys/linker.h
/freebsd-11-stable/usr.sbin/makefs/ffs.c
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.c
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.h
/freebsd-11-stable/usr.sbin/makefs/ffs/ffs_alloc.c
/freebsd-11-stable/usr.sbin/makefs/ffs/ffs_balloc.c
329011 08-Feb-2018 kevans

MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911,
r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534,
r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4

r307322: Remove /boot/boot.conf, deprecated for 16 years

r307323: Remove fetching of pInterp.

r307324: Create a new linker set, Xficl_compile_set which contains a list of
functions to call to register new forth words.

r307326: In UEFI mode expose the SMBIOS anchor base address via kenv

r307327: Update i386 build of loader.efi (but leave it disabled) so that we
at least build it now.

r307338: Create a pcibios-version environment FORTH word.

r307879: Preliminary support for EFI in boot loader.

r307908: Fix the build on both arm64 and when WITHOUT_FORTH is defined.

r307911: Add better comment...

r307942: Really make WITHOUT_FORTH (MK_FORTH==no) work.

r307950: Add it (Makefile.ficl) to the right place

r307951: Fix two backwards tests.

r307954: Back out the move to the loader script from -N.

r307955: LIBSTAND goes last, so put it last here too.

r308125: In loader.efi, instead of exiting directly, try to fallback.

r308195: efinet_dev_print should honor verbose option.

r308476: boot/forth spelling issue in forth word

r308534: The file_loadraw function grew an argument, update install function

r308535: Add support for LOADER_RC setting in the pkgfs manifes

r308776: loader: zfs toplevel vdev must have spa set.

r308843: loader: smbios version check is not correct

r310236: Renumber license clauses to avoid skipping #3

r310726: cdboot: add explict suffix to ambiguous or instruction

PR: 214375


/freebsd-11-stable/sys/boot/Makefile.ficl
/freebsd-11-stable/sys/boot/common/Makefile.inc
/freebsd-11-stable/sys/boot/common/bootstrap.h
/freebsd-11-stable/sys/boot/common/install.c
/freebsd-11-stable/sys/boot/common/interp.c
/freebsd-11-stable/sys/boot/common/interp_forth.c
/freebsd-11-stable/sys/boot/common/loader.8
/freebsd-11-stable/sys/boot/common/newvers.sh
/freebsd-11-stable/sys/boot/common/pnp.c
/freebsd-11-stable/sys/boot/efi/libefi/Makefile
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/efi/libefi/env.c
/freebsd-11-stable/sys/boot/efi/loader/Makefile
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/ldscript.amd64
/freebsd-11-stable/sys/boot/efi/loader/arch/arm/ldscript.arm
/freebsd-11-stable/sys/boot/efi/loader/arch/arm64/ldscript.arm64
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/efimd.c
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/elf32_freebsd.c
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/exec.c
/freebsd-11-stable/sys/boot/efi/loader/arch/i386/ldscript.i386
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/ficl/Makefile
/freebsd-11-stable/sys/boot/ficl/efi.c
/freebsd-11-stable/sys/boot/ficl/ficl.h
/freebsd-11-stable/sys/boot/ficl/i386/sysdep.c
/freebsd-11-stable/sys/boot/ficl/loader.c
/freebsd-11-stable/sys/boot/ficl32/Makefile
/freebsd-11-stable/sys/boot/forth/Makefile.inc
/freebsd-11-stable/sys/boot/forth/efi.4th
/freebsd-11-stable/sys/boot/forth/loader.4th
/freebsd-11-stable/sys/boot/forth/support.4th
/freebsd-11-stable/sys/boot/i386/Makefile.inc
/freebsd-11-stable/sys/boot/i386/cdboot/cdboot.S
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/biospci.c
/freebsd-11-stable/sys/boot/i386/libi386/libi386.h
/freebsd-11-stable/sys/boot/i386/libi386/smbios.c
/freebsd-11-stable/sys/boot/i386/loader/Makefile
/freebsd-11-stable/sys/boot/mips/beri/loader/loader.ldscript
/freebsd-11-stable/sys/boot/pc98/libpc98/Makefile
/freebsd-11-stable/sys/boot/zfs/zfsimpl.c
/freebsd-11-stable/targets/pseudo/userland/misc/Makefile.depend
329010 08-Feb-2018 kevans

MFC r303555,r303556,r303936,r303962,r304317,r304532,r305026,r305107,r305132,
r305178,r305353,r305814,r306159,r306380,r306504: Loader fixes, 2016q3

r303555: bcache should support reads shorter than sector size

r303556: Improve boot loader quote parsing

r303936: Add kernel environment variables under smbios.system

r303962: Add the missing space between .asciz directive and opening quote
for some lines with #ifdef BTXLDR_VERBOSE/#endif

r304317: boot1.efi Free() should check for NULL to provide consistent
behavior

r304532: Replace sprintf -> snprintf for command_errbuf provisioned from
dynamic content.

r305026: Emulate efi_cons_poll when WaitForKey is not available

r305107: Create a hook 'post-initialize' for people that want to define
something to read in .conf files after all other .conf files for the purpose
of overriding.

r305132: Remove accidentally committed stray comment.

r305178: bd_int13probe() should check extended info if sector info is bad

r305353: Don't use -N to set the OMAGIC with data and text writeable and
data not page aligned.

r305814: ufsread: Do not cast struct direct from void *

r306159: Consistently declare getsecs(void) with proper return type and void
when no arguments are present.

r306380: loader command interpreter should reset command_errmsg

r306504: Fix a cluster of bugs in list EFI environment variables

PR: 204602, 211958, 211958
Relnotes: yes ("Improve boot loader quote parsing")


/freebsd-11-stable/sys/boot/common/bcache.c
/freebsd-11-stable/sys/boot/common/boot.c
/freebsd-11-stable/sys/boot/common/bootstrap.h
/freebsd-11-stable/sys/boot/common/commands.c
/freebsd-11-stable/sys/boot/common/interp.c
/freebsd-11-stable/sys/boot/common/interp_forth.c
/freebsd-11-stable/sys/boot/common/interp_parse.c
/freebsd-11-stable/sys/boot/common/ls.c
/freebsd-11-stable/sys/boot/common/module.c
/freebsd-11-stable/sys/boot/common/ufsread.c
/freebsd-11-stable/sys/boot/efi/boot1/boot1.c
/freebsd-11-stable/sys/boot/efi/libefi/efi_console.c
/freebsd-11-stable/sys/boot/efi/libefi/time.c
/freebsd-11-stable/sys/boot/efi/libefi/time_event.c
/freebsd-11-stable/sys/boot/efi/loader/arch/amd64/framebuffer.c
/freebsd-11-stable/sys/boot/efi/loader/main.c
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/forth/loader.4th
/freebsd-11-stable/sys/boot/i386/Makefile.inc
/freebsd-11-stable/sys/boot/i386/boot.ldscript
/freebsd-11-stable/sys/boot/i386/boot0/Makefile
/freebsd-11-stable/sys/boot/i386/boot2/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btx/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/i386/btx/btxldr/btxldr.S
/freebsd-11-stable/sys/boot/i386/cdboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptboot/Makefile
/freebsd-11-stable/sys/boot/i386/gptzfsboot/Makefile
/freebsd-11-stable/sys/boot/i386/libi386/biosdisk.c
/freebsd-11-stable/sys/boot/i386/libi386/pxe.c
/freebsd-11-stable/sys/boot/i386/libi386/smbios.c
/freebsd-11-stable/sys/boot/i386/mbr/Makefile
/freebsd-11-stable/sys/boot/i386/pmbr/Makefile
/freebsd-11-stable/sys/boot/i386/pxeldr/Makefile
/freebsd-11-stable/sys/boot/i386/zfsboot/Makefile
/freebsd-11-stable/sys/boot/ofw/libofw/ofw_time.c
/freebsd-11-stable/sys/boot/pc98/Makefile.inc
/freebsd-11-stable/sys/boot/pc98/boot0/Makefile
/freebsd-11-stable/sys/boot/pc98/boot2/Makefile
/freebsd-11-stable/sys/boot/pc98/btx/btx/Makefile
/freebsd-11-stable/sys/boot/pc98/btx/btxldr/Makefile
/freebsd-11-stable/sys/boot/pc98/cdboot/Makefile
/freebsd-11-stable/sys/boot/powerpc/kboot/main.c
/freebsd-11-stable/sys/boot/powerpc/ps3/main.c
/freebsd-11-stable/sys/boot/uboot/lib/time.c
328889 05-Feb-2018 kevans

MFC r308434, 308827

MFC r308434: Loader paged/pageable data is not always paged.
MFC r308827: lsdev device name section headers should be printed by dv_print
callback.

328125 18-Jan-2018 kib

MFC r327822:
Skip IRELATIVE relocations when loader processes ELF files.

326431 01-Dec-2017 emaste

MFC r324703: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined

We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.

Reported by: Zakary Nafziger
Sponsored by: The FreeBSD Foundation

323050 31-Aug-2017 oleg

MFC r322628: Fix BSD label partition end sector calculation.

Differential Revision: https://reviews.freebsd.org/D12066

321264 20-Jul-2017 ngie

MFC r316102:

Wrap bootcamp DEBUG statement with curly braces

This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined.

Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)

321232 19-Jul-2017 ngie

MFC r316076:

sys/boot/common: Make geli(4) support optional in MI sources

This saves a negligible amount of memory for non-geli enabled
bootloaders.

318019 09-May-2017 royger

MFC r316754: loader/multiboot: fix multiboot loading

Sponsored by: Citrix Systems R&D

316318 31-Mar-2017 ngie

MFC r316108:

Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)`

This variable has been unused since its inception in r40106.

315221 14-Mar-2017 pfg

MFC r313982, r314068:
sys: Replace zero with NULL for pointers.

Found with: devel/coccinelle


/freebsd-11-stable/sys/amd64/amd64/db_disasm.c
/freebsd-11-stable/sys/amd64/amd64/pmap.c
/freebsd-11-stable/sys/boot/common/md.c
/freebsd-11-stable/sys/boot/efi/libefi/efinet.c
/freebsd-11-stable/sys/boot/fdt/fdt_overlay.c
/freebsd-11-stable/sys/boot/ficl/ficl.c
/freebsd-11-stable/sys/boot/kshim/bsd_kernel.c
/freebsd-11-stable/sys/boot/ofw/libofw/ofw_memory.c
/freebsd-11-stable/sys/boot/sparc64/loader/main.c
/freebsd-11-stable/sys/boot/userboot/userboot/userboot_disk.c
/freebsd-11-stable/sys/boot/zfs/zfs.c
/freebsd-11-stable/sys/boot/zfs/zfsimpl.c
/freebsd-11-stable/sys/dev/agp/agp.c
/freebsd-11-stable/sys/dev/an/if_an.c
/freebsd-11-stable/sys/dev/arcmsr/arcmsr.c
/freebsd-11-stable/sys/dev/bce/if_bce.c
/freebsd-11-stable/sys/dev/beri/virtio/virtio_block.c
/freebsd-11-stable/sys/dev/buslogic/bt_pci.c
/freebsd-11-stable/sys/dev/ce/if_ce.c
/freebsd-11-stable/sys/dev/cm/smc90cx6.c
/freebsd-11-stable/sys/dev/cp/if_cp.c
/freebsd-11-stable/sys/dev/ctau/ctddk.c
/freebsd-11-stable/sys/dev/ctau/if_ct.c
/freebsd-11-stable/sys/dev/cx/cxddk.c
/freebsd-11-stable/sys/dev/cx/if_cx.c
/freebsd-11-stable/sys/dev/de/if_de.c
/freebsd-11-stable/sys/dev/ed/if_ed.c
/freebsd-11-stable/sys/dev/fatm/if_fatm.c
/freebsd-11-stable/sys/dev/fe/if_fe.c
/freebsd-11-stable/sys/dev/firewire/if_fwip.c
/freebsd-11-stable/sys/dev/hptiop/hptiop.c
/freebsd-11-stable/sys/dev/hptmv/entry.c
/freebsd-11-stable/sys/dev/hptmv/gui_lib.c
/freebsd-11-stable/sys/dev/hptmv/hptproc.c
/freebsd-11-stable/sys/dev/hptmv/ioctl.c
/freebsd-11-stable/sys/dev/iicbus/if_ic.c
/freebsd-11-stable/sys/dev/isp/isp_pci.c
/freebsd-11-stable/sys/dev/le/am7990.c
/freebsd-11-stable/sys/dev/le/am79900.c
/freebsd-11-stable/sys/dev/le/lance.c
/freebsd-11-stable/sys/dev/md/md.c
/freebsd-11-stable/sys/dev/ncr/ncr.c
/freebsd-11-stable/sys/dev/ofw/ofw_bus_subr.c
/freebsd-11-stable/sys/dev/patm/if_patm_tx.c
/freebsd-11-stable/sys/dev/pccard/pccard.c
/freebsd-11-stable/sys/dev/pms/RefTisa/sallsdk/spc/sainit.c
/freebsd-11-stable/sys/dev/pms/RefTisa/tisa/sassata/common/tdioctl.c
/freebsd-11-stable/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
/freebsd-11-stable/sys/dev/ppbus/if_plip.c
/freebsd-11-stable/sys/dev/ppbus/ppbconf.c
/freebsd-11-stable/sys/dev/ppc/ppc.c
/freebsd-11-stable/sys/dev/sbni/if_sbni_isa.c
/freebsd-11-stable/sys/dev/sn/if_sn.c
/freebsd-11-stable/sys/dev/sym/sym_hipd.c
/freebsd-11-stable/sys/dev/vx/if_vx.c
/freebsd-11-stable/sys/libkern/iconv_xlat16.c
/freebsd-11-stable/sys/net/if_fddisubr.c
/freebsd-11-stable/sys/net/if_iso88025subr.c
/freebsd-11-stable/sys/net/iflib.c
/freebsd-11-stable/sys/netpfil/ipfw/ip_fw_sockopt.c
313355 06-Feb-2017 tsoome

MFC r309369,310850,310853:

libstand: dosfs cstyle cleanup for return keyword.
dosfs support in libstand is broken since r298230

PR: 214423
Submitted by: Mikhail Kupchik
Reported by: Mikhail Kupchik
Approved by: imp (mentor)

312771 25-Jan-2017 dim

MFC r311929:

Don't include <errno.h> in reloc_elf.c, as it includes <stand.h> just
after it, which has a conflicting definition of errno. This leads to
the following warning with clang 4.0.0:

In file included from sys/boot/common/reloc_elf32.c:6:
In file included from sys/boot/common/reloc_elf.c:37:
/usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
extern int errno;
^
sys/sys/errno.h:46:26: note: expanded from macro 'errno'
#define errno (* __error())
^

312730 25-Jan-2017 emaste

Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob

MFC r310128: Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel
metadata

The kernel builds reproducibly, except for the time, date, user, and
hostname baked into the kernel (reported at startup and via the
kern.version sysctl for uname). Add a build knob to disable the
inclusion of this metadata.

MFC r310268: Build loaders reproducibly when WITH_REPRODUCIBLE_BUILD

When WITH_REPRODUCIBLE_BUILD=yes is set in src.conf(5), eliminate the
time, user, and host from the loader's version information. This allows
builds to produce bit-for-bit identical output.

312556 20-Jan-2017 emaste

MFC r310267: Deduplicate loader vers.c Makefile rules

The Makefile rule to create vers.c for loader version info was
previously duplicated in each of the various loader Makefiles.
Instead, share a common rule in Makefile.inc.

Sponsored by: The FreeBSD Foundation

312318 17-Jan-2017 emaste

MFC r310225: Reduce boot loader version string duplication

Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just
create the full version string in vers.c

310725 28-Dec-2016 emaste

Fix EFI self relocation code for rela architectures

MFC r306812 (andrew):

The bootloader self relocation code was slightly wrong for the
R_AARCH64_RELATIVE relocation found on arm64. It would try to add the
contents of the memory location being relocated to the base address and
the relocation addend. This worked when the contents was zero, however
this now seems to be set to the value of the addend so we add this twice.
Fix this by just setting the memory to the computed value.

MFC r309360: EFI loaders: parse rela relocations on amd64

Prior to this change the loader self relocation code interpreted amd64's
rela relocations as if they were rel relocations, discarding the addend.
This "works" because GNU ld 2.17.50 stores the addend value in both the
r_addend field of the relocation (as expected) and at the target of the
relocation.

Other linkers, and possibly other versions of GNU ld, won't have this
behaviour, so interpret the relocations correctly.

308719 16-Nov-2016 bapt

MFC r307238:

Stop closing the network device when netbooting for loaders using the common
dev_net.c code.

The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
on some architectures (sparc64 and powerpc64) the default was left to always
open and close the device for each open and close of a file by the loader
because it was necessary for u-boot on arm.

Since it has been added, the flag was turned on for every arches including the
u-boot loader for arm.

This also fixes netbooting on RPi3 (tested by gonzo@)

For the loader.efi it greatly speeds up netbooting

Reviewed by: emaste, gonzo, tsoome
Approved by: gonzo
MFC after: 1 month
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8230

307632 19-Oct-2016 bapt

MFC: 304677, 304680, 305125, 305770, 305769

r304677:
Add tftpfs support for the EFI loader

Allow netbooting on efi without having to setup any NFS server by rebuilding the
loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader

r305125:
Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi

Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Relnotes: yes
Sponsored by: Gandi.net

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
300156 18-May-2016 imp

Fix typo.

Spotted by: Matteo Riondato


300146 18-May-2016 imp

Also add comment about the bug I comments in the forth.


300117 18-May-2016 imp

Fix several instances where the boot loader ignored pager_output
return value when it could return 1 (indicating we should stop).
Fix a few instances of pager_open() / pager_close() not being called.
Actually use these routines for the environment variable printing code
I just committed.


300056 17-May-2016 imp

It sure would be nice to use printf with wide strings. Implement %S to
do that. The C_WIDEOUT flag indicates that the console supports
it. Mark the EFI console as supporting this.

MFC After: 3 days


299499 12-May-2016 pfg

sys/boot/common: use of spaces vs. TAB.

No functional change.


298900 01-May-2016 allanjude

bcache read ahead may attempt to read past end of disk

The new bcache code does not know the size of the disk, and therefore may attempt to read past the end of the disk while trying to fill its read-ahead cache.

This is usually not an issue, it fails gracefully on all of my machines, but some BIOSes seem to retry the reads for up to 30 seconds each, resulting in a long stall during boot

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: jhb, np
Differential Revision: https://reviews.freebsd.org/D6109


298645 26-Apr-2016 pfg

sys/boot: make use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.


298433 21-Apr-2016 pfg

sys: use our roundup2/rounddown2() macros when param.h is available.

rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.


298309 19-Apr-2016 pfg

sys/boot: use our nitems() macro when it is available through param.h.

No functional change, only trivial cases are done in this sweep,

Discussed in: freebsd-current


298230 18-Apr-2016 allanjude

A new implementation of the loader block cache

The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy.
Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks.
Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device.
The cache also implements limited read-ahead to increase performance.
To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache.

Booting from a virtual CD over IPMI:
0ms latency, before: 27 second, after: 7 seconds
60ms latency, before: over 12 minutes, after: under 5 minutes.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: delphij (previous version), emaste (previous version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D4713


297793 10-Apr-2016 pfg

Cleanup unnecessary semicolons from the kernel.

Found with devel/coccinelle.


297702 08-Apr-2016 kib

Use the ABI-prescribed name for SHT_X86_64_UNWIND in the loader and
kernel linker, after the r297686.

Sponsored by: The FreeBSD Foundation


297151 21-Mar-2016 ian

If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.


296963 16-Mar-2016 allanjude

Implement GELI (AES-XTS and AES-CBC only) in gptboot and gptzfsboot

Allows booting from a GELI encrypted root file system, via UFS or ZFS

Reviewed by: gnn, smh (previous version), delphij (previous version)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4593


296428 06-Mar-2016 dim

Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images.
Otherwise the kernel can still panic when it doesn't find the .eh_frame
section belonging to the .rela.eh_frame section.

Unfortunately this will require installing boot loaders from sys/boot
before attempting to boot with a new kernel.

Reviewed by: kib
MFC after: 2 weeks
X-MFC-With: r296419


296378 04-Mar-2016 sgalabov

Fix ubldr build failure on mipsn32 and mipsn32el targets.

Approved by: adrian (mentor)


296186 29-Feb-2016 sgalabov

Fix build failure introduced by r296182

Approved by: adrian (mentor)


296182 29-Feb-2016 sgalabov

These changes attempt to put things in order before the introduction of MIPS
ubldr.

The changes are mostly dealing with removing unnecessary casts from the U-Boot
API (we're passing only pointers, no obvious reason to cast them to uint32_t),
cleaning up some compiler warnings and using the proper printf format
specifiers in order to be able to compile cleanly for both 32-bit and 64-bit
MIPS targets.

Reviewed by: imp
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5312


295429 09-Feb-2016 andrew

Don't set the offset when loading the kernel on the arm loader.efi. The
copyin and copyout code handle virtual addresses such that they will take
a virtual address and convert it into a valid physical address. It may
also mean we fail to boot as the elf files load address could be 0.

Sponsored by: ABT Systems Ltd


295356 06-Feb-2016 smh

Fix EFI platform build failures

With warnings now enabled some plaforms where failing due to warnings.
* Fix st_size printed as a size_t when its actually an off_t.
* Fix pointer conversion in load_elf for some 32bit platforms due to 64bit
off in ef.

MFC after: 2 days
X-MFC-With:
Sponsored by: Multiplay


294925 27-Jan-2016 imp

Fix mistake when transitioning to the new defines with ZFS loader. I
hate adding yet another define, but it is the lessor of the evil
choices available. Kill another evil by removing PATH_BOOT3 and
replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate.

PR: 206659


294766 26-Jan-2016 imp

RBX_ defines are in rbx.h, move it there.

Differential Revision: https://reviews.freebsd.org/D5038


294765 26-Jan-2016 imp

Move all the separate copies of the same strings into paths.h. There's
nothing machine specific about these.

Differential Revision: https://reviews.freebsd.org/D5038


294506 21-Jan-2016 smh

Prevent loader.conf load failure due to unknown console entries

When processing loader.conf if console contained an entry for an unsupported
console then cons_set would return an error refusing to set any console.

This has two side effects:

1. Forth would throw a syntax error and stop processing loader.conf at that
point.
2. The value of console is ignored.

#1 Means other important loader.conf entries may not be processed, which is
clearly undesirable.
#2 Means the users preference for console aren't applied even if they did
contain valid options. Now we have support for multi boot paths from a
single image e.g. bios and efi mode the console preference needs to deal
with the need to set preference for more than one source.

Fix this by:
* Returning CMD_OK where possible from cons_set.
* Allowing set with at least one valid console to proceed.

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5018


294493 21-Jan-2016 smh

Fix EFI UFS caching

EFI was mixing caching in two separate places causing issues when multiple
partitions where tested.

Eliminate this by removing fsstat and re-factoring fsread into fsread_size,
adding basic parameter validation.

Also:
* Enhance some error print outs.
* Fix compilation under UFS1_ONLY and UFS2_ONLY
* Use sizeof on vars instead of structs.
* Add basic parameter validation to fsread_size.

MFC after: 1 week
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4989


294059 15-Jan-2016 smh

Ensure boot fsread correctly probes all partitions

The boot code fsread was caching the result of meta data request and
reusing it even for calls with inode = 0, which is used to partitions
trigger a probe.

The result was that success was incorrectly returned for all partition
probes after the first valid success, even for partitions which are not
UFS.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


294058 15-Jan-2016 smh

Make common boot file_loadraw name parameter const

Fix compiler warnings about dropping const qualifier by changing file_loadraw
name param to const, and updating method to make that the case (it was
abusing the variable).

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


293835 13-Jan-2016 smh

Improve non-interactive forth cmd error reporting

Non-interactive forth command errors where silent even for critical issues
e.g. failing to load a required kernel module or mfs_root.

This resulted in later unexplained and hard to trace errors such as mount
root failures.

This introduces additional command return codes that are treated
appropriately by the non-interactive command processor (bf_command).
* CMD_CRIT = print error
* CMD_FATAL = panic

Also fix minor style(9) issues with command_load return codes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


293724 12-Jan-2016 smh

Enable warnings in EFI boot code

Set WARNS if not set for EFI boot code and fix the issues highlighted by
setting it.

Most components are set to WARNS level 6 with few being left at lower
levels due to the amount of changes needed to fix at higher levels.

Error types fixed:
* Missing / invalid casts
* Missing inner structs
* Unused vars
* Missing static for internal only funcs
* Missing prototypes
* Alignment changes
* Use of uninitialised vars
* Unknown pragma (intrinsic)
* Missing types etc due to missing includes
* printf formatting types

Reviewed by: emaste (in part)
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4839


293461 09-Jan-2016 smh

Remove hidden "Not ufs" printfs from boot code

Remove the printf("Not ufs\n") from the boot code which was hidden by the
local printf implementations, allowing these to have that code removed too.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay


292057 10-Dec-2015 ae

Make detection of GPT a bit more reliable.

When we are detecting a partition table and didn't find PMBR, try to
read backup GPT header from the last sector and if it is correct,
assume that we have GPT.

Reviewed by: rpokala
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D4282


291563 01-Dec-2015 bdrewery

META MODE: Update dependencies with 'the-lot' and add missing directories.

This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so. A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package. The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by: EMC / Isilon Storage Division


291402 27-Nov-2015 zbb

Implement simple ops for umass_disk

The initial IOCTL implementation supports reading disk physical
geometry.
Two additional functions were added. They allow reading/writing raw
data to the disk (default partition).

Submitted by: Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by: Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4143


291012 18-Nov-2015 smh

Document loader(8) dumpdev option

Add an entry for dumpdev environment variable to loader(8).

MFC after: 1 week
Sponsored by: Multiplay


289896 24-Oct-2015 ngie

Make vers.c creation atomic by using a temporary file, then moving
the temporary file to vers.c at the end of the script

The previous logic wrote out to vers.c multiple times, so the file
could be incorrectly interpreted as being completely written out
after one of the echo calls with recursive make, when in reality it
was only partially written.

Also, in the event the build was interrupted when creating vers.c
(small race window), it would have a leftover file that needed to
be cleaned up before resuming the build.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division


286234 03-Aug-2015 trasz

Fix a problem which made loader(8) load non-kld files twice.

For example, without this patch, the following three lines
in /boot/loader.conf would result in /boot/root.img being preloaded
twice, and two md(4) devices - md0 and md1 - being created.

initmd_load="YES"
initmd_type="md_image"
initmd_name="/boot/root.img"

Reviewed by: marcel@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3204


285870 25-Jul-2015 trasz

Document md_root in loader(8). The md(4) manual page mentions it,
but it's hard to find and easy to miss.

Reviewed by: wblock@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3183


284590 19-Jun-2015 bapt

Install loader(8) and zfsloader(8) only once

Differential Revision: https://reviews.freebsd.org/D2841
Reviewed by: imp


283062 18-May-2015 ian

Refactor net_getparams() to make it easier to get params from sources other
than bootp and rarp.

The code which splits a serverip:/rootpath string into rootip and a plain
pathname is now a separate net_parse_rootpath() function that can be
called by others. The code that sets the kernel env vars needed for
nfs_diskless is moved into net_open() so that the variables get set no
matter where the params came from.

There was already code in net_open() that allowed for the possibility that
some other entity has set up the network-related global variables. It uses
the rootip variable as the key, assuming that if it is set all the other
required variables are set too. These changes don't alter the existing
behavior, they just make it easier to actually write some new code to get
the params from another source (such as the U-Boot environment).


283035 17-May-2015 ian

An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.

Previously, ubldr would use the virtual addresses in the elf headers by
masking off the high bits and assuming the result was a physical address
where the kernel should be loaded. That would sometimes discard
significant bits of the physical address, but the effects of that were
undone by archsw copy code that would find a large block of memory and
apply an offset to the source/dest copy addresses. The result was that
things were loaded at a different physical address than requested by the
higher code layers, but that worked because other adjustments were applied
later (such as when jumping to the entry point). Very confusing, and
somewhat fragile.

Now the archsw copy routines are just simple copies, and instead
archsw.arch_loadaddr is implemented to choose a load address. The new
routine uses some of the code from the old offset-translation routine to
find the largest block of ram, but it excludes ubldr itself from that
range, and also excludes If ubldr splits the largest block of ram in
two, the kernel is loaded into the bottom of whichever resulting block is
larger.

As part of eliminating ubldr itself from the ram ranges, export the heap
start/end addresses in a pair of new global variables.

This change means that the virtual addresses in the arm kernel elf headers
now have no meaning at all, except for the entry point address. There is
an implicit assumption that the entry point is in the first text page, and
that the address in the the header can be turned into an offset by masking
it with PAGE_MASK. In the future we can link all arm kernels at a virtual
address of 0xC0000000 with no need to use any low-order part of the
address to influence where in ram the kernel gets loaded.


282727 10-May-2015 ian

The self-relocation code is not efi-specific, move it to boot/common.

The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision: https://reviews.freebsd.org/D2490


282064 27-Apr-2015 scottl

Small change in header order to allow this to compile.

Obtained from: Netflix, Inc.
MFC after: 3 days


281526 14-Apr-2015 andrew

Add support for arm64 to loader.efi and boot1.efi

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation


281081 04-Apr-2015 bapt

Make sure forth manpages are only installed once.

Differential Revision: https://reviews.freebsd.org/D2224
Reviewed by: imp


277988 31-Jan-2015 nwhitehorn

Add code to support loading relocatable kernels at offsets that are not
zero.


277962 31-Jan-2015 nwhitehorn

Add support for booting relocatable kernels on PowerPC.


277291 17-Jan-2015 royger

loader: use correct types for parse_modmetadata

Use the proper types in parse_modmetadata for the p_start and p_end
parameters. This was causing problems in the ARM 32bit loader.

Sponsored by: Citrix Systems R&D
Reported and Tested by: ian


277215 15-Jan-2015 royger

loader: implement multiboot support for Xen Dom0

Implement a subset of the multiboot specification in order to boot Xen
and a FreeBSD Dom0 from the FreeBSD bootloader. This multiboot
implementation is tailored to boot Xen and FreeBSD Dom0, and it will
most surely fail to boot any other multiboot compilant kernel.

In order to detect and boot the Xen microkernel, two new file formats
are added to the bootloader, multiboot and multiboot_obj. Multiboot
support must be tested before regular ELF support, since Xen is a
multiboot kernel that also uses ELF. After a multiboot kernel is
detected, all the other loaded kernels/modules are parsed by the
multiboot_obj format.

The layout of the loaded objects in memory is the following; first the
Xen kernel is loaded as a 32bit ELF into memory (Xen will switch to
long mode by itself), after that the FreeBSD kernel is loaded as a RAW
file (Xen will parse and load it using it's internal ELF loader), and
finally the metadata and the modules are loaded using the native
FreeBSD way. After everything is loaded we jump into Xen's entry point
using a small trampoline. The order of the multiboot modules passed to
Xen is the following, the first module is the RAW FreeBSD kernel, and
the second module is the metadata and the FreeBSD modules.

Since Xen will relocate the memory position of the second
multiboot module (the one that contains the metadata and native
FreeBSD modules), we need to stash the original modulep address inside
of the metadata itself in order to recalculate its position once
booted. This also means the metadata must come before the loaded
modules, so after loading the FreeBSD kernel a portion of memory is
reserved in order to place the metadata before booting.

In order to tell the loader to boot Xen and then the FreeBSD kernel the
following has to be added to the /boot/loader.conf file:

xen_cmdline="dom0_mem=1024M dom0_max_vcpus=2 dom0pvh=1 console=com1,vga"
xen_kernel="/boot/xen"

The first argument contains the command line that will be passed to the Xen
kernel, while the second argument is the path to the Xen kernel itself. This
can also be done manually from the loader command line, by for example
typing the following set of commands:

OK unload
OK load /boot/xen dom0_mem=1024M dom0_max_vcpus=2 dom0pvh=1 console=com1,vga
OK load kernel
OK load zfs
OK load if_tap
OK load ...
OK boot

Sponsored by: Citrix Systems R&D
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D517

For the Forth bits:
Submitted by: Julien Grall <julien.grall AT citrix.com>


277205 15-Jan-2015 imp

Reserve and ignore the a new module metadata type MDT_PNP_INFO for
associating an optional PNP hint table with this module. In the
future, when these are added, these changes will silently ignore the
new type they would otherwise warn about. It will always be safe to
ignore this data. Get this into the builds today for some future
proofing.

MFC After: 3 days


276360 29-Dec-2014 joel

mdoc: remove EOL whitespace.


276306 27-Dec-2014 ian

Use the proper markup for single quotes.


276087 22-Dec-2014 ian

Add a new loader(8) variable, twiddle_divisor, allowing control over the
output frequency of the "twiddle" IO progress indicator. The default
value is 1. For larger values N, the next stage of the animation is only
output on every Nth call to the output routine. A sufficiently large N
effectively disables the animation completely.


275261 29-Nov-2014 imp

The current limit of 100k for the linker hints file is getting a bit
crowded as we now are at about 70k. Bump the limit to 1MB instead
which is still quite a reasonable limit and allows for future growth
of this file and possible future expansion to additional data.

MFC After: 2 weeks


274925 23-Nov-2014 joel

Misc mdoc fixes:

- Remove superfluous paragraph macros.
- Remove/fix empty or incorrect macros.
- Sort sections into conventional order.
- Terminate quoted strings properly.
- Remove EOL whitespace.


274407 11-Nov-2014 grehan

Fix incorrect reading of 32-bit modinfo by 64-bit loaders.

The various structures in the mod_metadata set of a FreeBSD kernel and
modules contain pointers. The FreeBSD loader correctly deals with a
mismatch in loader and kernel pointer size (e.g. 32-bit i386/ppc
loader, loading 64-bit amd64/ppc64 kernels), but wasn't dealing with
the inverse case where a 64-bit loader was loading a 32-bit kernel.

Reported by: ktcallbox@gmail.com with a bhyve/i386 and ZFS root install
Differential Revision: https://reviews.freebsd.org/D1129
Reviewed by: neel, jhb
MFC after: 1 week


274127 05-Nov-2014 marcel

In alloc_pread() and kern_pread(), print errors only when DEBUG is
defined. An error is not fatal and is supposed to be handled by the
caller.

Obtained from: Juniper Networks, Inc.


273940 01-Nov-2014 marcel

Change the order of the arguments to file_loadraw(). They were swapped
as of r262345 when file_loadraw() was made public and this little detail
got overlooked during porting.

Obtained from: Juniper Networks, Inc.


273334 20-Oct-2014 marcel

Fully support constructors for the purpose of code coverage analysis.
This involves:
1. Have the loader pass the start and size of the .ctors section to the
kernel in 2 new metadata elements.
2. Have the linker backends look for and record the start and size of
the .ctors section in dynamically loaded modules.
3. Have the linker backends call the constructors as part of the final
work of initializing preloaded or dynamically loaded modules.

Note that LLVM appends the priority of the constructors to the name of
the .ctors section. Not so when compiling with GCC. The code currently
works for GCC and not for LLVM.

Submitted by: Dmitry Mikulin <dmitrym@juniper.net>
Obtained from: Juniper Networks, Inc.


272749 08-Oct-2014 ae

Fix comment.

MFC after: 1 week


272557 05-Oct-2014 ae

Rework bootparttest to use more code from sys/boot.
Use disk_open() call to emulate loader behavior.


272556 05-Oct-2014 ae

Add a bit more debug messages.


272487 03-Oct-2014 ae

Add GUID of FreeBSD slice to GPT scheme.

MFC after: 1 week


271609 15-Sep-2014 avg

add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages

Many thanks to Warren Block for his reviews, corrections and additions.

Reviewed by: Warren Block <wblock@FreeBSD.org>
MFC after: 1 week


271054 03-Sep-2014 ian

When built with FDT support, add /boot/dtb to the list of search directories.


270521 25-Aug-2014 ae

Since the size of GPT entry may differ from the sizeof(struct gpt_ent),
use the size from GPT header to iterate entries.

Suggested by: marcel@
MFC after: 1 week


270445 24-Aug-2014 ae

The size of the GPT table can not be less than one sector.

Reported by: rodrigc@
MFC after: 1 week


269621 06-Aug-2014 marcel

Optionally include the install command as found on Juniper products
like EX and SRX. The install command uses pkgfs to extract a kernel,
zero or more modules and a root file system from the specified package
and boots the kernel. The name of the kernel, the list of modules and
the name of the root file system can be specified by putting a
file called "metatags in the package.

The package to use is given by an URL. The schemes supported are
tftp and file. For the file scheme, the disk is currently hardcoded
but that should really look for the package on all devices and
partititions.

Obtained from: Juniper Networks, Inc.


269618 06-Aug-2014 marcel

Rename command_unload() to unload() and re-implement command_unload()
in terms of unload() This allows unloading all files by the loader
itself.

Obtained from: Juniper Networks, Inc.


269616 06-Aug-2014 marcel

In command_lsmod() prevent overrunning lbuf due to long path
names. Call pager_output() separately for the module name.

Obtained from: Juniper Networks, Inc.


269614 05-Aug-2014 marcel

In file_loadraw() print the name of the file as well as its size
so that we know what file is being loaded and how big the file
is once complete. This has ELF modules and disk images emit the
same output.


269153 27-Jul-2014 marcel

Give loaders more control over the Forth initialization process. In
particular, allow loaders to define the name of the RC script the
interpreter needs to use. Use this new-found control to have the
PXE loader (when compiled with TFTP support and not NFS support)
read from ${bootfile}.4th, where ${bootfile} is the name of the
file fetched by the PXE firmware.

The normal startup process involves reading the following files:
1. /boot/boot.4th
2. /boot/loader.rc or alternatively /boot/boot.conf

When these come from a FreeBSD-defined file system, this is all
good. But when we boot over the network, subdirectories and fixed
file names are often painful to administrators and there's really
no way for them to change the behaviour of the loader.

Obtained from: Juniper Networks, Inc.


268351 07-Jul-2014 marcel

Remove ia64.

This includes:
o All directories named *ia64*
o All files named *ia64*
o All ia64-specific code guarded by __ia64__
o All ia64-specific makefile logic
o Mention of ia64 in comments and documentation

This excludes:
o Everything under contrib/
o Everything under crypto/
o sys/xen/interface
o sys/sys/elf_common.h

Discussed at: BSDcan


264414 13-Apr-2014 nwhitehorn

Apparently some of the i386 boot blocks are so close to full that adding
single lines to ufsread.c spills them over. Duplicate a whole bunch of
code to get file sizes into boot1.efi/boot1.c rather than modifying
ufsread.c.


264391 13-Apr-2014 nwhitehorn

Add a simple EFI stub loader. This is a quick and dirty of boot1.chrp from
the PowerPC port with all the Open Firmware bits removed and replaced by
their EFI counterparts. On the whole, I think I prefer Open Firmware.

This code is supposed to be an immutable shim that sits on the EFI system
partition, loads /boot/loader.efi from UFS and tells the real loader what
disk/partition to look at. It finds the UFS root partition by the somewhat
braindead approach of picking the first UFS partition it can find. Better
approaches are called for, but this works for now. This shim loader will
also be useful for secure boot in the future, which will require some
rearchitecture.


263468 21-Mar-2014 ae

When loader(8) inspects MBR, it chooses GPT as main partition table,
when MBR contains only PMBR entry or it is bootcamp-compatible.
If MBR has PMBR entry and some other, the loader rejects it.

Make these checks to be less strict. If loader decided that PMBR
isn't suitable for GPT, it will use MBR.

Reported by: Paul Thornton
Tested by: Paul Thornton
MFC after: 1 week


262452 24-Feb-2014 rwatson

Build 64-bit ELF support into little-endian 64-bit MIPS boot-loader
fragments; while this won't actually be used for anything (yet), it
doesn't hurt to ensure it is exposed to the tinderbox.

Requested by: imp, jmallett
MFC after: 3 weeks


262403 23-Feb-2014 rwatson

On mips64, built 64-bit ELF support.

MFC after: 3 weeks
Sponsored by: DARPA, AFRL


262345 22-Feb-2014 ian

Change file_loadraw() from static to public. Change the order of its
arguments from type,filename to filename,type to be consistant with other
public file_whatever() functions, and change it to return a pointer to
the preloaded_file struct describing the file. Adjust existing callers.


261504 05-Feb-2014 jhb

Add support for FreeBSD/i386 guests under bhyve.
- Similar to the hack for bootinfo32.c in userboot, define
_MACHINE_ELF_WANT_32BIT in the load_elf32 file handlers in userboot.
This allows userboot to load 32-bit kernels and modules.
- Copy the SMAP generation code out of bootinfo64.c and into its own
file so it can be shared with bootinfo32.c to pass an SMAP to the i386
kernel.
- Use uint32_t instead of u_long when aligning module metadata in
bootinfo32.c in userboot, as otherwise the metadata used 64-bit
alignment which corrupted the layout.
- Populate the basemem and extmem members of the bootinfo struct passed
to 32-bit kernels.
- Fix the 32-bit stack in userboot to start at the top of the stack
instead of the bottom so that there is room to grow before the
kernel switches to its own stack.
- Push a fake return address onto the 32-bit stack in addition to the
arguments normally passed to exec() in the loader. This return
address is needed to convince recover_bootinfo() in the 32-bit
locore code that it is being invoked from a "new" boot block.
- Add a routine to libvmmapi to setup a 32-bit flat mode register state
including a GDT and TSS that is able to start the i386 kernel and
update bhyveload to use it when booting an i386 kernel.
- Use the guest register state to determine the CPU's current instruction
mode (32-bit vs 64-bit) and paging mode (flat, 32-bit, PAE, or long
mode) in the instruction emulation code. Update the gla2gpa() routine
used when fetching instructions to handle flat mode, 32-bit paging, and
PAE paging in addition to long mode paging. Don't look for a REX
prefix when the CPU is in 32-bit mode, and use the detected mode to
enable the existing 32-bit mode code when decoding the mod r/m byte.

Reviewed by: grehan, neel
MFC after: 1 month


255977 01-Oct-2013 pluknet

Sweep man pages replacing ad -> ada.

Approved by: re (blackend)
MFC after: 1 week
X-MFC note: stable/9 only


254092 08-Aug-2013 ae

Make the check for number of entries less strict.
Some partitioning tools can create GPT with number of entries less
than 128.

MFC after: 1 week


249719 21-Apr-2013 ae

Since we didn't break the loop, we should set i to -1 to start from the
beginning.

Submitted by: Steven Hartland
MFC after: 1 week


249139 05-Apr-2013 avg

strncmp for boot code: fix an off by one error

Before this change strncmp would access and _compare_ n+1 characters
in the case where the first n characters match.

MFC after: 5 days


248121 10-Mar-2013 ian

Attach the elf section headers to the loaded kernel as metadata, so
they can easily be used by later post-processing. When searching for
a compiled-in fdt blob, use the section headers to get the size and
location of the .dynsym section to do a symbol search.

This fixes a problem where the search could overshoot the symbol
table and wander into the string table. Sometimes that was harmless
and sometimes it lead to spurious panic messages about an offset
bigger than the module size.


248118 09-Mar-2013 ian

Since ubldr doesn't necessarily load a kernel at the physical address in the
elf headers, mask out the high nibble of that address. This effectly makes
the entry point the offset from the load address, and it gets adjusted for
the actual load address before jumping to it.

Masking the high nibble makes assumptions about memory layout that are true
for all the arm platforms we support right now, but it makes me uneasy.
This needs to be revisited.


247413 27-Feb-2013 ian

Fix a typo that prevented booting a kernel that had virtual addresses in
the elf headers.


247301 26-Feb-2013 ian

Adjust the arm kernel entry point address properly regardless of whether the
e_entry field holds a physical or a virtual address. Add a comment block
that explains the assumptions being made by the adjustment code.


247250 25-Feb-2013 kientzle

Fix the bug I introduced in r247045.
After digging through more carefully, it looks like there's
no real need to have the DTB in the module directory.
So we can simplify a lot: Just copy DTB into local heap
for "fdt addr" and U-Boot integration, drop all the extra
COPYIN() calls.

I've left one final COPYIN() to update the in-kernel DTB
for consistency with how this code used to work, but I'm
no longer convinced it's appropriate here.

I've also remove the mem_load_raw() utility that I added
to boot/common/module.c with r247045 since it's no longer
necessary.


246953 18-Feb-2013 kientzle

Add mem_load_raw() for loading data from another location in memory.

This will be used by some upcoming changes to loader(8) FDT
handling to allow it to use an FDT provided by an earlier
boot stage the same as an FDT loaded from disk.


246630 10-Feb-2013 ae

Add bootcamp support to the loader.

Tested by: dchagin
MFC after: 1 week


245148 08-Jan-2013 grehan

Bring in some userboot changes from the bhyve branch to reduce diffs.

r238966
Bump up the heap size to 1MB. With a few kernel modules, libstand
zalloc and userboot seem to want to use ~600KB of heap space, which
results in a segfault when malloc fails in bhyveload.

r241180
Clarify comment about default number of FICL dictionary cells.

r241153
Allow the number of FICL dictionary cells to be overridden.
Loading a 7.3 ISO with userboot/amd64 takes up 10035 cells,
overflowing the long-standing default of 10000.

Bump userboot's value up to 15000 cells.

Reviewed by: dteske (r238966,241180)
Obtained from: NetApp


242688 07-Nov-2012 dteske

Hook in new files menusets.4th and manual.

Approved by: adrian (co-mentor) (implicit)


242145 26-Oct-2012 mav

Fix loader crash when some unhalted exception happens during `include`
command execution. In case of such unhandled exception, vmReset() inside
ficlExecC() flushes the VM state. Attempt to return back to Forth after
that cause garbage dereference with unexpected results. To avoid that
situation call vmThrow() directly instead of expecting Forth to do it.


242084 25-Oct-2012 mav

Remove new-line characters from the include() errors to make it consistent
with the rest of code.


241876 22-Oct-2012 ae

When loader tries to open GPT partition, but partition table is not GPT,
then try automatically detect an appropriate partition type.

PR: kern/172550
Tested by: Ralf Wenk


241809 21-Oct-2012 ae

Add the flags parameter to the disk_open() function and DISK_F_NOCACHE
flag, that disables the caching of partition tables metadata.
Use this flag for floppies in the libi386/biosdisk driver.


241299 06-Oct-2012 avg

boot/console: handle consoles that fail to probe

- clarify meaning of console flags
- perform i/o via a console only if both of the following conditions are met:
o console is active (selected by user or config)
o console flags that it can perform the operation
- warn if a chosen console can not work (the warning may go nowhere without
working and active console, though)

Reviewed by: jhb
Tested by: Uffe Jakobsen <uffe@uffe.org>,
Olivier Cochard-Labbe' <olivier@cochard.me>
MFC after: 26 days


241070 30-Sep-2012 ae

Fix the style.


241069 30-Sep-2012 ae

Remember the file format of the last loaded module and try to use it for
next files.


241065 30-Sep-2012 ae

Fix disk_cleanup() to work without DISK_DEBUG too.


241053 29-Sep-2012 ae

Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.


241023 28-Sep-2012 ae

Make the loader a bit smarter, when it tries to open disk and the slice
number is not exactly specified. When the disk has MBR, also try to read
BSD label after ptable_getpart() call. When the disk has GPT, also set
d_partition to 255. Mostly, this is how it worked before.


240782 21-Sep-2012 andreast

Implement elfN(reloc) for powerpc. With this change the kernel is now able to
resolve dependencies of modules at boot time and load additional modules when
needed.

MFC after: 1 week


240481 14-Sep-2012 kientzle

The MBR data is not necessarily aligned. This is a problem on ARM.


240342 11-Sep-2012 avg

boot: file_loadraw should strdup name argument

... the same way it's done for type argument.

MFC after: 2 weeks


240249 08-Sep-2012 andreast

Fix loading of kernel modules at boot time for powerpc64.

Reported by: Mathias Breuninger
MFC after: 1 week


239325 16-Aug-2012 ae

Add comment why the code has been disabled.

Requested by: rpaulo


239294 15-Aug-2012 ae

Some BIOSes return incorrect number of sectors, make checks less
strictly, to do not lost some partitions.

Reported by: swills@


239293 15-Aug-2012 ae

Rework r239232 to unbreak ZFS detection on MBR slices.


239255 14-Aug-2012 des

As discussed on -current, remove the hardcoded default maxswzone.

MFC after: 3 weeks


239232 13-Aug-2012 ae

Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its
first partition.


239231 13-Aug-2012 ae

Remove colons from the debug message, device name returned by the
disk_fmtdev() already has the colons.


239230 13-Aug-2012 ae

Unbreak booting from the true dedicated disks.
When we open the disk, check the type of partition table, that has
been detected. If this is BSD label, then we assume this is DD mode.

Reported by: dim@


239210 12-Aug-2012 ae

Add more debug messages.


239127 07-Aug-2012 ae

As it turned out, there are some installations, where BSD label
contains partitions with type zero. And it has worked.
So, allow detect these partitions.

Reported by: glebius


239088 06-Aug-2012 ae

Fix start offset calculation for the EBR partitions.


239058 05-Aug-2012 ae

Introduce new API to work with disks from the loader's drivers.
It uses new API from the part.c to work with partition tables.

Update userboot's disk driver to use new API. Note that struct
loader_callbacks_v1 has changed.


239054 05-Aug-2012 ae

Create the interface to work with various partition tables from the
loader(8). The following partition tables are supported: BSD label, GPT,
MBR, EBR and VTOC8.


237338 20-Jun-2012 jhb

Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl). The kernel linker allows such
modules, so the boot loader should not reject them.

MFC after: 2 weeks


235988 25-May-2012 gleb

Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
unnecessary 64-bit math on 32-bit machines.

Sponsored by: Google Summer of Code 2011


235873 24-May-2012 wblock

Fixes to man8 groff mandoc style, usage mistakes, or typos.

PR: 168016
Submitted by: Nobuyuki Koganemaru
Approved by: gjb
MFC after: 3 days


235330 12-May-2012 avg

zfs boot: try to set vfs.root.mountfrom from currdev as a fallback

This way with the new zfsloader there is no need to explicitly set zfs
root filesystem either via vfs.root.mountfrom or fstab.
It should be automatically picked up from currdev which is by default
is set from bootfs.

Tested by: Florian Wagner <florian@wagner-flo.net> (x86)
MFC after: 1 month


235329 12-May-2012 avg

zfsboot/zfsloader: support accessing filesystems within a pool

In zfs loader zfs device name format now is "zfs:pool/fs",
fully qualified file path is "zfs:pool/fs:/path/to/file"
loader allows accessing files from various pools and filesystems as well
as changing currdev to a different pool/filesystem.

zfsboot accepts kernel/loader name in a format pool:fs:path/to/file or,
as before, pool:path/to/file; in the latter case a default filesystem
is used (pool root or bootfs). zfsboot passes guids of the selected
pool and dataset to zfsloader to be used as its defaults.

zfs support should be architecture independent and is provided
in a separate library, but architectures wishing to use this zfs support
still have to provide some glue code and their devdesc should be
compatible with zfs_devdesc.
arch_zfs_probe method is used to discover all disk devices that may
be part of ZFS pool(s).

libi386 unconditionally includes zfs support, but some zfs-specific
functions are stubbed out as weak symbols. The strong definitions
are provided in libzfsboot.
This change mean that the size of i386_devspec becomes larger
to match zfs_devspec.

Backward-compatibility shims are provided for recently added sparc64
zfs boot support. Currently that architecture still works the old
way and does not support the new features.

TODO:
- clear up pool root filesystem vs pool bootfs filesystem distinction
- update sparc64 support
- set vfs.root.mountfrom based on currdev (for zfs)

Mid-future TODO:
- loader sub-menu for selecting alternative boot environment

Distant future TODO:
- support accessing snapshots, using a snapshot as readonly root

Reviewed by: marius (sparc64),
Gavin Mu <gavin.mu@gmail.com> (sparc64)
Tested by: Florian Wagner <florian@wagner-flo.net> (x86),
marius (sparc64)
No objections: fs@, hackers@
MFC after: 1 month


235153 09-May-2012 avg

sys/boot: add common CTASSERT definition


234789 29-Apr-2012 marius

Add multiple inclusion protection.

PR: 165025
Submitted by: Gavin Mu
MFC after: 1 week


234176 12-Apr-2012 ae

Read backup GPT header from the last LBA only when primary GPT header and
table aren't valid. If they are ok, use hdr_lba_alt value to read backup
header. This will make gptboot happy when GPT used atop of some GEOM
provider, e.g. GEOM_MIRROR.

Reviewed by: pjd
MFC after: 2 weeks


233648 29-Mar-2012 eadler

Remove trailing whitespace per mdoc lint warning

Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days


233517 26-Mar-2012 marius

Remove second consts in r233288 in order to appease C++ compilers.
While at it, remove some style(9) bugs in libkern.h.

Submitted by: kan


233288 21-Mar-2012 marius

Declare the CRC lookup-tables const as they hardly should change at
run-time.


233105 18-Mar-2012 marius

Declare some variables static in order to reduce the object size and
redo r232822 in a less hackish way. The latter now no longer breaks
compiling the x86 boot2 with clang.

MFC after: 1 week


232822 11-Mar-2012 marius

Fix a bug introduced in r223938; on big-endian machines coping a 32-bit
quantum bytewise to the address of a 64-bit variable results in writing
to the "wrong" 32-bit half so adjust the address accordingly. This fix
is implemented in a hackish way for two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.

MFC after: 3 days


229771 07-Jan-2012 kib

Document comconsole_port and comconsole_pcidev loader variables.

MFC after: 2 weeks


229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


228916 27-Dec-2011 pluknet

Clean up from the 4.x era.

In an example of boot command:
- rename wd(4) IDE disk drives name to ad(4) for the time being.
- update the used kernel path "/kernel" to the current default.
[It still worked occasionally by looking into the /boot/kernel directory,
so the resulting path was "/boot//kernel/kernel", with two slashes.]

Bump .Dd for this and previous changes.

MFC after: 1 week


227056 03-Nov-2011 pluknet

Remove the remnants of /stand/sysinstall.

loader.8: Sync the default init_path list with kern/init_main.c.

NOTES: Replace with /rescue/init in the INIT_PATH kernel option.


226569 20-Oct-2011 pjd

With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
never call disk_openmbr().

Submitted by: avg
MFC after: 3 days


226554 19-Oct-2011 pjd

Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
is not.

MFC after: 3 days


224722 08-Aug-2011 dim

Fix buffer overflow in sys/boot/common/util.c's printf(), when printing
large (>= 10^10) numbers. In theory, 20 characaters should be enough,
but bump the buffer to 32 characters, so we have some room for the
future.

Reviewed by: pjd
Approved by: re (kib)


223938 11-Jul-2011 marius

Since r219452 the alignment of __dmadat has changed, revealing that fsread()
bogusly casts its contents around causing alignment faults on sparc64 and
most likely also on at least powerpc. Fix this by copying the contents
bytewise instead as partly already done here. Solving this the right way
costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86
there are still some bytes left there though, and an acceptable hack which
tricks the compiler into only using a 2-byte alignment instead of the native
one when accessing the contents turned out to even take up more space that.


223712 01-Jul-2011 marius

Fix r223695 to compile on architectures which don't use the MBR scheme; wrap
the MBR support in the common part of the loader in #ifdef's and enable it
only for userboot for now.


223695 30-Jun-2011 dfr

Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.


223295 19-Jun-2011 kan

Minimize backward seeks when trying to load ELF relocatable modules.

Some of loader filesystems are very ill equipped to handle seeking
backwards within the file. Namely, tftp requires trasfer to be
restarted from the start of the file every time we go backwards.


222417 28-May-2011 julian

New boot loader menus from Devin Teske.
Discussed on hackers and recommended for inclusion into 9.0 at the devsummit.
All support email to devin dteske at vicor dot ignoreme dot com .

Submitted by: dteske at vicor dot ignoreme dot com
Reviewed by: me and many others


221869 14-May-2011 attilio

Disconnect sun4v architecture from the three.

Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by: marius
Tested by: sbruno
Approved by: re


221601 07-May-2011 avg

a whitespace nit

Reminder from: kib
MFC after: 4 days


221593 07-May-2011 avg

a whitespace nit

MFC after: 4 days


220332 04-Apr-2011 marcel

Fix a long standing bug where file_load() passes down the global loadaddr
to the l_load() method in the file_formats structure, while being passed
an address as an argument (dest). With file_load() calling arch_loadaddr()
now, this bug is a little bit more significant.

Spotted by: nyan@ (nice catch!)


220311 03-Apr-2011 marcel

Add 2 new archsw interfaces:
1. arch_loadaddr - used by platform code to adjust the address at which
the object gets loaded. Implement PC98 using this new interface instead
of using conditional compilation. For ELF objects the ELF header is
passed as the data pointer. For raw files it's the filename. Note that
ELF objects are first considered as raw files.
2. arch_loadseg - used by platform code to keep track of actual segments,
so that (instruction) caches can be flushed or translations can be
created. Both the ELF header as well as the program header are passed
to allow platform code to treat the kernel proper differently from any
additional modules and to have all the relevant details of the loaded
segment (e.g. protection).


220290 03-Apr-2011 marcel

Revert rev 165325. The arch_maphint interface hasn't been in use for
more than 4 years.


219691 16-Mar-2011 marcel

MFaltix:
Add support for Pre-Boot Virtual Memory (PBVM) to the loader.

PBVM allows us to link the kernel at a fixed virtual address without
having to make any assumptions about the physical memory layout. On
the SGI Altix 350 for example, there's no usuable physical memory
below 192GB. Also, the PBVM allows us to control better where we're
going to physically load the kernel and its modules so that we can
make sure we load the kernel in memory that's close to the BSP.

The PBVM is managed by a simple page table. The minimum size of the
page table is 4KB (EFI page size) and the maximum is currently set
to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment
one can specify in a linker script. The bottom line is that PBVM is
between 64KB and 8GB in size.

The loader maps the PBVM page table at a fixed virtual address and
using a single translations. The PBVM itself is also mapped using a
single translation for a maximum of 32MB.

While here, increase the heap in the EFI loader from 512KB to 2MB
and set the stage for supporting relocatable modules.


219452 10-Mar-2011 rdivacky

Some more shrinking.

o bunch of variables are turned into uint8_t

o initial setting of namep[] in lookup() is removed
as it's only overwritten a few lines down

o kname is explicitly initialized in main() as BSS
in boot2 is not zeroed

o the setting and reading of "fmt" in load() is removed

o buf in printf() is made static to save space

Reviewed by: jhb
Tested by: me and Fabian Keil <freebsd-listen fabiankeil de>


219083 27-Feb-2011 pjd

Rename bcpy() macro to bcopy().


218974 23-Feb-2011 brucec

Handle memory allocation failures in include().

PR: i386/85652
Submitted by: Ben Thomas <bthomas at virtualiron.com>
MFC after: 3 days


218716 15-Feb-2011 dim

In sys/boot/common/ufsread.c, use uint8_t instead of u_int8_t.

Submitted by: mdf


218713 15-Feb-2011 dim

Apply a few small optimizations to boot2's code, to make it shrink a
little further. This gets us further on the way to be able to build it
successfully with clang. Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.

Submitted by: rdivacky
Reviewed by: imp


217688 21-Jan-2011 pluknet

Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.

Submitted by: perryh pluto.rain.com (previous version)
Reviewed by: jhb
Approved by: kib (mentor)
Tested by: universe


215811 25-Nov-2010 emaste

Give a bit of a hint of the failure (read != expected) but don't make
the error message needlessly more verbose.

Discussed with: attilio


215758 23-Nov-2010 attilio

Make this printfoutput more verbose.

Sponsored by: Sandvine Incorporated
Submitted by: Sandvine Incorporated
MFC after: 3 days


215016 08-Nov-2010 jhb

Remove support for autoloading ACPI from the loader. Leave in the code to
detect ACPI and export info such as the location of the RSDP via hints as
that is still useful.


214114 20-Oct-2010 pjd

Correct typos.


213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


213136 24-Sep-2010 pjd

- Split code shared by almost any boot loader into separate files and
clean up most layering violations:

sys/boot/i386/common/rbx.h:

RBX_* defines
OPT_SET()
OPT_CHECK()

sys/boot/common/util.[ch]:

memcpy()
memset()
memcmp()
bcpy()
bzero()
bcmp()
strcmp()
strncmp() [new]
strcpy()
strcat()
strchr()
strlen()
printf()

sys/boot/i386/common/cons.[ch]:

ioctrl
putc()
xputc()
putchar()
getc()
xgetc()
keyhit() [now takes number of seconds as an argument]
getstr()

sys/boot/i386/common/drv.[ch]:

struct dsk
drvread()
drvwrite() [new]
drvsize() [new]

sys/boot/common/crc32.[ch] [new]

sys/boot/common/gpt.[ch] [new]

- Teach gptboot and gptzfsboot about new files. I haven't touched the
rest, but there is still a lot of code duplication to be removed.

- Implement full GPT support. Currently we just read primary header and
partition table and don't care about checksums, etc. After this change we
verify checksums of primary header and primary partition table and if
there is a problem we fall back to backup header and backup partition
table.

- Clean up most messages to use prefix of boot program, so in case of an
error we know where the error comes from, eg.:

gptboot: unable to read primary GPT header

- If we can't boot, print boot prompt only once and not every five
seconds.

- Honour newly added GPT attributes:

bootme - this is bootable partition
bootonce - try to boot from this partition only once
bootfailed - we failed to boot from this partition

- Change boot order of gptboot to the following:

1. Try to boot from all the partitions that have both 'bootme'
and 'bootonce' attributes one by one.
2. Try to boot from all the partitions that have only 'bootme'
attribute one by one.
3. If there are no partitions with 'bootme' attribute, boot from
the first UFS partition.

- The 'bootonce' functionality is implemented in the following way:

1. Walk through all the partitions and when 'bootonce'
attribute is found without 'bootme' attribute, remove
'bootonce' attribute and set 'bootfailed' attribute.
'bootonce' attribute alone means that we tried to boot from
this partition, but boot failed after leaving gptboot and
machine was restarted.
2. Find partition with both 'bootme' and 'bootonce' attributes.
3. Remove 'bootme' attribute.
4. Try to execute /boot/loader or /boot/kernel/kernel from that
partition. If succeeded we stop here.
5. If execution failed, remove 'bootonce' and set 'bootfailed'.
6. Go to 2.

If whole boot succeeded there is new /etc/rc.d/gptboot script coming
that will log all partitions that we failed to boot from (the ones with
'bootfailed' attribute) and will remove this attribute. It will also
find partition with 'bootonce' attribute - this is the partition we
booted from successfully. The script will log success and remove the
attribute.

All the GPT updates we do here goes to both primary and backup GPT if
they are valid. We don't touch headers or partition tables when
checksum doesn't match.

Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 2 weeks


211817 25-Aug-2010 nwhitehorn

Fix build of ppc32 loader.


211747 24-Aug-2010 rpaulo

Replace structure assignments with explicity memcpy calls. This allows
Clang to compile this file: it was using the builtin memcpy and we want
to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet).

Submitted by: Dimitry Andric <dimitry at andric.com>
Reviewed by: jhb


211678 23-Aug-2010 imp

MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH (which simplifies some powerpc/powerpc64 ifs)


210764 02-Aug-2010 uqs

mdoc: make sure to pass at least one argument to quotation macros


210423 23-Jul-2010 avg

completely ignore zero-sized elf sections in modules of elf object type (amd64)

Current code doesn't check size of elf sections and may perform needless
actions of zero-sized memory allocation and similar.
The bigger issue is that alignment requirement of a zero-sized section
gets effectively applied to the next section if it has smaller alignment
requirement. But other tools, like gdb and consequently kgdb,
completely ignore zero-sized sections and thus may map symbols to
addresses differently.

Zero-sized sections are not typical in general.
Their typical (only, even) cause in FreeBSD modules is inline assembly that
creates custom sections which is found in pcpu.h and vnet.h. Mere inclusion
of one of those header files produces a custom section in elf output.
If there is no actual use for the section in a given module, then the
section remains empty.

Better solution is to avoid creating zero-sized sections altogether,
which is in plans.

Preloaded modules are handled in boot code (load_elf_obj.c), while
dynamically loaded modules are handled by kernel (link_elf_obj.c).

Based on code by: np
MFC after: 3 weeks


209920 12-Jul-2010 nwhitehorn

Provide support in loader for booting 64-bit PowerPC kernels. Like amd64,
64-bit PowerPC kernels are loaded by a 32-bit loader, since nearly all
powerpc64 firmwares execute in 32-bit mode.


207854 10-May-2010 imp

Formatting nit


201941 09-Jan-2010 marcel

Remove file system support based on the simple file system protocol
as this only allows us to access file systems that EFI knows about.
With a loader that can only use EFI-supported file systems, we're
forced to put /boot on the EFI system partition. This is suboptimal
in the following ways:
1. With /boot a symlink to /efi/boot, mergemaster complains about
the mismatch and there's no quick solution.
2. The EFI loader can only boot a single version of FreeBSD. There's
no way to install multiple versions of FreeBSD and select one
at the loader prompt.
3. ZFS maintains /boot/zfs/zpool.cache and with /boot a symlink we
end up with the file on a MSDOS file system. ZFS does not have
proper handling of file systems that are under Giant.

Implement a disk device based on the block I/O protocol instead and
pull in file system code from libstand. The disk devices are really
the partitions that EFI knows about.

This change is backward compatible.

MFC after: 1 week


201932 09-Jan-2010 marius

- Add code allowing a network device to only be open and closed once
by keeping it opened after the first open and closing it via the
cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
avoid the open-close-dance on every file access which with firmware
that for example performs an auto-negotiation on every open causes
netbooting to take horribly long. Basically the behavior with this
knob enabled resembles the one employed between r60506 and r177108
(and for sparc64 also again since r182919) with the addition that
the network device now is closed eventually before entering the
kernel and before rebooting. Actually I think this should be the
desired MI behavior, however the U-Boot loader actually requires
net_close() to be called after every transaction in order for some
local shutdown operations to be performed (and which I think thus
will break on concurrent opens, i.e. when netdev_opens is > 1, like
the loader does at least for disks when LOADER_GZIP_SUPPORT is
enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
increased netdev_opens for sparc64 in order to keep the network
device opened forever, as at least some firmware versions require
the network device to be closed eventually before entering the
kernel or otherwise will DMA received packets to stale memory.
The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
set as well for the same reasons.


201901 09-Jan-2010 marius

Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF
license FreeBSD had in sys/boot).

Obtained from: NetBSD


201340 31-Dec-2009 nyan

Don't use 15M-16M area on pc98. It's reserved for some devices.

MFC after: 2 week


200945 24-Dec-2009 marius

- Consistently wrap debugging in NETIF_DEBUG. This basically merges
NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.


200460 13-Dec-2009 marcel

Add support for memory disk (md). The size of the memory disk
is determined by MD_IMAGE_SIZE. A file system can be embedded
into the loader with /sys/tools/embed_mfs.sh.
Note that md.c is not included when MD_IMAGE_SIZE is not set.


199210 12-Nov-2009 attilio

Introduce a new option (BOOT_PROMPT_123) that lets enter the boot prompt
only when typing the sequence "123" (opposite to the standard 'push any
button' approach).
That results useful when using serial lines sending garbage and leading
to unwilling boot prompt appearence.

Obtained from: Sandvine Incorporated
Reviewed by: emaste, jhb
Sponsored by: Sandvine Incorporated
MFC: 1 week


198537 28-Oct-2009 brueffer

Close a file descriptor leak in an error case.

PR: 138374
Submitted by: Patroklos Argyroudis <argp@census-labs.com>
MFC after: 1 week


193192 01-Jun-2009 rodrigc

sys/boot/common.c
=================
Extend the loader to parse the root file system mount options in /etc/fstab,
and set a new loader variable vfs.root.mountfrom.options with these options.
The root mount options must be a comma-delimited string, as specified in
/etc/fstab.
Only set the vfs.root.mountfrom.options variable if it has not been
set in the environment.

sys/kern/vfs_mount.c
====================
When mounting the root file system, pass the mount options
specified in vfs.root.mountfrom.options, but filter out "rw" and "noro",
since the initial mount of the root file system must be done as "ro".
While we are here, try to add a few hints to the mountroot prompt
to give users and idea what might of gone wrong during mounting
of the root file system.

Reviewed by: jhb (an earlier patch)


192972 28-May-2009 dfr

Some of the boot loader code only works on a ufs file system, but it
uses the generic struct dirent, which happens to look identical to UFS's
struct direct. If BSD ever changes dirent then this will be a problem.

Submitted by: matthew dot fleming at isilon dot com


188666 16-Feb-2009 thompsa

Add a helper function for loading geli keys from the loader.


187197 13-Jan-2009 luigi

remove a file which is, as far as I can tell, totally unused.


185692 06-Dec-2008 danger

- correct variable name

PR: docs/129448
Submitted by: Kenyon Ralph <kralph@gmail.com>
MFC after: Revision 1.91 is merged


185132 20-Nov-2008 luigi

As reported in kern/118222, pxeboot in RELENG7 (and presumably
above) exhibits some misbehaviours on machines with AMD64 CPUs,
which at least in some cases I have tracked down to a heap overflow.

It is unclear whether it depends on the CPU or on the pxe bios
itself which may use more memory on AMD machines.

Noticeably a pxeboot compiled from 6.x sources works fine on all
machines I have tried so far, while a pxeboot compiled from 7.x
sources does not.

This patch is a first step in reducing the amount of memory used
while processing the configuration files read by the loader at boot
(some of them are quite large, 1700+ lines), and it does so by:
+ moving a buffer to static memory instead of allocating in the heap;
+ skipping empty lines;
+ reducing the amount of memory used for line descriptors;

Unfortunately there are several changes between 6.x and above,
affecting the compiler, the loader code itself, and libstand,
and it is not so straightforward to
These changes fix the behaviour on one motherboard with a
single-core AMD cpu, but are still not enough e.g on an Asus
M2N-VM (with a dual-core CPU).

I need to investigate the problem a bit more before figuring
out what should be committed to RELENG_7

PR: kern/118222


185029 17-Nov-2008 pjd

Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.

This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

Allows regular users to perform ZFS operations, like file system
creation, snapshot creation, etc.

- L2ARC

Level 2 cache for ZFS - allows to use additional disks for cache.
Huge performance improvements mostly for random read of mostly
static content.

- slog

Allow to use additional disks for ZFS Intent Log to speed up
operations like fsync(2).

- vfs.zfs.super_owner

Allows regular users to perform privileged operations on files stored
on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

Not all the flags are supported. This still needs work.

- ZFSBoot

Support to boot off of ZFS pool. Not finished, AFAIK.

Submitted by: dfr

- Snapshot properties

- New failure modes

Before if write requested failed, system paniced. Now one
can select from one of three failure modes:
- panic - panic on write error
- wait - wait for disk to reappear
- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

Just quota and reservation properties, but don't count space consumed
by children file systems, clones and snapshots.

- Sparse volumes

ZVOLs that don't reserve space in the pool.

- External attributes

Compatible with extattr(2).

- NFSv4-ACLs

Not sure about the status, might not be complete yet.

Submitted by: trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from: OpenSolaris


183878 14-Oct-2008 raj

Initial support of loader(8) for ARM machines running U-Boot.

This uses the common U-Boot support lib (sys/boot/uboot, already used on
FreeBSD/powerpc), and assumes the underlying firmware has the modern API for
stand-alone apps enabled in the config (CONFIG_API).

Only netbooting is supported at the moment.

Obtained from: Marvell, Semihalf


182919 10-Sep-2008 marius

Revert r177108 and restore r60506 for sparc64 as long as libstand
isn't fixed to only open the network device once and not do a open
and close dance on every file access; the firmwares of newer sparc64
machines perform an auto-negotiation with every open which in turn
causes netbooting to take horribly long if we open and close the
device over and over again.


182731 03-Sep-2008 raj

Show info about net devices in loader's 'lsdev' command. While there fix style.


181278 04-Aug-2008 cperciva

Setting a variable to the same value twice doesn't actually make it
more likely to have the right value. Remove superfluous assignments.

Found by: LLVM/Clang Static Checker


180208 03-Jul-2008 peter

Set magic fbsd:nokeywords property that allows files to bypass
keyword expansion. (file-specific replacement for CVSROOT/exclude)


179634 07-Jun-2008 kib

Fix the incorrect calculation of a block address within a single indirect
block.

PR: 108215
Submitted by: Yuichiro Goto, y7goto gmail com
MFC after: 2 weeks


177108 12-Mar-2008 raj

Eliminate artificial increasing of 'netdev_opens' counter in loader's net_open().

This was introduced as a workaround long time ago for some Alpha firmware
(which is now gone), and actually prevented net_close() to ever be
called.

Certain firmwares (U-Boot) need local shutdown operations to be performed on a
network controller upon transaction end: such platform-specific hooks are
supposed to be called via netif_close() (from within net_close()).

This change effectively reverts the following CVS commit:

sys/boot/common/dev_net.c

revision 1.7
date: 2000/05/13 15:40:46; author: dfr; state: Exp; lines: +2 -1
Only probe network settings on the first open of the network device.
The alpha firmware takes a seriously long time to open the network device
the first time.

Also suppress excessive output while netbooting via loader, unless debugging.

While there, make sys/boot/uboot more style(9) compliant.

Reviewed by: imp
Approved by: cognet (mentor)


176484 23-Feb-2008 marcel

Add __elfN(relocation_offset). It holds the offset between the virtual
(link) address and the physical (load) address. Ideally, the mapping
between link and load addresses should be abstracted by the copyin(),
copyout() and readin() functions, so that we don't have to add kluges
in __elfN(loadimage)(). Then, we could also have paged virtual memory
for the kernel. This can be important under EFI, where you need to
allocate physical memory form the firmware if you want to work in all
scenarios.


173440 08-Nov-2007 ru

Document the per-arch default value of kern.maxbcache.


173040 26-Oct-2007 jhb

Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined. This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.

MFC after: 1 week
Discussed with: imp


173024 26-Oct-2007 imp

The arm boot code uses this function as well. Redefining cgbase()
saves about 500 bytes in the boot code. While the AT91RM9200 has 12k
of space for the boot loader, which is more than i386's 8k, the code
generated by gcc is a bit bigger.

I've had this in p4 for about two years now.


172940 24-Oct-2007 jhb

First cut at support for booting a GPT labeled disk via the BIOS bootstrap
on i386 and amd64 machines. The overall process is that /boot/pmbr lives
in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for
locating and loading /boot/gptboot. /boot/gptboot is similar to /boot/boot
except that it groks GPT rather than MBR + bsdlabel. Unlike /boot/boot,
/boot/gptboot lives in its own dedicated GPT partition with a new
"FreeBSD boot" type. This partition does not have a fixed size in that
/boot/pmbr will load the entire partition into the lower 640k. However,
it is limited in that it can only be 545k. That's still a lot better than
the current 7.5k limit for boot2 on MBR. gptboot mostly acts just like
boot2 in that it reads /boot.config and loads up /boot/loader. Some more
details:
- Include uuid_equal() and uuid_is_nil() in libstand.
- Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using
/boot/pmbr and /boot/gptboot. Note that the disk must have some free
space for the boot partition.
- This required exposing the backend of the 'add' function as a
gpt_add_part() function to the rest of gpt(8). 'boot' uses this to
create a boot partition if needed.
- Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that
it can handle a filesystem > 1.5 TB.
- /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O
unlike boot1 since /boot/pmbr loads all of gptboot up front. The
C portion of gptboot (gptboot.c) has been repocopied from boot2.c.
The primary changes are to parse the GPT to find a root filesystem
and to use 64-bit disk addresses. Currently gptboot assumes that the
first UFS partition on the disk is the / filesystem, but this algorithm
will likely be improved in the future.
- Teach the biosdisk driver in /boot/loader to understand GPT tables.
GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is
similar to the /dev names the kernel uses (e.g. /dev/ad0p2).
- Add a new "freebsd-boot" alias to g_part() for the new boot UUID.

MFC after: 1 month
Discussed with: marcel (some things might still change, but am committing
what I have so far)


172445 04-Oct-2007 obrien

Also boot *.debug if everything else fails.

Approved by: re(gnn)


169399 09-May-2007 sepotvin

Add documentation for the vm.kmem_size_min and vm.kmem_size_max tunables.

Approved by: njl (mentor, blanket)


169286 05-May-2007 jmg

fixup talk of kern.maxswzone... It's been 32MB for almost 5 years now...
and only supports just over 7GB of swap...

Sound a bit more professional..

Inspired by: Marc G. Fournier
MFC After: 3 days


166486 04-Feb-2007 imp

Document the init_chroot and init_script variables.

# I didn't check the markup too closely, so doc people, please check

Submitted by: Oliver Fromme


165876 07-Jan-2007 marius

Garbage collect the code for auto-loading modules based on ISAPNP IDs,
which is #if'ed out since nearly eight years, along with its outdated
database.

Agreed by: ru (some months ago)


165325 18-Dec-2006 kmacy

add an interface for passing the entire kernel size up front to the
loader so that it can memory can be allocated aligned at the beginning of
the desired large page


164739 29-Nov-2006 yar

Note that not all architectures use sendfile(2) buffers;
refer to the respective manpage for details.

MFC after: 3 days


163917 02-Nov-2006 ru

Unbreak compile with ELF_VERBOSE defined, and fix format warnings.


163914 02-Nov-2006 ru

Revert the last change. Masking only 2 MSBs of the virtual address
to get the physical address doesn't work for all values of KVA_PAGES,
while masking 8 MSBs works for all values of KVA_PAGES that are
multiple of 4 for non-PAE and 8 for PAE. (This leaves us limited
with 12MB for non-PAE kernels and 14MB for PAE kernels.)

To get things right, we'd need to subtract the KERNBASE from the
virtual address (but KERNBASE is not easy to figure out from here),
or have physical addresses set properly in the ELF headers.

Discussed with: jhb


163897 02-Nov-2006 marcel

Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change
allows a future version of libefi to work without requiring anything
more than what is defined in struct devdesc and as such makes it
possible to compile said version of libefi for different platforms
without requiring that those platforms have identical derivatives
of struct devdesc.


163893 02-Nov-2006 marcel

Don't unconditionally compile-in the bcache code. It's only used on
i386/amd64 and pc98. Remove useless calls to bcache_init() from the
ia64 and sparc64 loaders, as well as from the OFW common code.


163891 02-Nov-2006 marcel

o Make sure to clear f->f_devdata if d_dev->dv_open() fails. It
would otherwise cause devclose() to free() the memory again.
o Refactor devopen() so that it's more readable.


163765 29-Oct-2006 ru

Because the BTX mini-kernel now uses flat memory mode and clients
are no longer limited to a virtual address space of 16 megabytes,
only mask high two bits of a virtual address. This allows to load
larger kernels (up to 1 gigabyte). Not masking addresses at all
was a bad idea on machines with less than >3G of memory -- kernels
are linked at 0xc0xxxxxx, and that would attempt to load a kernel
at above 3G. By masking only two highest bits we stay within the
safe limits while still allowing to boot larger kernels.

(This is a safer reimplmentation of sys/boot/i386/boot2/boot.2.c
rev. 1.71.)

Prodded by: jhb
Tested by: nyan (pc98)


163327 13-Oct-2006 ru

Replace a rarely used "depuration" with "debugging".

PR: docs/85127
Submitted by: Gary W. Swearingen (partially)
MFC after: 3 days


162815 29-Sep-2006 ru

Fix WARNS=2 warnings.


162742 28-Sep-2006 jhb

Ignore a sub-topic match if it is inside the command description.
Otherwise, merge-help can get confused by a command description that
includes a word that starts with a capital S.

MFC after: 1 week


161471 20-Aug-2006 ru

Make the default "init_path" value breakable, so it fits on the
screen's width, thus eliminating a groff(1) warning.

Suggested by: marck


161431 18-Aug-2006 marck

kern.ipc.nmbclusters is sysctl, not compile-time option. Change Dv to Va.

Touch .Dd.

Pointed out by: ru
MFC after: 1 week


161429 18-Aug-2006 marck

Remove references to NMBCLUSTERS which is obsoleted.

PR: 100427
Approved by: maxim
MFC after: 1 week


158467 12-May-2006 jhb

Remove more Alpha bits from the boot code including fixing several
stale comments.


154257 12-Jan-2006 marius

In moduledir_readhints() cast the value returned by sizeof() to ssize_t
when checking whether it's greater than a struct stat st_size in order
to also catch the case when st_size is -1. Previously this check didn't
trigger on sparc64 when st_size is -1 (as it's the case for a file on
a bzipfs, TFTP server etc.), causing the content of the linker hints
file to be copied to memory referenced by a null-pointer.

PR: 91231
MFC after: 1 week


153504 18-Dec-2005 marcel

Make our ELF64 type definitions match standards. In particular this
means:
o Remove Elf64_Quarter,
o Redefine Elf64_Half to be 16-bit,
o Redefine Elf64_Word to be 32-bit,
o Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o Use Elf_Size in MI code to abstract the difference between
Elf32_Word and Elf64_Word.
o Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks


150469 22-Sep-2005 ru

Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.


149213 18-Aug-2005 iedowse

Add a "comconsole_speed" loader variable that can be used to change
the serial console speed (i386 and amd64 only). If the previous
stage boot loader requested a serial console (RB_SERIAL or RB_MULTIPLE)
then the default speed is determined from the current serial port
speed. Otherwise it is set to 9600 or the value of BOOT_COMCONSOLE_SPEED
at compile time.

This makes it possible to set the serial port speed once in
/boot.config and the setting will propagate to boot2, loader and
the kernel serial console.


148516 29-Jul-2005 brian

Fix a comparison that broke ``set console=vidconsole'' and even the
loader.conf line ``console="vidconsole"''.

Sponsored by: ActiveState/Sophos
MFC after: 1 week


148398 25-Jul-2005 jmg

remove a pointless comment with a more helpful one...

Submitted by: Tobias Roth
MFC after: 5 days


147366 14-Jun-2005 ru

Improved markup, fixes some spelling and grammar.

Approved by: re (blanket)


146804 30-May-2005 ru

Markup nits.


146698 27-May-2005 jhb

- Add support to the loader for multiple consoles.
- Teach the i386 and pc98 loaders to honor multiple console requests from
their respective boot2 binaries so that the same console(s) are used in
both boot2 and the loader.
- Since the kernel doesn't support multiple consoles, whichever console is
listed first is treated as the "primary" console and is passed to the
kernel in the boot_howto flags.

PR: kern/66425
Submitted by: Gavin Atkinson gavin at ury dot york dot ac dot uk
MFC after: 1 week


146421 19-May-2005 sobomax

Extend `autoboot_delay' handling - is this variable is set to -1 don't allow
user to interrupt autoboot process at all. Currently, even when
`autoboot_delay' is set to 0, loader(8) still allows autoboot process to be
interrupted by pressing any key on the console when the loader reads kernel
and modules from the disk. In some cases (i.e. untrusted environment) such
behaviour is highly indesirable and user should not be allowed to interfere
with the autoboot process at all.

Sponsored by: PBXpress Inc.
MFC after: 3 days


146365 19-May-2005 sobomax

Whitespace only: kill trailing spaces.


142012 17-Feb-2005 des

Document the new default init_path.

Reminded by: ru
MFC after: 2 weeks


141060 30-Jan-2005 rwatson

Insert an explicit McAfee license, as we use a stock two-clause BSD
license rather than the slightly custom licence in ufsread.c.


138249 01-Dec-2004 scottl

Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.


137667 13-Nov-2004 ru

There's no reason for "read" and "echo" commands to not
appear in the online command list.


137615 12-Nov-2004 ru

Pass the "?" command output through the pager.

(This doesn't quite work as this command is overridden by Forth,
and some Forth commands are appended to the output.)


136895 24-Oct-2004 ru

Collapse several adjacent .if's into .if/.elif.


136893 24-Oct-2004 nyan

ELF64 support is not needed on pc98.


136549 15-Oct-2004 imp

document host_start_mem.

# feel free to wordsmith.

Suggested by: ru@


136548 15-Oct-2004 ru

Polish the last change.


136525 15-Oct-2004 imp

Document hw.{pci,acpi}.host_start_mem

Requested by: ru@


136144 05-Oct-2004 pjd

Back out changes which were introduced to delay mounting root file system.
Those changes were made on gmirror needs, but now gmirror handles this
by itself.


136097 03-Oct-2004 stefanf

Use the correct printf specifier.

PR: 47187


135999 01-Oct-2004 ru

The "autoboot" command also has a third (optional) parameter.


135996 30-Sep-2004 ru

Don't give instructions on how to disable ACPI in the MI section.
For novice users, beastie.4th can just do it. Expert users can
read ACPI instructions by typing "help ACPI".


135980 30-Sep-2004 ru

Retire now useless userconfig_script_*.


135975 30-Sep-2004 ru

The value of $interpret is "OK", in uppercase.


135974 30-Sep-2004 ru

Fixed the default value of the $prompt variable, document what
happens if $prompt is unset.


135973 30-Sep-2004 ru

Setting dump device from loader(8) has not been supported since 2002.


135970 30-Sep-2004 ru

The default value of "bootfile" has been "kernel" since 2000.


135969 30-Sep-2004 ru

Mention "help index" in the online help, and provide a help for
the `?' command.


135967 30-Sep-2004 ru

Document boot_cdrom, boot_multicons, and boot_serial.
Reduce diffs between help.common and loader(8).
Mention that boot_userconfig is currently a no-op.


135965 30-Sep-2004 ru

`?' is not the same as "help index".


135929 29-Sep-2004 ru

Fixed exiting from pager using the `q' key while paging
"help index" or "help <topic>" with list of subtopics.


135729 24-Sep-2004 pjd

Document vfs.root.mountdelay value.

Reminded by: ru


134459 29-Aug-2004 iedowse

Add the loader side of support for preloading ELF relocatable object
format modules, which are currently only used on the amd64 platform.
This initial implementation just parses enough of the module to
allow it to extract dependencies and load all the bits into the
right place in memory, so the kernel must still do the full relocation
and linking. The details of the loaded sections are passed to the
kernel by supplying a copy of the ELF section header table as module
metadata with the MODINFOMD_SHDR tag.


134458 28-Aug-2004 iedowse

Separate out the ELF relocation code from the ELF loader, and add
better relocation support for the amd64 and i386 platforms. This
should not result in any change in functionality, but moves a step
towards supporting the relocatable object file modules on amd64.

The same hack/trick as load_elf*.c uses is used here to simultaneously
support both elf32 and elf64 on amd64 and i386.


134441 28-Aug-2004 iedowse

Add a few helper functions for zeroing kernel space and reading
from specified file offsets. Make use of these in load_elf.c.


134151 22-Aug-2004 maxim

Trim EOL white spaces.


134150 22-Aug-2004 maxim

Check a return code from read(2) correctly.

PR: kern/70815
Submitted by: info [at] haakh.de


133948 18-Aug-2004 maxim

Bump the manpage date.

Noticed by: ru


133947 18-Aug-2004 maxim

Retire hw.pci.allow_unsupported_io_range.

PR: bin/70533
Submitted by: Gavin Atkinson


133217 06-Aug-2004 jmg

remove /boot/kernel from the default path.. There is already code that
will prepend the current kernel booting... This prevents a problem of
loading /boot/kernel's modules when a different kernel has no modules,
but you left your module_load="YES" in loader.conf...

Reviewed by: dcs (minus the help part)


132854 29-Jul-2004 ceri

Correct a documentation bug.

Approved by: jhb


131840 08-Jul-2004 brian

Change the following environment variables to kernel options:

bootp -> BOOTP
bootp.nfsroot -> BOOTP_NFSROOT
bootp.nfsv3 -> BOOTP_NFSV3
bootp.compat -> BOOTP_COMPAT
bootp.wired_to -> BOOTP_WIRED_TO

- i.e. back out the previous commit. It's already possible to
pxeboot(8) with a GENERIC kernel.

Pointed out by: dwmalone


131814 08-Jul-2004 brian

Change the following kernel options to environment variables:

BOOTP -> bootp
BOOTP_NFSROOT -> bootp.nfsroot
BOOTP_NFSV3 -> bootp.nfsv3
BOOTP_COMPAT -> bootp.compat
BOOTP_WIRED_TO -> bootp.wired_to

This lets you PXE boot with a GENERIC kernel by putting this sort of thing
in loader.conf:

bootp="YES"
bootp.nfsroot="YES"
bootp.nfsv3="YES"
bootp.wired_to="bge1"

or even setting the variables manually from the OK prompt.


131754 07-Jul-2004 ru

mdoc(7) fixes.


131575 04-Jul-2004 stefanf

Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.


131489 02-Jul-2004 ru

Fixed what appeared to be a hard sentence break.


131393 01-Jul-2004 ps

When building a kernel or the loader, let the hostname be overridden


129310 16-May-2004 ru

Markup fixes.


128019 07-Apr-2004 imp

Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson


127789 03-Apr-2004 le

mdoc fix: put the end-of-list macro after the last list element.

Approved by: grog (mentor)


126837 11-Mar-2004 bde

Fixed a misspelling of 0 as NULL.


125561 07-Feb-2004 ru

Style: use the defined() expression explicitly.


125091 27-Jan-2004 des

Rename the kern.vm.kmem.size tunable to the more logical vm.kmem_size. To
assure backward compatibility (conditional on !BURN_BRIDGES), look it up
by its old name first, and log a warning (but accept the setting) if it
was found. If both the old and new name are defined, the new name takes
precedence.

Also export vm.kmem_size as a read-only sysctl variable; I find it hard to
tune a parameter when I don't know its default value, especially when that
default value is computed at boot time.


121973 03-Nov-2003 iedowse

Override the root server address if an IP address is specified in
the root path. This is reported to make non-PXE netbooting, such as
is used on sparc64 systems, work correctly when the TFTP server is
not the same as the root server.

PR: kern/57328
Submitted by: Per Kristian Hove <Per.Hove@math.ntnu.no>


119483 25-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


117044 29-Jun-2003 brueffer

Capitalize an occurrence of 'ficl' for consistency.

Submitted by: Andre Guibert de Bruet <andy@siliconlandmark.com>
MFC after: 3 days


116864 26-Jun-2003 peter

Build on amd64. Yes, I know this isn't particularly nice.


115113 17-May-2003 ru

Fixed the markup and wording of the kern.ipc.nsfbufs tunable.
(It does not modify NSFBUFS, but just overrides it if set.)

Approved by: re (blanket)


114937 12-May-2003 peter

Fix lookup of module metadata on amd64 systems. While this is in
common code, the non-trivial part is #ifdef'ed and only executes when
loading amd64 kernels. The rest is trivial but needed for the the amd64
case. (Two variables changed from char ** to Elf_Addr).

Approved by: re (amd64 "low-risk" stuff)


114707 05-May-2003 obrien

Since we insist on loading the POS ACPI by default, give the poor user
instructions on the main help screen for disabling it.


114654 04-May-2003 murray

Fix a bunch of typos and grammatical errors.

PR: docs/40234
Submitted by: Chris Pepper <pepper@rockefeller.edu> (mostly)
MFC After: 3 days


114379 01-May-2003 peter

Enable the i386 loader to load and run an amd64 kernel. If this puts
things over floppy size limits, I can exclude it for release builds or
something like that. Most of the changes are to get the load_elf.c file
into a seperate elf32_ or elf64_ namespace so that you can have two
ELF loaders present at once. Note that for 64 bit kernels, it actually
starts up the kernel already in 64 bit mode with paging enabled. This
is really easy because we have a known minimum feature set.

Of note is that for amd64, we have to pass in the bios int 15 0xe821
memory map because once in long mode, you absolutely cannot make VM86
calls. amd64 does not use 'struct bootinfo' at all. It is a pure loader
metadata startup, just like sparc64 and powerpc. Much of the
infrastructure to support this was adapted from sparc64.


113161 06-Apr-2003 peter

Zap some a.out leftovers


113083 04-Apr-2003 phk

Libdisk does not need to include <sys/diskslice.h> any more.

Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.


111957 07-Mar-2003 trhodes

Fix a few spelling errors.

Submitted by: Stefan Farfeleder <stefan@fafoe.dyndns.org> via -doc.


111890 04-Mar-2003 seanc

Document the tunable kern.ipc.nsfbufs in help.common and loader.8. Small
nearby grammar fixup that saves a line of display while in the loader
(help set tunables), but reuses the line for kern.ipc.nsfbufs.

Approved by: roam


111852 03-Mar-2003 ru

FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch
up with this further by excluding /modules from the (default)
kern.module_path.


111456 25-Feb-2003 obrien

Only apply rev 1.10 (which hacks around the i386 boot2 being too big for
both ufs1 and ufs2 support) on i386.


111410 24-Feb-2003 mckusick

Revert to old (broken for over 1.5Tb filesystems) version of cgbase
so that boot loader once again will fit.

Sponsored by: DARPA & NAI Labs.


110554 08-Feb-2003 trhodes

s/hw.pci_allow_unsupported_io_range/hw.pci.allow_unsupported_io_range/

The former was incorrect and gave an `unknown oid' error.


109616 21-Jan-2003 jake

Fix module dependency (pre)loading on sparc64 by relocating the variables
read from the raw kld files.

Submitted by: Hartmut Brandt <brandt@fokus.gmd.de>
PR: 46870
Tested on: alpha (obrien), i386, sparc64


109281 15-Jan-2003 mdodd

Minimally document hw.syscons.sc_no_suspend_vtswitch.

Requested by: Nate Lawson <nate@root.org>


107877 14-Dec-2002 phk

Restructure so we can compile UFS1_ONLY, UFS2_ONLY or UFS1_AND_UFS2
versions from the same basic function.


107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


107294 27-Nov-2002 mckusick

Create a new 32-bit fs_flags word in the superblock. Add code to move
the old 8-bit fs_old_flags to the new location the first time that the
filesystem is mounted by a new kernel. One of the unused flags in
fs_old_flags is used to indicate that the flags have been moved.
Leave the fs_old_flags word intact so that it will work properly if
used on an old kernel.

Change the fs_sblockloc superblock location field to be in units
of bytes instead of in units of filesystem fragments. The old units
did not work properly when the fragment size exceeeded the superblock
size (8192). Update old fs_sblockloc values at the same time that
the flags are moved.

Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk>
Sponsored by: DARPA & NAI Labs.


107266 26-Nov-2002 yar

Eliminate references to defunct kernel tunables.

Approved by: re
PR: bin/43343


106845 13-Nov-2002 mdodd

Document loader tunables hw.pci.enable_io_modes and
hw.pci.allow_unsupported_io_range.

Submitted by: Hiten Pandya <hiten@angelica.unixdaemons.com>
Approved by: re (murray)


106842 13-Nov-2002 mdodd

Loader tunable 'machdep.disable_mtrrs'.
Sysctl of same name to reflect status.

Submitted by: jhb
Approved by: re (murray)
MFC after: 1 day


104678 08-Oct-2002 phk

It seems that the only problem with UFS2 booting on i386 is the 64bit
divide/remainder calls. For reasons not resolved, compiling the
relevant routines from libkern into boot2 results in stack corruption.

Do the simple thing: Don't use 64bit divide/remainder operations.

Sponsored by: DARPA & NAI Labs


104612 07-Oct-2002 phk

Move the definition of UFS1_ONLY into the Makefiles where it belongs.

Sponsored by: DARPA & NAI Labs.


102612 30-Aug-2002 iwasaki

s/hint.acpi.0.disable/hint.acpi.0.disabled/

Fix device hints entry for disabling acpi(4).
This also should fix the arbitration with apm(4) when both drivers
are enabled.

Note that your /boot/device.hints needs to be updated if you want to
stop auto-loading acpi.ko or disable acpi(4).


102588 29-Aug-2002 peter

Actually remove the stale a.out kld support. This is the stuff that was
never updated for the metadata infrastructure.


102556 29-Aug-2002 peter

Initiate deorbit burn of i386 a.out kld "support" in loader. Note that
this was quite broken, it never was updated for metadata support.
The a.out kld file support was never really used, as it wasn't necessary.
You could always load elf kld's, even in an a.out kernel.


101823 13-Aug-2002 ru

mdoc(7) police: revert unapproved changes in rev. 1.43, added missing markup bits in rev. 1.45.


101558 09-Aug-2002 obrien

Restore autoloading of ACPI module.

Document the approved ways of disabling it.
Submitted by: Daniel O'Connor <doconnor@gsoft.com.au>


101112 31-Jul-2002 jake

Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.


100016 15-Jul-2002 keramida

Use present tense in all the verbs, when describing loader's startup.
Most of them are not in a future tense already.


99974 14-Jul-2002 charnier

The .Nm


99546 07-Jul-2002 mp

Change help documentation for bootfile and module_path to reflect
the actual code. Both use a ";" (not a ",") to delimit entries.

PR: 39679
Submitted by: Cyrille Lefevre <cyrille.lefevre@laposte.net>
MFC after: 3 days


98593 21-Jun-2002 jake

Enable UFS1_AND_UFS2 support for sparc64 by default. Booting from ufs1 or
ufs2 filesystems seems to work fine.


98542 21-Jun-2002 mckusick

This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by: Poul-Henning Kamp <phk@freebsd.org>


97864 05-Jun-2002 phk

Make sparc64 share ufsread.c with i386.

Sponsored by: DARPA & NAI Labs.


97861 05-Jun-2002 phk

Indent this file more like style(9).

Sponsored by: DARPA & NAI Labs.


97860 05-Jun-2002 phk

Preparation for UFS2 commit:

Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.


97525 29-May-2002 schweikh

Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after: 2 weeks


96310 10-May-2002 obrien

We don't need bootinfo any more, and sparc64 doesn't have it anyways.


94419 11-Apr-2002 peter

Bandaid for a buffer overrun in the module searching code. When breaking
up the module_path string, we would walk one past the end of the buffer.
This hurting ia64 originally, but it was probably also happening on i386
occasionally as well. The effects were usually harmless, it would add
bogus "binary" search directories to the places it actually looked for
files.


94313 09-Apr-2002 dcs

Upgrade FICL to 3.02. Forgot this one, sorry.

PR: 36308
Submitted by: dcs


94248 09-Apr-2002 jake

Fix another unsigned long used to index the symbol table which should be
Elf_Hashelt.


93922 06-Apr-2002 peter

Use the correct elf hash table entry type. This matches a similar fix
in the kernel side of things some time ago. The hash table entries are
always 32 bits wide, even on 64 bit machines.


93306 28-Mar-2002 obrien

Not all platforms have and want a.out format support.


92766 20-Mar-2002 alfred

Remove __P.


92339 15-Mar-2002 ru

mdoc(7) police: fix a typo and markup.


92030 10-Mar-2002 sobomax

CG superfluous prototype.


91219 25-Feb-2002 bde

Declare time(not3) instead of depending on namespace pollution 3 layers
deep in <stand.h> to eventually include <time.h> to declare the user
version.

This is not quite the right place to declare it, but <stand.h> would
be worse because time() is very MD so it isn't in libstand.

Many places in the boot sources still get the user version using only
1 layer of pollution (#include <sys/time.h>. Some pollute themselves
directly (#include <time.h>). But the boot Makefiles are too broken
to enable warnings for redeclarations.


91218 25-Feb-2002 bde

Removed mounds of unused variables.


91008 21-Feb-2002 davidc

Document the hw.physmem kernel environment variable.

Reviewed by: alfred


89699 23-Jan-2002 sobomax

CG hard sentence breaks.

Submitted by: ru


89601 21-Jan-2002 sobomax

Allow dump device be configured as early as possible using loader(8) tunable.
This allows obtaining crash dumps from the panics occured during late stages
of kernel initialisation before system enters into single-user mode.

MFC after: 2 weeks


87855 14-Dec-2001 ru

mdoc(7) police: remove hard sentence break which I didn't
submit to Jonathan Mini.


87636 11-Dec-2001 jhb

- Add 'fwrite' and 'fseek' words for writing to and seeking on files.
- Change the 'fopen' keyword to accept a mode parameter. Note that this
will break existing 4th scripts that use fopen. Thus, the loader
version has been bumped and loader.4th has been changed to check for a
sufficient version on i386 and alpha. Be sure that you either do a full
world build or install or full build and install of sys/boot after this
since loader.old won't work with the new 4th files and vice versa.

PR: kern/32389
Submitted by: Jonathan Mini <mini@haikugeek.com>
Sponsored by: ClickArray, Inc.


87634 11-Dec-2001 jhb

Add support for writing blocks to the loader's disk cache.

PR: kern/32389
Submitted by: Jonathan Mini <mini@haikugeek.com>
Sponsored by: ClickArray, Inc.


87599 10-Dec-2001 obrien

Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.


87505 07-Dec-2001 rwatson

o Expand list of tunables documented in loader.8 to include kern.maxusers,
since other related tunables were also documented here. Add a cross
reference to tuning(7) for information on setting this value
appropriately.


87344 04-Dec-2001 des

The entry for the 'set' command no longer has a list of variables.

PR: 32454
Submitted by: Gary W. Swearingen <swear@blarg.net>
MFC after: 3 days


87261 03-Dec-2001 murray

Fix typo.

PR: 32455
Submitted by: "Gary W. Swearingen" <swear@blarg.net>


87058 28-Nov-2001 dcs

Waits for a keypress before rebooting on panic.

PR: kern/32351
Submitted by: Jonathan Mini <mini@haikugeek.com>
MFC after: 1 week


86608 19-Nov-2001 obrien

Upper case the FreeBSD loader prompt.
On OFW based machines, it is just too confusing having the firmware and
OS loader giving the same prompt. This is a nice compromise that 99% of the
users on non-OFW platforms will probably not even notice.


86469 16-Nov-2001 iedowse

Fix a number of misspellings of "dependency" and "dependencies" in
comments and function names.

PR: kern/8589
Submitted by: Rajesh Vaidheeswarran <rv@fore.com>


86168 07-Nov-2001 fenner

Initialize first to -1; this will create a (nearly) empty file on failure,
instead of looping until the disk is full. This kind of failure can
especially happen when a version of awk that doesn't support POSIX
character classes is used.

Submitted by: David Wolfskill <david@catwhisker.org>


86090 05-Nov-2001 jhb

Add a DEVT_CD type for CD drivers.


85997 04-Nov-2001 jhb

Print out 'foo devices:' as the line before displaying a group of
devices in 'lsdev' output rather than printing out a pointer to the
print function since the user really could care less about the pointer
value. Perhaps this was intended to be a debugging printf?


85935 03-Nov-2001 obrien

Revert rev 1.3 which moved us away from POSIX character classes.
The community feels our base AWK must handle them.


85808 01-Nov-2001 obrien

Bell-Labs AWK does not support POSIX "bracket expressions" (POSIXese for
"character classes", basically). So change them to their character
representation.

Submitted by: David Wolfskill <david@catwhisker.org>


84337 01-Oct-2001 silby

grammar fix: to -> too


83321 11-Sep-2001 peter

Implement the long-awaited module->file cache database. A userland
tool (kldxref(8)) keeps a cache of what modules and versions are inside
what .ko files. I have tested this on both Alpha and i386.

Submitted by: bp


81955 20-Aug-2001 ru

mdoc(7) police: markup nits.


81933 20-Aug-2001 dillon

Limit the amount of KVM reserved for the buffer cache and for swap-meta
information. The default limits only effect machines with > 1GB of ram
and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX
and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and
kern.maxbcache. This has the effect of leaving more KVM available for
sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad
adds memory to a machine and then sees the kernel panic on boot due to
running out of KVM.

Also change the default swap-meta auto-sizing calculation to allocate half
of what it was previously allocating. The prior defaults were way too high.
Note that we cannot afford to run out of swap-meta structures so we still
stay somewhat conservative here.


81462 10-Aug-2001 ru

mdoc(7) police: join split punctuation to macro calls.


79757 15-Jul-2001 dd

Remove whitespace at EOL.


78696 24-Jun-2001 dwmalone

Get rid of some constness warnings.


78465 19-Jun-2001 peter

Convert the elf loader to the new linker set layout for elf files.
This should make dependencies at load time work like before. Oops.

Noticed by: markm


78463 19-Jun-2001 peter

Fix some of the worst formatting bug (seperate commit)


78195 14-Jun-2001 peter

Nuke old gensetdefs based linker sets with extreme prejudice


77971 10-Jun-2001 jesper

Fix a minor style bug in the last commit.

Submitted by: Adrian Steinmann <ast@marabu.ch>
MFC after: 2 days


77285 27-May-2001 jesper

In sys/boot/common/module.c, near line 105 a request for a raw
file is processed by passing its name in argv[1]:
return(mod_loadobj(typestr, argv[1]));
however, it is not tested to see if argv[1] actually is defined.

At best, mod_loadobj() near line 244 returns an error like
"can't find 'garbage'" but if the "filename" entered is sufficiently
long, some buffer gets overrun. Of course, "load -t filename" is
actually a typo because we meant to type "load -t mfs_root filename";
nevertheless, a hung machine seems like too harsh a punishment for
such a small typo...

PR: i386/27693
Submitted by: Adrian Steinmann <ast@marabu.ch>
MFC after: 1 week


74850 27-Mar-2001 ru

MAN[1-9] -> MAN.


73349 02-Mar-2001 ru

setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.


73233 28-Feb-2001 ru

Eliminate mdocNG warnings caused by misplaced or extraneous macro calls.


72879 22-Feb-2001 dcs

Whenever the user might be offered a chance to quit through
pager_output(), respect that choice.

PR: 15747


71895 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


70519 30-Dec-2000 phk

Use <sys/queue.h> macro API.

Submitted by: "Jason" <jsmethers@pdq.net>
Reviewed by: /sbin/md5


70405 27-Dec-2000 ru

Prepare for mdoc(7)NG.


70020 14-Dec-2000 ru

mdoc(7) police: removed duplicate .Os call.


69027 22-Nov-2000 ru

mdoc(7) police: do not split author names in the AUTHORS section.


68961 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68851 17-Nov-2000 msmith

The default kernel filename is "kernel" again, not "kernel.ko".

Submitted by: mckusick


68716 14-Nov-2000 ru

Use Fx macro wherever possible.


68548 10-Nov-2000 benno

OpenFirmware/PowerPC loader, part 2.

As of this patchset, the loader builds (under NetBSD/macppc), boots, interacts
and talks to BOOTP/NFS servers.

(main.c was moved from boot/ofw/libofw to boot/ofw/common but has no revision
history)

Reviewed by: obrien


68547 10-Nov-2000 benno

Give the network device a print method.

Reviewed by: obrien


67591 25-Oct-2000 dfr

Don't indirect through a null pointer if we run out of kernel filenames.


65940 16-Sep-2000 dcs

The default search path for kernel and modules was bogus. It makes no
sense for /boot/kernel to come last.


65881 15-Sep-2000 dcs

Start countdown only _after_ the kernel was loaded. Not very fair otherwise.


65683 10-Sep-2000 dcs

Change NOFORTH comment character from # to \ followed by space,
to make things more interchangeable between it and the FORTH case.

Perhaps requiring the space is a bit too much, but...

Nothing in the tree seems to produce loader.rc files with comment
line, at this time.


65622 08-Sep-2000 dcs

Update boot and boot-conf descriptions to reflect new and old changes.
Add a warning in loader(8) that boot might be changed by loader.4th.


65614 08-Sep-2000 dcs

Make the pnp structure a global variable, so it can be used elsewhere.


65613 08-Sep-2000 dcs

Fix autoboot. Now autoboot *always* show the correct kernel name. It
gets the name from the environment variable kernelname, which is set
when a kernel is loaded. For this reason, autoboot will _first_ try
to load a kernel, and only proceed with the wait prompt after that
succeeds. If it fails, it will abort immediately.

While I understand some may think this behavior undesirable, I think
it is, overall, the best thing to do, even if we do not consider the
aesthetic issue. Notice that anyone using the default loader.rc
already has the kernel loaded before autoboot.

On unload, unset kernelname.

Separate the code that tries to load a kernel from the list of options
to the function loadakernel(). It is used by both boot() and
autoboot().


65549 06-Sep-2000 obrien

With the committed changes to the loaders modules path code, the kernel
path does not need to be hard coded.


65502 05-Sep-2000 obrien

Fix the kernel default load from "/boot/modules" to "/boot/kernel".

Reported by: dcs


65501 05-Sep-2000 obrien

The kernel is now known as `kernel.ko' and it and its matching modules
live in ``/boot/kernel/''.


65042 24-Aug-2000 sheldonh

List loader.conf and friends in the FILES section.

Requested by: obrien


64532 11-Aug-2000 dcs

Add missing "is".

PR: 20524
Submitted by: Peter Pentchev <roam@orbitel.bg>


64527 11-Aug-2000 ps

Add support to send the string 'PXEClient' as the Vendor class
identifier to the DHCP server. Now you can check for this string
in your dhcp configuration to decide whether you will hand out a
lease to the client or not.


64220 04-Aug-2000 jhb

Bring back the perform() function. However, conditionionalize it on
BOOT_FORTH as it is only used if BOOT_FORTH is not defined.


64188 03-Aug-2000 jhb

Fix the more obvious warnings to deal with my earlier warning cleanups.


64187 03-Aug-2000 jhb

Cleanup warnings. Most of these are signed/unsigned warnings, as well as
some added const's.


62874 10-Jul-2000 kris

Don't call printf with no format string.


62873 10-Jul-2000 kris

Don't call printf with no format string. This is technically a security
vulnerability and could in principle be used to upload a new kernel from the
bootloader :-)


62049 25-Jun-2000 mph

Typo fix: tunnable.
Backslash-parsing is not the role of printf(3), but is provided
by the C language.


61943 22-Jun-2000 sheldonh

Whitespace-only changes: apply accepted line breaking style as a
pre-cursor to other markup changes.

Accepted in principle by the author.


61720 16-Jun-2000 dcs

Fix vocabulary juggling so that builtins voc is always searched before
forth vocabulary when initially creating the builtins. FICL 2.05 has a
better way to do this, but this works for now.

Fixes "?".


61693 14-Jun-2000 dcs

Remove the setting of sourceid from bf_vm(), as bf_vm() really has
no clue.

Set sourceid to 0 when booting, which is the correct setting for stdin.

Set sourceid to an arbitrary fd when include'ing, preserving and restoring
the previous sourceid. This is possibly broken(), as 0 is a valid fd. Maybe
we should +1 to this value.

This fixes the version problem widely reported.


61659 14-Jun-2000 ps

Delay calling the device cleanup routines until the absolute last
moment. We were cleaning up after PXE too early and the module
dependancy code would not be able to load any files if it needed
too.


61653 14-Jun-2000 ps

Make typing 'q' or 'Q' work for the show command as the pager prompt
says it should.


61371 07-Jun-2000 dcs

Place original builtins in a vocabulary called "builtins". This
is intended mainly for debuging purposes, but it can be used by
other words if done carefully.


61353 07-Jun-2000 dcs

Remove residual printf.

Prodded by: msmith


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


60820 23-May-2000 dcs

Document abial's .#.


60710 19-May-2000 dcs

One of loaders' bugs disappeared somewhere along the way.


60704 19-May-2000 dcs

Move man page directives to common/Makefile.inc.


60684 18-May-2000 dcs

Make corrections to allow for Alpha.


60506 13-May-2000 dfr

Only probe network settings on the first open of the network device.
The alpha firmware takes a seriously long time to open the network device
the first time.


60490 13-May-2000 obrien

The loader was written so that if /kernel was missing /kernel.old would
be booted. Due to a bug, this wasn't happening.

There is still a lesser bug in that the loader decides which file to boot
after the 10sec count down. This means the bootfile listed in the count
down in is wrong in the case where the loader will boot /kernel.old.


60432 12-May-2000 bp

long != int on Alphas.


60006 04-May-2000 dcs

Make documentation on recently added heap? command reflect reality.


60005 04-May-2000 dcs

Add "heap?" to loader's man page.


60003 04-May-2000 dcs

Further improve ordering.


60002 04-May-2000 dcs

Sort entries in FreeBSD-specific FICL commands.


59874 01-May-2000 peter

Add $FreeBSD$


59857 01-May-2000 peter

GC unused variable (size)


59856 01-May-2000 peter

Fix some warnings on the Alpha. sizeof() returns different things on
x86 and Alpha. Sigh.


59854 01-May-2000 bp

Update loader logic to distinguish modules vs. files.
Add support for module metadata. The old way of dependancy
handling will be supported for a while.

Reviewed by: peter


59767 29-Apr-2000 jlemon

Teach the loader about the ext2fs filesystem, extended partitions, and
the new readdir function.


59408 20-Apr-2000 ps

Add a cleanup function. This is needed for PXE where you should
shutdown the UNDI and unload the stack.


59294 16-Apr-2000 msmith

Some more i386-only BIOS-friendliness:

- Add support for using the PCI BIOS functions for configuration space
accesses, and make this the default.

- Make PNPBIOS the default (obsoletes the PNPBIOS config option).

- Add two new boot-time tunables to disable each of the above.


58080 15-Mar-2000 dcs

bcache_strategy() now receives an unit number, and keep track of what
was the last unit number received. If it changes, it flushes the cache.
Add bcache_flash().

The actual fix is sligthly different from the one in the PR.

PR: 17098
Submitted by: John Hood <jhood@sitaranetworks.com>


57468 25-Feb-2000 bp

Fix the loader to handle module dependencies properly. More fixes
will be provided after modmetadata appears in the kernel.

Reviewed by: msmith
Approved by: jkh


57269 17-Feb-2000 msmith

Close a file descriptor leak in the code which loads file objects.

Submitted by: Paul Saab <paul@mu.org>
Approved by: jkh


55206 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


55173 28-Dec-1999 msmith

Correctly handle a user-requested abort in the middle of displaying a
help subtopic.

PR: kern/13196
Submitted by: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>


54695 16-Dec-1999 marcel

Don't build gensetdefs when we can use /usr/bin/gensetdefs. The latter
also creates setdef{0|1}.c so there's no need to have those in the
repository. Using /usr/bin/gensetdefs has no consequences for the
output.


54264 07-Dec-1999 msmith

Update to reflect use of : not ; as separator in paths passed to the
kernel.


53993 01-Dec-1999 dcs

Add fairings. Do not depend on user actually supplying the arguments
he is supposed to supply.


53786 27-Nov-1999 dcs

Make the prompt look like on OpenBoot.


52748 01-Nov-1999 dcs

Changes the default prompt to "ok".

Mike says the whole idea of a current device was a bad idea in first place,
and will be doing away with currdev.

Anyway, people are not supposed to even notice this. :-)


51786 29-Sep-1999 dcs

Bring in ficl version 2.03. No version bump for loader.


50737 01-Sep-1999 dfr

* Fix a stack of warnings.
* Make it possible to type a filename to boot1 so that it is possible to
recover from fatally broken versions of /boot/loader.
* Make a start at a CD boot program (not yet functional).


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49191 28-Jul-1999 nik

Fix some typos.

PR: docs/11955
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>


48952 21-Jul-1999 msmith

Walk around the end of all the silly guessing of device types and unit
numbers that we have been doing in the past, and read /etc/fstab off the
proposed root filesystem to determine the actual device name and vfs
type for the root filesystem. These are then exported to the kernel
via the environment variable vfs.root.mountfrom.


48829 15-Jul-1999 n_hibma

The boot countdown timer says it will boot in 1 seconds,
which is grammatically incorrect.

PR: 12628
Submitted-By: R. Matthew Emerson <rme@nightfly.apk.net>


48477 02-Jul-1999 msmith

Document the hw.physmem tunable. (There should be arch-specific tunable
help sections.)


48351 29-Jun-1999 peter

Reconcile all the loader newvers.sh's into one common one.


48243 26-Jun-1999 peter

ABS_SET() and BSS_SET() are no longer used. The sole remaining user of
TEXT_SET() is DDB's command tables.


48135 23-Jun-1999 ru

-mdoc fix.


47609 30-May-1999 dfr

Typo: "can't boot 'boot'" should be "can't boot 'kernel'"


47576 28-May-1999 brian

Always output a linefeed when we've decided whether to boot
or display a loader prompt; either we've said
"Booting [%s]..." or we've received a non-line-feed character
and need a '\n' anyway.


47395 22-May-1999 rnordier

Fix a reference to the mysterious Mike Smisth.


47011 11-May-1999 jb

Found the needle in the haystack!

Use colons instead of semi-colons in the default init_path to behave like
UNIX instead of DOS.

Suggested by: bde
Reminded by: des (with no hint as to *which* man page).


46356 03-May-1999 dfr

Changes to support diskless booting on the alpha:
* Make the network code in the bootstrap more chatty (helps debugging)
* Add nfs root stuff to cpu_rootconf(). I also added a check to make sure
it really was netbooting which allows the use of the same kernel for local
and network boots.
* Tweak the de driver so that it takes the speed setting from the console
for the alpha (some PWSs have broken de chipsets). This is the same
behaviour as NetBSD/alpha.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


46354 03-May-1999 jkoshy

Correct typos.

PR: docs/11445
Submitted by: Kazuo Horikawa <horikawa@jp.freebsd.org>


46074 25-Apr-1999 dcs

Make man page reflect reality on parsing rules. Now I know Jordan
never read this man page... :-)


45881 20-Apr-1999 des

Make the location of init(8) tunable at boot time.


45867 20-Apr-1999 joerg

Don't clobber the "prompt" variable if it has already been set (e. g.
from within loader.conf).

Reviewed by: dcs


45720 16-Apr-1999 peter

Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition. eisa, isapnp and pccard* are
not yet using the new resource manager. Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
ATA driver to the Alpha. Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by: core


44780 15-Mar-1999 dcs

The man page, version 0.1.


44750 14-Mar-1999 msmith

Fix syntax for boot command

Noticed by: Ruslan Ermilov <ru@ucb.crimea.ua>


44571 08-Mar-1999 dcs

Increase ficl's dictionary size, in preparation for the newer loader.rc.


44570 08-Mar-1999 dcs

Fix a number of memory leaks and other memory-related disorders.

Also, unbreak the breakage introduced at the last revision of module.c.
This changes the semantics of mod_searchfile() (and mod_searchmodule())
to make the caller's responsibility freeing the buffer returned. This
is different from other functions in loader's code, and was done as a
fix for kern/9631. If someone wants to revert this to the original
behavior, don't forget to fix kern/9631 in another way.

This should also fix bin/10462, which was introduced as a result of the
first try at kern/9631 (module.c last revision).

PR: bin/10462
Submitted by: Takanori Saneto <sanewo@ba2.so-net.ne.jp>


44427 02-Mar-1999 dcs

Don't treat empty lines as end-of-file in include(). (I can't
believe this bug is still here... :-( )


44210 22-Feb-1999 dcs

Fix assorted memory leak/buffer reuse problems.

Not restricted to, but including:

PR: kern/9631
Submitted by: Bill Fenner <fenner@parc.xerox.com>


44069 15-Feb-1999 tegge

Enable load of i386 ELF kernels with larger KVA range (e.g. starting at
0xe0100000u or 0xc0100000u instead of the usual 0xf0100000u).


43738 07-Feb-1999 dcs

Remove strange-looking quotes. This part of the code is #if'ed out,
and the variable doesn't even exist (though it is referenced elsewhere).
Just make sure it produces error messages when Mike get back to it.

PR: kern/9934
Submitted by: Adrian Filipi-Martin


43614 04-Feb-1999 dcs

Make use of prototypes to silence warnings.

Change include() so it will be able to load files with forth code,
instead of just builtins. Remove #@- from the include section of the
help file, since they don't work in the new version of include, unless
BOOT_FORTH is not defined.

Change bf_run() so it will return the result returned by ficlExec(). Also,
make bf_run() push "interpret" to be executed by ficlExec(), since ficlExec()
doesn't do it by itself. (Things worked previously because nothing
recursed through ficlExec() by the way of bf_run()).

Change/extend comments on builtin behavior.

Search for "interpret" at the end of bf_init(), so /boot/boot.4th can
provide it's own version.

Remove dead code.


43600 04-Feb-1999 dcs

Silence a warning.
PR: bin/9754


43563 03-Feb-1999 msmith

Mention the net.inet.tcp.tcbhashsize tunable.


43561 03-Feb-1999 kato

PC98 version of new boot loader. Because boot2 has not yet ported,
files in boot2 directory are copies from legacy biosboot.

Submitted by: IMAI Takeshi <take-i@ceres.dti.ne.jp>


43491 01-Feb-1999 jkh

Whoops! Forgot to include Mr. Sobray's more command in the last set
of commits.

Submitted by: Daniel C. Sobral <dcs@newsguy.com>


43368 29-Jan-1999 msmith

Document the machdep.pccard.pcic_irq tunable, which allows the user to tune
the interrupt which will be given to the PCIC. If the value supplied is
illegal or not available, interrupts will be turned off and polled mode
used instead.


43321 28-Jan-1999 jkh

Make builtin's state-aware in loader.

Submitted by: Daniel C. Sobral
PR: 9663


43189 25-Jan-1999 rnordier

Correctly record the end of the a.out symbol table. In practice, a
bootinfo structure where bi_esymtab < bi_symtab was being passed
to the kernel. In the case of older 2.x kernels, this was causing
garbage to be printed to the video console, followed by an exception.

This should resolve a problem reported on -current by Peter Jeremy
<peter.jeremy@auss2.alcatel.com.au>.


43077 22-Jan-1999 msmith

bootstrap.h
help.common
interp.c
Rename the 'source' command to 'include' in order to avoid conflict
with the ANS Forth command of the same name. (kern/9473)

interp_forth.c:
Changes from kern/9412 (EXCEPTION word), kern/9442 (TIB buffer
sizing) and an improved version of kern/9460 (set
version numbers).

load_aout.c:
Trim some obsolete #if 0'ed cruft.

pnp.c:
Tidy the pnpscan output, turn off the module scanning until we
sort out how to do it right.

PR: kern/9412 kern/9442 kern/9460 kern/9473
Submitted by: PRs from Daniel Sobral <dcs@newsguy.com>


43072 22-Jan-1999 rnordier

Fix extraneous free() on error.


43016 21-Jan-1999 msmith

Add 'set tunables' help, list the kernel tunable values that can currently
be overridden.


42807 18-Jan-1999 msmith

Transition from using Perl to using awk for our text-manipulation
needs. This removes the dependancy on Perl for the generation of the
loader, allowing the world to be built on a perl-free system.

Submitted by: Joe Abley <jabley@clear.co.nz>


42713 16-Jan-1999 jdp

Replace duplicated "old" linker set definitions with an include of
<sys/linker_set.h>. Note, this isn't used on the i386.


42682 15-Jan-1999 abial

Fall back to /boot/boot.conf, if /boot/loader.rc was not fount. This is
to cover the transition period.

Suggested by: msmith


42636 13-Jan-1999 abial

Change /boot/boot.conf to /boot/loader.rc - this name reflects what it
really is.

Agreed upon by: jkh, msmith and many others


42620 13-Jan-1999 msmith

Typo in patch application.

PR: kern/9459
Submitted by: "Daniel C. Sobral" <dcs@newsguy.com>


42512 11-Jan-1999 msmith

No builtin command resets getopt before using it, causing
problems in case a wrong option was given previously, and no option
is given to the next command.

PR: kern/9371
Submitted by: "Daniel C. Sobral" <dcs@newsguy.com>


42465 10-Jan-1999 msmith

Enable escapes for $ to make it possible to insert variable names into
other variable values.


42418 09-Jan-1999 msmith

Add a description for 'lsdev' so that it shows up in the '?' display


42290 04-Jan-1999 peter

Fix variable initialization.. It was written with '==' instead of '-'.
#include <string.h> for string prototypes.


42289 04-Jan-1999 peter

Clean some unused variables lint


42288 04-Jan-1999 peter

Don't forget a trailing \n when loading a kernel that has been stripped.
(This might make ELF_VERBOSE look funny, but I'm tempted to delete that
anyway)


42000 22-Dec-1998 abial

* Begin integration of built-ins with Forth: leave the exit code from
a built-in command on Forth stack.
* Fix a bug which was causing a panic when loading stripped aout kernels.

Reviewed by: jkh


41861 16-Dec-1998 n_hibma

Removed dynamic loading of FileHandle


41822 15-Dec-1998 msmith

Reformat help to improve subtopic display appearance, other minor
cleaning. The 'help' command in the loader should now be usable and
hopefully informative.


41821 15-Dec-1998 msmith

Build the composite help file from the generic and architecture-specific
help files, sorting topics and subtopics to allow maximum flexibility.


41259 20-Nov-1998 archie

Fix misallocation of buffer bug (too short)


41254 19-Nov-1998 paul

This fixes a bug in the bcache code whereby false cache hits occur
the first time block 0 is read. This fix initialises the block
numbers to -1 which isn't the most correct thing for a daddr_t but
it isn't likely to cause a problem in the boot blocks and it could
do with a more thought out fix later.

The bug is probably benign on the i386 but on the alpha it can
cause initial file opens to fail. This is the cause of the "can't
open /boot/boot.conf" errors.

It appears on the alpha because of a number of combining factors.
On the alpha the LABELSECTOR is 0 so block 0 needs to be read in
from the media. The first time this happens you get a false hit
because the bc_blkno field is zero initially. Also, the timestamp
check against this cache hit succeeds because on the alpha a hacked
getsecs() function can return 0 when it starts counting so that
the zero initial timestamp + BCACHE_TIMEOUT is greater than the
current time until getsecs() has counted passed BCACHE_TIMEOUT.

The overall effect is that the first open() that occurs gets a
false cache hit and returns garbage to the bd_strategy() function
which then fails the open() call. This false hit then stays in the
cache until BCACHE_TIMEOUT getsecs() ticks have passed; all open()
calls during this time fail.

This explains why you can generally access the media by the time
you get to interp() and start issuing commands but the earlier
attempts to run the boot scripts are failing.

It's possible that this is causing the problem switching to the
mfsroot floppy as well but I haven't confirmed that.


41140 13-Nov-1998 msmith

Add documentation for $rootdev.


40988 07-Nov-1998 jkh

Eliminate much code cruft by extending simple file I/O API to include
fopen and fclose. Also look for /boot/boot.4th now and, if found,
load its contents.


40984 07-Nov-1998 jkh

Don't have debugging on by default - it makes testing annoying. :)


40950 06-Nov-1998 msmith

Ack. Create parseable command tail properly, and eat args out of the TIB.


40948 06-Nov-1998 msmith

Don't use the poxy vmGetString interface (who uses counted strings these
days?), get the input buffer ourselves. Add some debugging code.


40929 05-Nov-1998 jkh

Remember a bit more of my forth and do:

o Add fexists word to check for the presence of a file
o make fexists and fload immediate words which DTRT both interpreted
and compiled (doh!)
o add an init word which gets run at bootstrapping time to do extra
post-coldload initialization (in the default implementation, we
look for /boot/boot.4th and load it if found).


40882 04-Nov-1998 msmith

Use a smaller default dictionary to waste less space.


40875 04-Nov-1998 msmith

Add BootForth hooks; if BOOT_FORTH is defined, pass every line read
to the Forth interpreter. Instantiate all of our inbuilt commands
as Forth words, and handle them being called from there.

Add my copyright to the bcache module (oops).


40835 02-Nov-1998 msmith

Ok, the entry aging algorithm sucked; 1s time resolution is not enough for
LRU. Use a 31-bit counter instead. If we decide to do heavy I/O through
the bootloader this will have to be revisited.


40834 02-Nov-1998 msmith

Implement a simple LRU block cache. By default this is initialised to 16k,
and will bypass transfers for more than 8k. Blocks are invalidated after
2 seconds, so removable media should not confuse the cache.

The 8k threshold is a compromise; all UFS transfers performed by
libstand are 8k or less, so large file reads thrash the cache.
However many filesystem metadata operations are also performed using
8k blocks, so using a lower threshold gives poor performance.

Those of you with an eye for cache algorithms are welcome to tell me
how badly this one sucks; you can start with the 'bcachestats' command
which will print the contents of the cache and access statistics.


40832 02-Nov-1998 msmith

Standardise on ';' as a component separator; it seems to be a little more
common than ','.


40793 31-Oct-1998 dfr

* Extend the memory available for the heap from 256k to 512k.
* Embed the stack into the bss section for loader and netboot. This
is required for netboot since otherwise the stack would be inside our
heap.
* Install loader and netboot in /boot by default.
* Fix getbootfile so that it searches for a ',' instead of a ';'
when terminating the filename.


40775 31-Oct-1998 msmith

- Add a new command 'lsdev' to list devices which might be likely to host
filesystems.
- New 'help' command and data in the help.* files (not yet installed),
provides topic and subtopic help, indexes, etc.
- Don't crash if the user tries to set an invalid console. Be helpful
instead.
- Expand tabs (badly) on the i386 video console.
- Some minor cosmetic changes.


40597 22-Oct-1998 msmith

Export an interface for presetting the ISA PnP read port address.
Make the EISA ID formatter generally available


40553 21-Oct-1998 msmith

Make ISA PnP work. This successfully enumerates as many ISA devices as I
can fit into my test machine.

- Move to using STAILQs rather than ad-hoc singly-linked lists.
- Use a mostly procedural interface to the PnP information. This
improves data-hiding.

Implement a new linker-set technique (currently on i386 only but should work
on Alpha as well). This is a good candidate for replacing the current
gensetdefs cruft completely.


40465 17-Oct-1998 peter

Load the first page of the file and use the headers in it. This should
avoid the need to seek back to offset zero which is causing trouble on
the Alpha with a gzipped kernel.


40429 16-Oct-1998 peter

"fix" the gzipped kernel load problem by having the loader check that it
can seek back to the first PT_LOAD and doing a close/reopen if it cannot.
This is because the first PT_LOAD section includes the ELF headers.
This fixes gzipped kernels on the i386, it should solve mike's problem
for the Alpha.


40414 15-Oct-1998 dfr

Change some printfs so that ELF_VERBOSE prints meaningful values on the alpha.


40327 14-Oct-1998 peter

Tweak the output one more time again. The kernel or module pathname
is useful, and usually fits all on one line with the load sizes.


40291 13-Oct-1998 peter

Make the ELF load messages cleaner.


40254 12-Oct-1998 peter

Only print kernel entry point during load.
Drastically quieten down the verbose load progress messages. They were
more useful for debugging than anything, but are beyond a joke when loading
a few dozen modules.
Simplify the ELF extended symbol table load format. Just take the main
symbol table and the string table that corresponds. This is what we will
be getting local symbols from. (needed for the alpha stack tracebacks).
Use the (optional) full symbol tables in lookups. This means we have to
furhter distinguish between symbols that can come from the dynamic linking
table and the complete table.
The alpha boot code now needs to be adapted as ddb/db_elf.c cannot use
the simpler format.
I have not implemented loading the extended symbol tables from the syscall
interface yet, just for preloaded modules.
I am not sure about the symbol resolution. I *think* it's possible that
a local symbol can be found in preference to a global, depending on the
search sequence and dependency tree.


40253 12-Oct-1998 peter

Only print filename and entry address for the kernel itself. The rest
have a meaningless entry as they are relocatable.


40215 11-Oct-1998 peter

Fix a warning


40214 11-Oct-1998 peter

Probe all consoles, not just the first. It doesn't make a lot of
difference, but might later on when we implement some sort of multi-head
console mode. Select a console after probing them all.
Don't strdup a potentially NULL return from getenv().
If we don't select an active console, choose the first regardless.
Call the console init function, at startup time and on a manual change.
The env_setenv() function needs EV_VOLATILE because it's pointing to
data that isn't malloc'ed and will cause a fault if it's freed later.


40213 11-Oct-1998 peter

Cosmetic: After the autoboot timeout, print a \n.


40143 09-Oct-1998 peter

Implement preloading for elf modules
- get dependency info from PT_DYNAMIC's DT_NEEDED tags.
- store MODINFOMD_DYNAMIC for the kernel's later use
setenv kernelname when we have it
Fix firstaddr/lastaddr calculation (duh! :-)
Explicitly skip string table with section names in it.


40142 09-Oct-1998 peter

Preload support for a.out KLD not implemented yet. (almost)
KLD modules are *not* PIC. (Shared libs are pic to avoid relocations
causing copy-on-write, that's irrelevant here).
setenv kernelname when we load it.
Use MODINFO_SSYM/ESYM for each symbol section when (if) there are
more than one being loaded.


40141 09-Oct-1998 peter

Use a consistant module search path (same as kernel will be).
Use new dependency mechanism.


40140 09-Oct-1998 peter

loader <-> kernel preload module interface constants moved to common file.
Remove Mike's explicit data structures for dependency info. This is
done via DT_NEEDED etc in the dynamic section for now. This may need
to be revisited later on.


40106 09-Oct-1998 msmith

Sync the MODINFO constants with <sys/linker.h>
Remove debugging in command_read().
Correctly strip leading controls on script commands.
Make 'ls' more DWIM in regard to pathnames. We can still do better.


40015 07-Oct-1998 msmith

- VERBOSE_LS is obsolete, as the heap is much better behaved now.
- Don't whine about nodes we can't stat(); these are usually
symlinks that lead out of the filesystem.
- Autoboot is now controlled by $autoboot_delay, which is a value
in seconds or NO to disable autoboot.
- Don't autoboot at the end of boot.conf if we have already tried.
- Add a 'read' command to complement 'echo'. Both are still hidden.
- Improve the 'source' command/function so that it is possible to
source scripts off removable media. The entire script is read and
saved before beginning execution. Script lines beginning with
'@' will not be echoed when being executed. Script execution will
normally terminate at the first error, however if the script line
begins with '-' this behaviour is overriden for that command.


39968 05-Oct-1998 msmith

Insert whitespace between unargv'd arguments.
Submitted by: "Louis A. Mamakos" <louie@TransSys.COM>


39894 02-Oct-1998 msmith

boot.c
Increase the robustness of the "is it time to boot yet" test;
if the time skipped the "when" time, we would miss it.
Don't spin in an endless loop if we don't find the first possible
kernel suggested. When we run out, don't try to load an empty
kernel name.

load_aout.c
printf format warnings


39887 02-Oct-1998 peter

First shot at loading elf symbols. Things are a bit strange because
of the ..umm.. "wierd" way binutils lays out the file. The section
headers are nearly at the end of the file and this is a problem when
loading from a .gz file which can't seek backwards (or has a limited
reverse seek, ~2K from memory).

This is intended to be compatable with the ddb/db_elf.c code and the
alpha/libalpha/elf_freebsd.c layout. I've studied these (which are NetBSD
derived) but did it a bit differently. Naturally the process is similar
since it's supposed to end up with the same result.


39830 30-Sep-1998 peter

ELF loader, part 1. It works with ELF kernels generated on the i386
so far, and should probably be able to be made to work for the alpha
without too much trouble once it's connected up and my assumptions tested.

I think (but have not tested) it will also load "old" ELF kernels that
were not linked with DYNAMIC headers.

The module glue is yet to come. (oh fun.. :-)

It does not explicitly load symbols [yet]. The _DYNAMIC data contains a
runtime symbol set that ddb can use via ddb/db_kld.c. It'll be missing
some detail that stabs normally provides (eg: number of args to a function,
line numbers, etc). On the other hand, those minimal symbols will always
be available even on a stripped kernel.

This is mostly stolen from load_aout.c with some ideas from
alpha/libalpha/elf_freebsd.c.


39828 30-Sep-1998 peter

s/out_loadmodule/aout_loadmodule/ in a printf diagnostic.


39827 30-Sep-1998 peter

Uncomment prototype for elf_loadmodule


39732 28-Sep-1998 peter

Use the variable with the path in it for the error message.


39673 26-Sep-1998 dfr

* Add old UFS compatibility code to alpha/boot1.
* Fix a raft of warnings, printf and otherwise.
* Allocate the correct amount in mod_searchmodule to prevent an overflow.
* Fix the makefiles so they work outside my home directory (oops).


39660 26-Sep-1998 msmith

console.c
Allow the MI code to override the preferred console (eg. so that
an RB_SERIAL flag from the i386 boot2 can override the default
first active console)

isapnp.c
Use the standard format for ISA PnP IDs.

pnp.c
Allow trailing comments on lines, be less picky about line
contents.

ls.c
Cosmetic error message fix.

panic.c
Print the right arguments.


39530 20-Sep-1998 dfr

Make the alpha bootstrap build again, fix some warning and change sdboot to daboot.


39472 19-Sep-1998 msmith

Add a generic hexdump tool for debugging purposes.


39448 18-Sep-1998 msmith

Remove 'panic' command (it works), don't ask for a keypress in panic, as
exit() does. Perhaps it shouldn't?


39446 18-Sep-1998 msmith

Use a.out.h to get all the correct bits in one place.


39444 18-Sep-1998 msmith

Oops, missed these. Machine-independant ISA PnP enumerator.


39441 17-Sep-1998 msmith

Initial integration of the i386 bootloader and BTX.

- Discard large amounts of BIOS-related code in favour of the more compact
BTX vm86 interface.
- Build the loader module as ELF, although the resulting object is a.out,
make gensetdefs 32/64-bit sensitive and use a single copy of it.
- Throw away installboot, as it's no longer required.
- Use direct bcopy operations in the i386_copy module, as BTX
maps the first 16M of memory. Check operations against the
detected size of actual memory.


39178 14-Sep-1998 msmith

Resynch with working sources before BTX integration.

- Use format-independant module allocator.
- Conditionalise ISA PnP support.
- Simplify PnP enumerator interface.
- Improve module/object searching.
- Add missing depend/install targets in BTX makefiles.
- Pass the kernel environment and module data in extended bootinfo fields.
- Add a pointer to the end of the kernel + modules in bootinfo.
- Fix parsing of old-style kernel arguments.


38789 04-Sep-1998 msmith

Generic plug-and-play enumerator infrastructure. Query supplied
enumerators, crossreference returned identifiers with a text-format
database and automatically load corresponding modules and dependancies.


38765 03-Sep-1998 jkh

Allow quoted strings (single or double) for grouping whitespace separated
items. Eliminate warnings.


38764 03-Sep-1998 msmith

Bootstrap updates.

- Move some startup code from MD to MI sections
- Add a 'copyout' and some copyout-related functions. These will be
obsoleted when BTX is available for the 386 and the kernel load
area becomes directly addressable.
- Add the ability load an arbitrary file as a module, associating
and arbitrary type string with it. This can be used eg. for loading
splash-screen images etc.
- Add KLD module dependancy infrastructure. We know how to look for
dependancies inside KLD modules, how to resolve these dependancies
and what to do if things go wrong. Only works for a.out at the
moment, due to lack of an MI ELF loader. Attach KLD module information
to loaded modules as metadata, but don't pass it to the kernel (it
can find it itself).
- Load a.out KLD modules on a page boundary. Only pad the a.out BSS
for the kernel, as it may want to throw symbols away. (We might want
to do this for KLD modules too.)
- Allow commands to be hidden from the '?' display, to avoid cluttering
it with things like 'echo'. Add 'echo'.
- Bring the 'prompt' command into line with the parser syntax.
- Fix the verbose 'ls'; it was using an uninitialised stack variable.
- Add a '-v' flag to 'lsmod' to have it display module metadata as well
(not terribly useful for the average user)
- Support a 'module searchpath' for required modules.
- The bootstrap file on i386 is now called 'loader' to permit the
/boot directory to use that name.
- Discard the old i386 pread() function, as it's replaced by
arch_readin()


38716 01-Sep-1998 msmith

New commandline/script parser, supports backslash quoting and environment
variable substitution.

Submitted by: Jordan Hubbard <jkh@freebsd.org>


38712 31-Aug-1998 msmith

Bootloader update.

- Implement a new copyin/readin interface for loading modules.
This allows the module loaders to become MI, reducing code duplication.
- Simplify the search for an image activator for the loaded kernel.
- Use the common module management code for all module metadata.
- Add an 'unload' command that throws everything away.
- Move the a.out module loader to MI code, add support for a.out
kld modules.

Submitted by: Alpha changes fixed by Doug Rabson <dfr@freebsd.org>


38475 22-Aug-1998 dfr

Minor tweaks to track a couple of i386 changes and to make it compile.


38466 21-Aug-1998 msmith

This commit was generated by cvs2svn to compensate for changes in r38465,
which included commits to RCS files with non-trunk default branches.