View Single Post
  #6   (View Single Post)  
Old 20th October 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
Join Date: Oct 2013
Location: EST USA
Posts: 314
Thumbs up Solved

This worked! The system is a typical root on a two-disk ZFS mirror (ada0, ada1) installed from FreeBSD-11.1-RELEASE-amd64-memstick.img. After that, a USB flash drive (da0) is configured to load UEFI like this:
gpart destroy -F da0
gpart create -s gpt da0
gpart add -s 800K -t efi da0
gpart add -t freebsd-ufs da0
gpart show da0
=>      40  31260592  da0  GPT  (15G)
        40      1600    1  efi  (800K)
      1640  31258992    2  freebsd-ufs  (15G)

newfs_msdos da0p1 
newfs -t da0p2
mount -t msdosfs /dev/da0p1 /mnt
mkdir -p /mnt/efi/boot
cp /boot/boot1.efi /mnt/efi/boot/BOOTx64.efi
mkdir -p /mnt/boot
cat > /mnt/boot/loader.rc << EOF
set currdev=zfs:zroot/ROOT/default:
load boot/kernel/kernel
load boot/kernel/zfs.ko
I was very surprised this worked but it seems to be getting the job done.

Edit: I forgot to mention that the machine's BIOS was configured to boot from the flash drive (da0) in UEFI mode for this to work.

Last edited by hanzer; 20th October 2017 at 11:00 PM.
Reply With Quote