Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2022 08:53:27 +0100
From:      Luiz Amaral <email@luiz.eng.br>
To:        freebsd-questions@freebsd.org
Subject:   UEFI detection problem when booting FreeBSD from Grub
Message-ID:  <d80f18e2-d32e-62f2-9cfe-3d78bfb815cd@luiz.eng.br>

next in thread | raw e-mail | index | archive | help
Hello,

I am currently booting FreeBSD via Grub in UEFI mode, but running into
issues with the boot method detection in FreeBSD.

I am using mfsBSD for it, together with the following Grub configuration:
kfreebsd /mfsbsd/boot/kernel/kernel.gz -Dh
kfreebsd_module_elf /mfsbsd/boot/kernel/efirt.ko
kfreebsd_loadenv /mfsbsd/boot/device.hints
kfreebsd_module /mfsbsd/mfsroot.gz type=mfs_root

I am able to boot mfsBSD just fine, and from within mfsBSD I am able to
provision FreeBSD on my local disk.
The only issue now is that I need to create a new boot entry that points
to the recently installed system, which I tried to do using efibootmgr.
Whenever I tried to invoke efibootmgr, I was greeted with:
root@hwlb-awtest-02:~ # efibootmgr
efibootmgr: efi variables not supported on this system. root? kldload efirt?

I am explicitly loading efirt with Grub and on dmesg I can see an entry
for it, so I assume it's being loaded fine.
Mar 10 16:27:55 mfsbsd kernel: module efirt already present!

While checking other things, I realized that FreeBSD/mfsBSD was
detecting the boot method as BIOS instead of UEFI:
root@hwlb-awtest-02:~ # sysctl machdep.bootmethod
machdep.bootmethod: BIOS

What I am struggling now is to understand why this is happening. Does
loader.efi perform special operations before loading the kernel that
allows it to detect that it booted in UEFI mode? Did I miss something on
my Grub entry?

Thank you,
Luiz




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d80f18e2-d32e-62f2-9cfe-3d78bfb815cd>