EFI drivers forward to TrueOS in HBSD

My ESP is on /dev/ada0p6 and mounted on /boot/efi then I’ve copied EFI drivers BOOTx64.EFI, boot1.efi, loader.efi from /boot to /boot/efi/efi/hbsd and I have HBSD installed on /dev/ada0p1, but BOOTx64.EFI and boot1.efi are forwarded to TrueOS-STABLE as fallback, also loader.efi doesn’t mount any partitions and always frozen inside single user.
Newnix has told to me in Telegram, which these EFI drivers are needed to be configured using EFI shells, to ask them to mount /dev/ada0p1 for HBSD. How to do so and what other configs to do?

Any tip in handbook? https://hardenedbsd.org/~shawn/hbsd_handbook/book.html

1 Like

I’ve also researched for https://FreeBSD.org/cgi/man.cgi?query=uefi and https://www.freebsd.org/cgi/man.cgi?query=gptboot, now I have ideas to config this.:grin:

1 Like

That handbook is useless to my issue, I mean all the BSD-based EFI drivers always show no UFS partitions, then I can never properly boot HBSD. Note that my /boot/loader.conf and /boot/loader.rc are empty.

These guides are for NetBSD, but have a look and see if any of them can give you some hints.



I forgot this one…
If the HBSD installer is also being worked on, maybe it already supports something along the lines in the wiki article above :thinking:

My own HBSD EFI config script below,

mkdir -pv /boot/efi
mount -t msdosfs /dev/ada0p6 /boot/efi
nano /boot/loader.conf

menu=Boot normally:rndseed /etc/entropy-file;boot ufs:ada0p1
menu=Boot single user:rndseed /etc/entropy-file;boot ufs:ada0p1 -s
menu=Disable ACPI:rndseed /etc/entropy-file;boot ufs:ada0p1 -2
menu=Disable ACPI and SMP:rndseed /etc/entropy-file;boot ufs:ada0p1 -12
menu=Drop to boot prompt:prompt
timeout=15 #HBSD installer at least times out 10 seconds

nano /boot/loader.rc

include /boot/loader.conf
include /boot/loader.4th

gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 21 ada0
gpart set -a bootme -i 1 ada0
gpart set -a bootonce -i 1 ada0

Based on this from the original NetBSD script,

mount -t msdos /dev/wd0a /media
mkdir -p /media/EFI/boot
cp /usr/mdec/*.efi /media/EFI/boot
nano /media/EFI/boot/boot.cfg

menu=Boot normally:rndseed /etc/entropy-file;boot hd0b:netbsd
menu=Boot single user:rndseed /etc/entropy-file;boot hd0b:netbsd -s
menu=Disable ACPI:rndseed /etc/entropy-file;boot hd0b:netbsd -2
menu=Disable ACPI and SMP:rndseed /etc/entropy-file;boot hd0b:netbsd -12
menu=Drop to boot prompt:prompt

installboot -v /dev/rwd0b /mnt/usr/mdec/bootxx_ffsv2

But, my EFI/boot1.efi and EFI/loader_4th.efi still probe no UFS partitions and always forward to TrueOS somewhy.

Useless to me where HBSD is FreeBSD-based instead of NetBSD. The bsdinstall interfaces are totally different to any others.

Could rEFInd be a temporary solution for you?

See here for a walk through…

No but what I need is to make rEFInd to probe my UFS partitions using my drivers from https://efi.akeo.ie. And rEFInd is my long-term EFI manager, not temp.


Which commands from these are needed to finish configuring my EFI drivers?
I’m now trying to config using efidp and efivar commands.:thinking:

Sorry :cry: …no clue.
Just trying to give some ideas, never digged into this myself. I use Grub and it has always worked OOTB. As for NetBSD, my system is booting in legacy mode.

HBSD also has GRUB then I install and probe it,
sudo pkg install -y grub2-efi && sudo grub-install --efi-directory=/boot/efi --target=x86_64-efi --bootloader-id=hbsd --force && sudo grub-mkconfig -o /boot/grub/grub.cfg
HBSD GRUB has now been already present on my rEFInd but it reports kernel panic.:thinking:!

For sure you know about https://groups.google.com/a/hardenedbsd.org/forum/m/#!forum/users

1 Like

This has been solved using other EFI drivers, now the system boots normally to the multi-user session. :smiley:

1 Like

Nice :smiley:
Out of curiosity… what drivers did you use?

1 Like

Either boot1.efi, loader_lua.efi, loader_simple.efi, but needs to manually mount my root using any of ufs:gpt/hbsd or ufs:ada0p1, so Intel graphics driver still always doesn’t work.
Others just still forward to TrueOS.


Thanks for sharing!
You never know when/if needed :wink:

1 Like

You could start by posting the grub.cfg entry for your HBSD system, grub-install has never really worked with anything but Linux and Windows, and always required making a custom entry ;), which will vary depending on your partition layout, root file system, encryption, etc… non-encrypted ufs2 is usually easy to get booting with Grub or SysLinux on FreeBSD, hope this applies to HBSD too.

Also, gptboot(8) is meant for BIOS, not UEFI :wink:


By last autumn FreeBSD also has added efibootmgr to easily config EFI drivers, which is the same from Linux. :grin: