Based off https://reviews.freebsd.org/D4104
This patch adds ZFS support to the EFI boot and loader programs.
It modifies boot1.efi to use a modular framework, moving the existing UFS code to a UFS module. A ZFS module is provided for ZFS support. In addition to facilitating ZFS support, this also provides a foundation for future work (such as booting from encrypted disks)
It modifies loader.efi to correctly load and launch from a ZFS partition.
On top of the version @ https://reviews.freebsd.org/D4104 this revision:
- Fixes style(9) issues
- Fixes strcpy null termination.
- Fixes strdup allocation size and null termination.
- Fixes none single vdev booting e.g. raidz by taking a copy of dev_info_t in probe.
- Is loud about allocation failures apart from Malloc
- Pays attention to MK_ZFS
- Module structure cleanup
- Removed unused vars and funcs
- Improved error checking
- Enabled compiler warnings
- Fixed void pointer arithmetic warning in lz4.c
- Output probe progress and summary
- Fixed _MSC_EXTENSIONS #if vs #ifdef checks
- Fix strncmp
- Use optimised versions of other support methods based on libkern / libstand
- Added missing copyright headers
- Updated copyright headers for new files to match the prefered header
- Standardise on EFI_ZFS_BOOT vs ZFS_EFI_BOOT
- Make efi_zfs_probe EFI_ZFS_BOOT conditional
- Cleanup libzfs.h includes