freebsd-skq/stand/common
Kyle Evans d3d381b2b1 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.

Reviewed by:	imp, jhb, araujo (earlier version)
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D16945
2018-09-01 02:23:45 +00:00
..
bcache.c
boot.c Transition to boot_env_to_howto and boot_howto_to_env in the boot 2018-07-13 16:43:29 +00:00
bootstrap.h userboot: handle guest interpreter mismatches more intelligently 2018-09-01 02:23:45 +00:00
commands.c loader: cstyle cleanup of command.c 2018-04-16 14:10:19 +00:00
console.c
dev_net.c Revert r333365 2018-05-10 20:27:12 +00:00
dev_net.h
devopen.c Extend loader(8) geli support to all architectures and all disk-like devices. 2018-07-13 17:50:25 +00:00
disk.c stand/common/disk.c: dev->d_offset still needs to be set to 0 2018-07-03 05:53:27 +00:00
disk.h Remove comments and assertions that are no longer valid after r330809. 2018-06-05 22:13:45 +00:00
help.common
install.c Break out the interpreters (simple and forth) w/o ifdefs. This is 2018-01-31 22:46:05 +00:00
interp_backslash.c Move to tabs for indentation and to 8-space notches, per style(9). 2018-02-08 17:07:27 +00:00
interp_forth.c userboot: handle guest interpreter mismatches more intelligently 2018-09-01 02:23:45 +00:00
interp_lua.c userboot: handle guest interpreter mismatches more intelligently 2018-09-01 02:23:45 +00:00
interp_parse.c Move to tabs for indentation and to 8-space notches, per style(9). 2018-02-08 17:07:27 +00:00
interp_simple.c userboot: handle guest interpreter mismatches more intelligently 2018-09-01 02:23:45 +00:00
interp.c Move simple interpreter 'perform' into interp.c and call it 2018-02-07 23:27:38 +00:00
isapnp.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
isapnp.h
load_elf32_obj.c
load_elf32.c
load_elf64_obj.c
load_elf64.c
load_elf_obj.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
load_elf.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
ls.c
Makefile.depend
md.c
merge_help.awk
metadata.c Extend loader(8) geli support to all architectures and all disk-like devices. 2018-07-13 17:50:25 +00:00
misc.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
module.c
newvers.sh
part.c Add an ISO9660 "partition table" type to loader. 2018-04-05 19:45:30 +00:00
part.h Add an ISO9660 "partition table" type to loader. 2018-04-05 19:45:30 +00:00
paths.h Collapse zfsloader functionality back down into loader. 2018-07-20 05:17:37 +00:00
pnp.c Prefer uintXX_t to u_intXX_t 2018-03-13 16:33:00 +00:00
rbx.h
reloc_elf32.c
reloc_elf64.c
reloc_elf.c Skip IRELATIVE relocations when loader processes ELF files. 2018-01-11 13:57:30 +00:00
self_reloc.c
zfs_cmd.c Stop using ../zfs/libzfs.h but instead use libzfs.h. 2018-07-08 07:42:58 +00:00