freebsd-skq/stand/i386
Ian Lepore 7297dc4441 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.

X-MFC after:	a few days, along with prior related changes.
2018-12-04 16:43:50 +00:00
..
boot0 Centralize several variables. 2018-02-02 06:32:26 +00:00
boot0sio
boot2 NM and OBJCOPY are already defined for all builds. There's no need to 2018-07-20 05:17:56 +00:00
btx btx: rename .s files to .S to use Clang IAS 2018-11-26 19:14:33 +00:00
cdboot Centralize several variables. 2018-02-02 06:32:26 +00:00
common Fix args cross-threading between gptboot(8) and loader(8) with zfs support. 2018-12-04 16:43:50 +00:00
gptboot Fix args cross-threading between gptboot(8) and loader(8) with zfs support. 2018-12-04 16:43:50 +00:00
gptzfsboot NM and OBJCOPY are already defined for all builds. There's no need to 2018-07-20 05:17:56 +00:00
isoboot isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general 2018-08-09 02:06:25 +00:00
kgzldr stand/i386: rename .s to .S to use Clang IAS 2018-12-03 19:16:34 +00:00
libfirewire fwohcireg.h is 99% the same between the boot loader and the 2018-03-31 22:02:59 +00:00
libi386 loader: create separate lists for fd, cd and hd, merge bioscd with biosdisk 2018-11-30 08:01:11 +00:00
loader Fix args cross-threading between gptboot(8) and loader(8) with zfs support. 2018-12-04 16:43:50 +00:00
loader_4th Create a loader for each interpreter for x86 BIOS and all EFI 2018-08-14 18:44:41 +00:00
loader_lua Create a loader for each interpreter for x86 BIOS and all EFI 2018-08-14 18:44:41 +00:00
loader_simp Create a loader for each interpreter for x86 BIOS and all EFI 2018-08-14 18:44:41 +00:00
mbr stand/i386: rename .s to .S to use Clang IAS 2018-12-03 19:16:34 +00:00
pmbr stand/i386: rename .s to .S to use Clang IAS 2018-12-03 19:16:34 +00:00
pxeldr Bump the date of pxeboot(8) manual page for r340917. 2018-11-27 08:51:15 +00:00
zfsboot Eliminate duplicated code and struct member definitions in the handoff 2018-12-03 03:58:30 +00:00
boot.ldscript
Makefile Create a loader for each interpreter for x86 BIOS and all EFI 2018-08-14 18:44:41 +00:00
Makefile.inc Disable build-id in i386 binary boot components 2018-11-23 13:50:18 +00:00