In 13.0 extra logic is added to use /boot/efi to set the UEFI boot part using efibootmgr. When using ZFS, /boot/efi is never mounted, so the changes are done to /mnt on tmpfs, rendering the system unable to boot. I did this on a VM under ESXI and in https://forums.freebsd.org/threads/unattended-install-on-freebsd13-with-zfs-efi.80296/ it was also checked using VirtualBox, but after further investigation, I think this is unrelated to the install environment, and it should break on any system trying to do unattended install using ZFS and UEFI (or BIOS+UEFI). The initial part of installerconfig that I use: export DISTRIBUTIONS="kernel.txz base.txz localinstall.txz" export INTERFACES="vmx0 vmx1" export ZFSBOOT_VDEV_TYPE=stripe export ZFSBOOT_DISKS=da0 export ZFSBOOT_SWAP_SIZE=2g export ZFSBOOT_CONFIRM_LAYOUT=0 export ZFSBOOT_SWAP_ENCRYPTION=YES export ZFSBOOT_BOOT_TYPE="UEFI" export nonInteractive="YES"
What I did to get it working is edit /usr/libexec/bsdinstall/script on my install medium (coming from NFS, so very convenient): near line 113 : if [ "$ZFSBOOT_DISKS"] ; then bsdinstall zfsboot bsdinstall mount .... near 169: bsdinstall entropy if [ "$ZFSBOOT_DISKS"]; then bsdinstall umount zpool export $ZFSBOOT_POOL_NAME ... This is not a real patch. I have to recreate my install environment from the ISO, and it should contain something like " if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = "BOOT+UEFI" ]; then ... fi", but I'll see what I can do
Created attachment 224888 [details] Suggested patch for unattended install This seems to fix it for me
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=34766aa8cb514472c571f8b0e90e833833acef51 commit 34766aa8cb514472c571f8b0e90e833833acef51 Author: Nathan Whitehorn <nwhitehorn@FreeBSD.org> AuthorDate: 2021-05-14 12:30:41 +0000 Commit: Nathan Whitehorn <nwhitehorn@FreeBSD.org> CommitDate: 2021-05-14 12:30:41 +0000 Fix scripted installs on EFI systems using ZFS root with zfsboot. Unlike attended installations, scripted installs did not mount non-ZFS partitions when ZFS root (via zfsboot) was selected. Since this included the ESP, the EFI loader was not installed. Copy logic from the attended-install path to make this work. PR: 255824, 255081 MFC after: 1 week Obtained from: Mark Huizer usr.sbin/bsdinstall/scripts/script | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
*** Bug 255081 has been marked as a duplicate of this bug. ***
Fix in and MFC'ed. Thanks for the detailed report and patch!
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=4aaf6dd0a6b11accf34ca999465c34e29153680f commit 4aaf6dd0a6b11accf34ca999465c34e29153680f Author: Nathan Whitehorn <nwhitehorn@FreeBSD.org> AuthorDate: 2021-05-14 12:30:41 +0000 Commit: Nathan Whitehorn <nwhitehorn@FreeBSD.org> CommitDate: 2021-05-28 13:43:35 +0000 Fix scripted installs on EFI systems using ZFS root with zfsboot. Unlike attended installations, scripted installs did not mount non-ZFS partitions when ZFS root (via zfsboot) was selected. Since this included the ESP, the EFI loader was not installed. Copy logic from the attended-install path to make this work. PR: 255824, 255081 MFC after: 1 week Obtained from: Mark Huizer (cherry picked from commit 34766aa8cb514472c571f8b0e90e833833acef51) usr.sbin/bsdinstall/scripts/script | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)