#
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.
|
#
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. |
#
262331 |
|
22-Feb-2014 |
grehan |
ZFS boot support for bhyveload.
Modelled after the i386 zfsloader. However, with no 2nd stage zfsboot to search for a bootable dataset, attempt a ZFS boot if there is more than one ZFS dataset found during the disk probe.
sys/boot/userboot/zfs - build the ZFS boot library
sys/boot/userboot/userboot/ conf.c - Add the ZFS pool and filesystem tables devicename.c - correctly format ZFS devices main.c - increase the size of the libstand malloc pool to account for the increased usage from ZFS buffers - probe for a ZFS dataset, and if one is found, attempt to boot from it.
usr.sbin/bhyveload/bhyveload.c - allow multiple invocations of the '-d' option to specify multiple disks e.g. a raidz set. Up to 32 disks are supported.
Tested with various combinations of GPT, MBR, single and multiple disks, RAID-Z, mirrors.
Reviewed by: neel Discussed with: avg Tested by: Michael Dexter and others MFC after: 3 weeks
|