将 FreeBSD 添加到 GRUB2 启动菜单

r00*_*004 10 freebsd grub2

我在 MBR 驱动器上安装了带有 Grub2 的 Gentoo x64。今天我安装了 FreeBSD x64 9.2。现在我在 Gentoo 并尝试将 FreeBSD 添加到grub2菜单列表中。

grub2-install /dev/sda
os-prober
grub2-mkconfig -o /boot/grub2/grub.cfg
Run Code Online (Sandbox Code Playgroud)

我在 Gentoo 上执行了上述操作,但没有找到 FreeBSD。FreeBSD 嵌套分区已打开sda1并包含freebsd-ufs和freebsd-swap分区。

我如何将 FreeBSD 添加到grub2?

uzs*_*olt 8

这是我的:

menuentry "FreeBSD" --class freebsd --class bsd --class os {
 insmod ufs2
 insmod bsd
 set root=(hd0,1)
 kfreebsd /boot/kernel/kernel
 kfreebsd_loadenv /boot/device.hints
 set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s1a
 set kFreeBSD.vfs.root.mountfrom.options=rw
 set kFreeBSD.hw.psm.synaptics_support=1
}
Run Code Online (Sandbox Code Playgroud)

  • 不,这 / 不是自动生成的。我已将其写入 /etc/grub.d/40_custom,请检查:https://wiki.archlinux.org/index.php/GRUB#Automatically_generating_using_.2Fetc.2Fgrub.d.2F40_custom_and_grub-mkconfig (2认同)