Use FreeBSD boot code for installation images
Currently the installation images boot using GRUB despite the installed system using FreeBSD's loader.
This runs into problems on existing systems where GRUB is failing (see #27432).
We should move the installation images to use the FreeBSD boot code too.
#1 Updated by Benno Rice about 2 years ago
Summary of needed changes:
- Need loader support files, loader, and cdboot in /boot on the install filesystem.
- Need code to create an EFI filesystem image containing loader.efi as efi/boot/bootx64.efi. This then needs to be put in the image directory.
- Need to update the ISO creation command to be something like the following:
xorriso -as mkisofs -graft-points --modification-date=[BUILD DATE] -b /boot/cdboot -no-emul-boot --efi-boot [EFI BOOT IMAGE] \ -o [OUTPUT FILE NAME] -r --sort-weight 0 / --sort-weight 1 /boot [IMAGE SRC DIRECTORY] --volid FreeNAS
#4 Updated by Benno Rice about 2 years ago
I've got a proof of concept image that appears to work, although wider testing suggests some possible issues with Dell UEFI. I also need further loader changes to properly specify the root filesystem to the booted kernel.
I'm currently working on cleaning up the boot2 changes.
#5 Updated by Benno Rice about 2 years ago
So after trying many times to come up with a way to improve the sanity of the boot code without blowing the 8KB limit for MBR/BSD boot code I've given up and have just copied stand/i386/boot2/boot2.c to stand/i386/boot2/isoboot2.c and done it that way.
I'm now building test images to make sure it all works and will then put the results up for review.
#6 Updated by Benno Rice about 2 years ago
Got it working again.
Test image: https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz
Upstream review: https://reviews.freebsd.org/D14799