Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2022 09:30:56 +0100
From:      "Dave Cottlehuber" <dch@skunkwerks.at>
To:        questions@freebsd.org
Subject:   Re: UEFI detection problem when booting FreeBSD from Grub
Message-ID:  <6de28117-dbcd-45a7-80aa-fdb8e1949e5c@www.fastmail.com>
In-Reply-To: <d80f18e2-d32e-62f2-9cfe-3d78bfb815cd@luiz.eng.br>
References:  <d80f18e2-d32e-62f2-9cfe-3d78bfb815cd@luiz.eng.br>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 11 Mar 2022, at 08:53, Luiz Amaral wrote:
> 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?

I don't think mfsBSD supports EFI boot at all yet.

There are a few issues & PRs around it, 
https://github.com/mmatuska/mfsbsd/issues?q=EFI
perhaps you can try some of these and report back
which worked for your situation.

A+
Dave



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6de28117-dbcd-45a7-80aa-fdb8e1949e5c>