I’m here to report success. I have my HiFive Unmatched booted with FreeBSD-current. The FreeBSD page for the HiFive is here: riscv/HiFiveUnmatched - FreeBSD Wiki
Until there is an image to do this, this was my process (I did this on an AMD threadripper, but, in theory, you should be able to do it on any FreeBSD host):
- This proceedure should work for a USB drive or an NVMe drive (I got a USB to NVMe enclosure so I could hook the NVMe drive to my workstation)
- I checked out the git FreeBSD source on my FreeBSD machine.
git clone https://github.com/jrtc27/freebsd-src/tree/unmatched
- I made sure my FreeBSD machine had qemu installed (so that I could cross compile stuff)
- I ran “MAKEOBJDIRPREFIX=~/FreeBSD/obj/ make -j16 TARGET_ARCH=riscv64 buildworld”
- I ran “MAKEOBJDIRPREFIX=~/FreeBSD/obj/ make -j16 TARGET_ARCH=riscv64 buildkernel”
- I partitioned my nvme with GPT: 100 meg EFI, 64G swap, Rest ZFS.
[2:24:24]dgilbert@ump:~/devel/rogue> gpart show
=> 34 3907029101 nda0 GPT (1.8T)
34 6 - free - (3.0K)
40 204800 1 efi (100M)
204840 134217728 2 freebsd-swap (64G)
134422568 3772606560 3 freebsd-zfs (1.8T)
3907029128 7 - free - (3.5K)
- I created and mounted my zfs tree under /mnt. make sure to set bootfs=your boot fs
zpool create -R /mnt zump da0p3
zfs set mountpoint=none zump
zfs create zump/ROOT
zfs create -o mountpoint=/ zump/ROOT/default
zpool set bootfs=zump/ROOT/default
zfs create zump/usr
zfs create -o mountpoint=/usr/local zump/usr/local
zfs create -o mountpoint=/home zump/home
zfs create -o mountpoint=/usr/obj zump/usr/obj
zfs create -o mountpoint=/usr/src zump/usr/src
zfs create -o mountpoint=/usr/ports zump/usr/ports
zfs create zump/var
zfs create -o mountpoint=/var/log zump/var/log
zfs create -o mountpoint=/var/crash zump/var/crash
zfs create -o mountpoint=/var/audit zump/var/audit
zfs create -o mountpoint=/var/cache zump/var/cache
zfs create -o mountpoint=/var/mail zump/var/mail
zfs create -o mountpoint=/var/tmp zump/var/tmp
- I ran “MAKEOBJDIRPREFIX=~/FreeBSD/obj/ make -j16 TARGET_ARCH=riscv64 installworld DESTDIR=/mnt”
- I ran “MAKEOBJDIRPREFIX=~/FreeBSD/obj/ make -j16 TARGET_ARCH=riscv64 installkernel DESTDIR=/mnt”
- I ran “MAKEOBJDIRPREFIX=~/FreeBSD/obj/ make -j16 TARGET_ARCH=riscv64 distribution DESTDIR=/mnt”
- (on edit, because I forgot … I actually even forgot this when I was doing it) edit /mnt/boot/loader.conf to contain the line "zfs_enable=“YES” … if you don’t do that you’ll need to know how to manually load it with the loader, boot single-user, rw mount root, and then edit it… so just do it here.
- export the zfs /mnt
cp /mnt/boot/loader.efi /tmp
zfs export zump
- newfs_msdosfs /dev/da0p1 the 100meg partition.
- mount it and put what was /mnt/boot/loader.efi as /mnt/EFI/BOOT/BOOTRISCV64.EFI on the msdoss partition.
mount_msdosfs /dev/da0p1 /mnt
mkdir -p /mnt/EFI/BOOT
cp /tmp/loader.efi /mnt/EFI/BOOT/BOOTRISC64.EFI
umount /mnt
- attach this media and boot.
… A few cool things to note here: you’ve just compiled a complete operating system from source and installed it onto a new architecture from scratch. Congrats if this is your first real bootstrap!