Solved Menu entry broken on GRUB2

Having problem with booting in to FreeBSD from GRUB2

when i update-grub2 on my Linux install i get this output
Code:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-6.1.0-22-amd64
Found initrd image: /boot/initrd.img-6.1.0-22-amd64
Found linux image: /boot/vmlinuz-6.1.0-18-amd64
Found initrd image: /boot/initrd.img-6.1.0-18-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda4@/efi/Microsoft/Boot/bootmgfw.efi
Found FreeBSD 14.1-RELEASE on /dev/sdb2
Adding boot menu entry for UEFI Firmware Settings ...
done

when i reboot my machine, the FreeBSD entry doesn't show up nor is it configured on the /boot/default/grub.cfg file

so i decided to create a new entry on 40_custom from Super Grub2 disk

but when i use those following entries

FreeBSD
Code:
menuentry "FreeBSD /dev/sda" "hd0,gpt2"{
 
    set root="$2"
    set uuid="$3"

    kfreebsd /boot/kernel/kernel
    set kFreeBSD.acpi_load=YES
    set kFreeBSD.hint.acpi.0.disabled=0
    set kFreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
    kfreebsd_loadenv /boot/device.hints
}

FreeBSD default loader
Code:
menuentry "FreeBSD /dev/sda" "hd0,gpt2"{
    set root="$2"

    kfreebsd /boot/loader
}

In none of those configurations FreeBSD booted, they only displayed red and white and could not be interacted with.

FreeBSD works perfectly when booting from system boot, but putting all the installations on GRUB2 would make it nicer to manage those installations.
 
I use the chainloader mechanism to boot FreeBSD via grub. By default EFI starts grub which offers the grub menu. The FreeBSD option activates the FreeBSD entry of the EFI loader. Please see my 40-custom below.
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD" {
        insmod part_gpt
        insmod fat
        set root=(hd0,gpt1)
        chainloader /efi/freebsd/loader.efi
}
 
#!/bin/sh exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD" {
insmod part_gpt
insmod fat
set root=(hd0,gpt1)
chainloader /efi/freebsd/loader.efi
}

this entry works flawlessly
 
Back
Top