I am trying to duel boot x86_64 machine running freeBSD 10.1 using grub. FreeBSD Grub2-efi installation seems going fine but there was no grub.cfg. I manually created grub.cfg. Below are configs I tried and results I got.
My setup :
gpart show -l
=> 6 146239733 da0 GPT (558G)
6 10 - free - (40K)
16 128 1 (null) (512K)
144 262144 2 efi (1.0G) -----> MY ESP
262288 1048576 3 rootfs (4.0G) ----> freebsd+ grub are here
1310864 2097152 4 swap (8.0G)
3408016 1048576 5 nextroot (4.0G)
Grub installation command:
grub-install --target=x86_64-efi --efi-directory=/efi/ --bootloader-id=grub --boot-directory=/boot/ --modules="part_gpt part_msdos"
Config 1:
menuentry "FreeBSD" {
insmod ufs2
insmod bsd
set root=(hd0,3)
kfreebsd /boot/loader.efi
}
Result: it's complaining 'invalid a.out header'.
Config 2:
menuentry "FreeBSD" {
insmod ufs2
insmod bsd
set root=(hd0,3)
kfreebsd /boot/loader
}
Result:Blank screen with white blurr on top. Is it video problem?
Config 3:
menuentry "FreeBSD" {
insmod ufs2
insmod bsd
insmod gfxterm
insmod font
insmod videotest
insmod videoinfo
set gfxmode=auto
set kernvt="vt"
set root=(hd0,3)
kfreebsd /boot/boot1.efi
}
Result again: blank screen with fast changing blur on top.
Config 4:
menuentry "FreeBSD" {
insmod ufs2
insmod bsd
insmod gfxterm
insmod videotest
insmod videoinfo
set gfxmode=auto
set kernvt="vt"
set root=(hd0,3)
chainloader /boot/boot1.efi
}
result: signature not matching. Not booting
I am not sure what I'm missing. Can someone please review my grub.cfg? Is there any obvious thing I'm missing? I highly appreciate if anyone can share grub config using for UEFI booting grub on x86.
loader.efi
as an argument tokfreebsd
. Grub expects to find the name of FreeBSD kernel there, not a boot loader. The FreeBSD kernel is ana.out
binary; EFI programs are PE (Portable Executable) binaries, thus the error message.kfreebsd /boot/loader.efi
tochainloader /boot/loader.efi
in you originalmenuentry
(while retaining the .efi suffix). This tells grub2-efi to load and run the Freebsd EFI boot loader (a EFI program just like grub2-efi). Thekfreebsd
keyword is for loading the BSD kernel directly, and should take a kernel image file as parameter. It may not be possible to load the kernel directly under UEFI, you will have to use the Freebsd specific EFI boot loader. But I'm not sure about that.