adapted for ZFS root partition, as grub rescue might not see the ZFS root: (e.g. compression algorithm not found..)
don’t reboot after setup (checkbox before install starts), then abort setup
zpool import -R /mnt rpool -d /dev/disk/by-id/…-part3
plug in boot usb-stick
format usb with msdos partition table
create 512MB ext2 partition, set bootable flag
take note of usb-partition-UUID
mount -t proc /proc /mnt/proc
mount --rbind /dev /mnt/dev
mount --rbind /sys /mnt/sys
chroot /mnt /bin/bash
source /etc/profile
fstab add: UUID=[usb-partition-UUID] /boot auto nosuid,nodev,nofail 0 0
cp -r /boot /boot.old
mount /boot
cp -r /boot.old/* /boot/
update-grub2
update-initramfs -u
grub-install /dev/sd[usb]
umount /boot
exit
zpool export rpool
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
reboot