注意:本文中的有些截图时较早前截取的,和最新的截图中的分区有些不同,这是因为之前装cloudready时导致整个磁盘被格式化,从头开始重新安装了所有的系统,但不影响描述原理
先上一张最终的效果图
问题一:下图为rEFInd默认安装后出现的引导菜单:第一第二个还算正常;第三个图标表示未知的操作系统,可能就进不去,也可能进去就是个无效的页面;第四个是linux图标,但是进去很可能是grub引导界面,还需要再选择一次才能进入操作系统,而且通过第四个图标进去的操作系统其实就是第二个图标所指示的Ubuntu,明显有点冗余。
如果你的磁盘上有多个操作系统内核,rEFInd也会把所有的内核列出来(比如我的ubuntu所在的磁盘分区就有两个linux内核,vmlinuz-5.8.0-48-generic和vmlinuz-5.8.0-25-generic),会显得引导菜单有很多个操作系统,这不是我们所期望的
问题二:通过选择某个OS子菜单后进入的其实是grub引导界面,还得再选择一次,才能进入操作系统,导致进入某个OS系统过慢
怎样解决上述这两个问题呢?我先上一段配置,然后逐条分析配置项
(代码段中的uuid可能和其他小节描述的uuid有所不同,这是因为之前装cloudready时导致整个磁盘被格式化,从头开始重新安装了所有的系统)
#
# refind.conf
# Configuration file for the rEFInd boot menu
#
timeout 60
dont_scan_dirs /EFI/Microsoft/Boot,/EFI/Boot,/EFI/ubuntu,/EFI/UOS,/EFI/PhoenixOS,/EFI/PhoenixOS/boot,/EFI/fydeos,/EFI/CLOVER,/EFI/kylin,/EFI/opensuse,/EFI/centos,/EFI/redflag,/EFI/RedFlag_Linux_Desktop_V11.0
#dont_scan_files
scan_all_linux_kernels false
#fold_linux_kernels false
default_selection 1
include themes/rEFInd-minimal/theme.conf
menuentry "Windows" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_win.png
loader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry "CentOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_centos.png
volume 9CC38149-EA82-4584-AAB6-734C4010A065
loader /vmlinuz-4.18.0-240.e18.x86_64
initrd /initramfs-4.18.0-240.e18.x86_64.img
options "root=UUID=f9394421-19e2-447e-9928-9f9cc6a6eef8 ro crashkernel=auto resume=UUID=4f60d357-9dfb-4557-be49-552bf26fb8b9 rhgb quiet "
disabled
}
menuentry "CentOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_centos.png
loader /EFI/centos/grubx64.efi
}
menuentry "Ubuntu" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_ubuntu.png
volume 4055E8D2-7086-4102-9E21-146197698D87
loader /vmlinuz-5.8.0-25-generic
initrd /initrd.img-5.8.0-25-generic
options "root=UUID=caef5804-37c2-4717-87e8-2e20de8cf6ae ro quiet splash"
}
menuentry "Ubuntu(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_ubuntu.png
loader /EFI/ubuntu/grubx64.efi
disabled
}
menuentry "OpenSUSE" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_opensuse.png
volume 77549760-46AB-4047-9B2A-0D9E96CA70AB
loader /vmlinuz-5.3.18-lp152.72-default
initrd /initrd-5.3.18-lp152.72-default
options "root=UUID=d5031186-2bf2-4a4c-ae1c-114c9a949c34 splash=silent resume=/dev/disk/by-id/nvme-Samsung_SSD_980_1TB_S649NJ0R350885D-part10 mitigations=auto quiet"
}
menuentry "OpenSUSE(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_opensuse.png
loader /EFI/opensuse/grubx64.efi
disabled
}
menuentry "Deepin" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_deepin.png
volume 406177AE-77BA-4D4B-9D17-7EE140BBCDCC
loader /vmlinuz-5.10.18-amd64-desktop
initrd /initrd.img-5.10.18-amd64-desktop
options "root=UUID=7daaea21-9067-4022-ab67-7b286c75dbd0 ro splash quiet"
}
menuentry "Deepin(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_deepin.png
loader /EFI/UOS/grubx64.efi
disabled
}
menuentry "Kylin" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_kylin.png
volume 67C7AE31-40CB-45A4-8574-EA8803787639
loader /vmlinuz-5.10.0-3-generic
initrd /initrd.img-5.10.0-3-generic
options "root=UUID=185f74e8-d18d-4903-8243-302c28793c65 ro quiet splash loglevel=0 resume=UUID=5b25f24e-b655-471f-88f1-64dd6bb6f966 audit=0 security=none"
}
menuentry "Kylin(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_kylin.png
loader /EFI/kylin/grubx64.efi
disabled
}
menuentry "RedFlag" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_redflag.png
volume 5604D06A-AE60-484F-BA14-ECCB3097E5F5
loader /vmlinuz-4.19.0-16-amd64
initrd /initrd.img-4.19.0-16-amd64
options "root=UUID=a33c3abb-986d-417c-8ef5-fa864a8fb00e ro quiet splash resume=UUID=49901fc4-538a-46fb-8c25-bb3c05f3917d"
}
menuentry "RedFlag(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_redflag.png
loader /EFI/redflag/grubx64.efi
disabled
}
menuentry "FydeOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_fydeos.png
volume FEC7D7FF-2B69-474B-89A1-D2CA9F80CC52
loader /boot/vmlinuz-13729.22.12.13
initrd /boot/dual_boot_ramfs.cpio.xz
options "init=/sbin/init root=/dev/nvme0n1p15 boot=local rootwait noresume noswap ro loglevel=7 console= i915.modeset=1 cros_efi cros_debug fydeos_dualboot"
}
menuentry "FydeOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_fydeos.png
loader /EFI/fydeos/bootx64.efi
disabled
}
menuentry "ChromeOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_chrome.png
volume 73108A43-715C-AD4E-BB15-A72A6CF8213B
loader /syslinux/vmlinuz.A
options "init=/sbin/init boot=local rootwait ro noresume noswap loglevel=7 noinitrd console= i915.modeset=1 cros_efi cros_debug root=PARTUUID=328F6BDB-CE13-F846-8EB0-A5A6578575AD"
disabled
}
menuentry "ChromeOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_chrome.png
volume 73108A43-715C-AD4E-BB15-A72A6CF8213B
loader /efi/boot/bootx64.efi
}
menuentry "PhoenixOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_phoenix.png
loader /EFI/PhoenixOS/kernel
initrd /EFI/PhoenixOS/initrd.img
options " quiet root=/dev/ram0 androidboot.hardware=android_x86 SRC=/PhoenixOS vga=788 i8042.nokbd=1"
}
menuentry "PhoenixOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_phoenix.png
loader /EFI/PhoenixOS/boot/bootx64.efi
disabled
}
menuentry "OSX" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_mac.png
loader /EFI/CLOVER/CLOVERX64.efi
}
menuentry "Linux" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_linux.png
loader /EFI/Boot/grubx64.efi
}
关于refind.conf的配置项可以参见官网的配置项介绍http://www.rodsbooks.com/refind/configfile.html
如果觉得英文看起来有些费劲,可以参考论坛里这篇文章,还算详细refind 0.10.3 配置文件refind.conf简单分析
timeout ,我这里设置的是60,// 设置默认等待时间// 0 : 无限期等待 // -1: 立即进入默认的系统//大于0的数值表示等待的秒数
dont_scan_dirs rEFInd不去扫描的目录,我设置为 /EFI/Microsoft/Boot,/EFI/Boot,/EFI/ubuntu,/EFI/UOS,/EFI/PhoenixOS,/EFI/PhoenixOS/boot,/EFI/fydeos,/EFI/CLOVER 这几个,因为我的ESP分区是下图这样的,另外说一句,linux系统下ESP分区是挂载在/boot/efi/目录下的。
这里之所以设置这个是因为稍后我要自己配置menuentry
#dont_scan_files rEFInd不去扫描的文件,设置上面的目录后就不需要设置特定的文件了,所以这里注释了
scan_all_linux_kernels rEFInd是否去扫描所有的linux内核,我这里设置为false,同样是因为稍后我要自己配置menuentry,不设置时默认为true,比如我的ubuntu所在的磁盘分区就有两个linux内核,vmlinuz-5.8.0-48-generic和vmlinuz-5.8.0-25-generic,那么菜单就会显示两个linux子菜单
#fold_linux_kernels 是否去折叠扫描到的linux内核,比如我的ubuntu所在的磁盘分区就有两个linux内核,vmlinuz-5.8.0-48-generic和vmlinuz-5.8.0-25-generic,不折叠时,菜单就会显示两个linux子菜单,折叠后就会只显示一个最新的,这里只是为了探索这个配置项的含义,并没有去使用,所以注释了
default_selection 1 默认哪个OS子菜单处于选中状态,这里设置为1,对应于我的配置就是win10系统
include themes/rEFInd-minimal/theme.conf 导入相关的主题配置theme.conf,其实theme.conf里面的配置项完全可以在refind.conf里面配置,关于theme.conf里面的配置项不再详细说明,还是比较简单的,参见上文分享的两篇链接
# Minimal refind theme
# Hide user interface elements for personal preference or to increase
# security:
# banner - the rEFInd title banner (built-in or loaded via "banner")
# label - boot option text label in the menu
# singleuser - remove the submenu options to boot Mac OS X in single-user
# or verbose modes; affects ONLY MacOS X
# safemode - remove the submenu option to boot Mac OS X in "safe mode"
# hwtest - the submenu option to run Apple's hardware test
# arrows - scroll arrows on the OS selection tag line
# hints - brief command summary in the menu
# editor - the options editor (+, F2, or Insert on boot options menu)
# all - all of the above
# Default is none of these (all elements active)
#
hideui singleuser,hints,arrows,badges
# Set the name of a subdirectory in which icons are stored. Icons must
# have the same names they have in the standard directory. The directory
# name is specified relative to the main rEFInd binary's directory. If
# an icon can't be found in the specified directory, an attempt is made
# to load it from the default directory; thus, you can replace just some
# icons in your own directory and rely on the default for others.
# Default is "icons".
#
icons_dir themes/rEFInd-minimal/icons
# Use a custom title banner instead of the rEFInd icon and name. The file
# path is relative to the directory where refind.efi is located. The color
# in the top left corner of the image is used as the background color
# for the menu screens. Currently uncompressed BMP images with color
# depths of 24, 8, 4 or 1 bits are supported, as well as PNG images.
#
banner themes/rEFInd-minimal/background.png
# Tells rEFInd whether to display banner images pixel-for-pixel (noscale)
# or to scale banner images to fill the screen (fillscreen). The former is
# the default.
#
banner_scale fillscreen
# Custom images for the selection background. There is a big one (144 x 144)
# for the OS icons, and a small one (64 x 64) for the function icons in the
# second row. If only a small image is given, that one is also used for
# the big icons by stretching it in the middle. If only a big one is given,
# the built-in default will be used for the small icons.
#
# Like the banner option above, these options take a filename of an
# uncompressed BMP image file with a color depth of 24, 8, 4, or 1 bits,
# or a PNG image. The PNG format is required if you need transparency
# support (to let you "see through" to a full-screen banner).
#
selection_big themes/rEFInd-minimal/selection_big.png
selection_small themes/rEFInd-minimal/selection_small.png
# Which non-bootloader tools to show on the tools line, and in what
# order to display them:
# shell - the EFI shell (requires external program; see rEFInd
# documentation for details)
# gptsync - the (dangerous) gptsync.efi utility (requires external
# program; see rEFInd documentation for details)
# apple_recovery - boots the Apple Recovery HD partition, if present
# mok_tool - makes available the Machine Owner Key (MOK) maintenance
# tool, MokManager.efi, used on Secure Boot systems
# about - an "about this program" option
# exit - a tag to exit from rEFInd
# shutdown - shuts down the computer (a bug causes this to reboot
# EFI systems)
# reboot - a tag to reboot the computer
# firmware - a tag to reboot the computer into the firmware's
# user interface (ignored on older computers)
# Default is shell,apple_recovery,mok_tool,about,shutdown,reboot,firmware
#
showtools shutdown,reboot,exit
下面开始介绍本文的重点
menuentry "Windows" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_win.png
loader /EFI/Microsoft/Boot/bootmgfw.efi
}
这是引导win10的,比较简单
menuentry "Ubuntu" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_ubuntu.png
loader /EFI/ubuntu/shimx64.efi
disabled
}
#这是一
menuentry "Ubuntu" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_ubuntu.png
volume 720B2437-28D8-44DB-AC11-B7A73E74624F
loader /vmlinuz-5.8.0-48-generic
initrd /initrd.img-5.8.0-48-generic
options "root=UUID=d157bead-cb19-45cd-a75c-8c50671df920 ro quiet splash"
}
#这是二
这是引导Ubuntu的,我先前用两种方式都做了引导,第一种目前已经禁用(disabled),之所以禁用第一种是因为引导进入的是grub界面,略显繁琐
先说说第一种,它和之前win10的引导是同一种方式,也是直接寻找ESP分区里面的相关引导文件
关于grubx64.efi,mmx64.efi,shimx64.efi的区别参见rEFInd - Arch Linux 中文维基和各类efi文件介绍 | 小霸王 (gitee.io)主要是和secure boot有关的,签名和非签名的引导程序
上图的grub.cfg配置之所以如此简单是因为通过环境变量的设置将grub的相关配置链接到了其他地方,参见下图
怎样链接的呢?是通过上面的grub2命令search.fs_uuid(=search --fs_uuid) 此命令是将root环境变量设置为ubuntu下的/boot
关于grub2命令相关内容参见GRUB2教程
上面画红色下划线的145DB11B-4FC8-4105-A948-5EDA0144F494是什么呢?查看ubuntu的/etc/fstab文件可以看到是ubuntu的/boot挂载点的文件系统UUID
虽然这种方式也可以引导,但是引导进入了grub界面,还需要再选择一次才能进入操作系统,略显繁琐,当然有一种方式是修改ubuntu下的/etc/default/grub文件中的timeout=0来快速跳过grub界面,但还是会出现一下的
接下来说第二种方式,第二种方式是直接通过linux内核引导进入系统,不会经过grub界面而直接进入操作系统,但是配置比较麻烦,现在说一下各个配置项
其实配置项和grub2配置项比较像,下图为ubuntu下/boot/grub/grub.cfg文件中关于Ubuntu主菜单的配置,基本可以用到refind.conf的配置中
其中vmlinuz-5.8.0-48-generic 和 initrd.img-5.8.0-48-generic 在ubuntu的/boot目录下可以找到
这里要特别注意的是volume的配置,这个UUID是分区的UUID,不是文件系统的UUID,我起初就因为配置错误导致引导失败,下图绿色对勾所示位置的UUID就是分区UUID
而grub里面配置的是文件系统UUID
为了这个UUID可真是折腾了一番,最终从外网查到了,链接是uefi - rEFInd boot-manager - 'volume' as GUID? - Super User
为了不能前往外网的用户贴上图片一张
volume设置的值是将root环境变量设置为ubuntu下的/boot
另外要特别注意volume的位置,上图也有说明,我将volume放在icon后loader前,那么icon的路径定位不需要基于volume,而loader以及之后的配置项的路径定位则要依赖于volume
关于loader和initrd的路径定位需要注意的是ubuntu下的/boot的分区情况
如果/boot有单独的分区,我在安装系统时给/boot单独分了区,就是volume的UUID(720B2437-28D8-44DB-AC11-B7A73E74624F)所指示的分区
由于volume设置的值是将root环境变量设置为ubuntu下的/boot,而内核文件vmlinuz-5.8.0-48-generic和initrd.img-5.8.0-48-generic在ubuntu的/boot目录下,那么就写成
loader /vmlinuz-5.8.0-48-generic
initrd /initrd.img-5.8.0-48-generic
如果/boot没单独划分分区,那么这个分区 就与根目录(/)分区相关,volume设置的值(另一个UUID)是将root环境变量设置为ubuntu下的/
而内核文件vmlinuz-5.8.0-48-generic和initrd.img-5.8.0-48-generic在ubuntu的/boot目录下,那么就写成
loader /boot/vmlinuz-5.8.0-48-generic
initrd /boot/initrd.img-5.8.0-48-generic
options选项中的root=UUID=d157bead-cb19-45cd-a75c-8c50671df920 ,这个UUID是ubuntu下根目录(/)的文件系统UUID
menuentry "Deepin" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_deepin.png
loader /EFI/UOS/shimx64.efi
disabled
}
#这是一
menuentry "Deepin" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_deepin.png
volume 3608A634-47D8-4A09-945B-5D3484A42A1E
loader /vmlinuz-5.10.18-amd64-desktop
initrd /initrd.img-5.10.18-amd64-desktop
options "root=UUID=3505e55a-a6e8-4c6e-9b09-3664ec4df439 ro splash quiet"
}
#这是二
这是引导deepin的,我先前用两种方式都做了引导,第一种目前已经禁用(disabled),之所以禁用第一种是因为引导进入的是grub界面,略显繁琐
deepin的引导配置和上面Ubuntu的配置完全一样,只是修改成deepin系统对应的参数就行,所以在这里就只上传deepin对应的图片
第一种配置有关图片
第二种配置有关图片
menuentry "PhoenixOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_phoenix.png
loader /EFI/PhoenixOS/boot/bootx64.efi
disabled
}
menuentry "PhoenixOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_phoenix.png
loader /EFI/PhoenixOS/kernel
initrd /EFI/PhoenixOS/initrd.img
options " quiet root=/dev/ram0 androidboot.hardware=android_x86 SRC=/PhoenixOS vga=788 i8042.nokbd=1"
}
这是引导PhoenixOS的,我先前用两种方式都做了引导,第一种目前已经禁用(disabled),之所以禁用第一种是因为引导进入的是grub界面,略显繁琐
ESP分区下PhoenixOS的文件结构是下图这样的
PhoenixOS的refind配置是参考grub.cfg进行配置的,PhoenixOS安装时没有单独给/boot划分分区,而是直接放到了ESP分区,所以可以看到PhoenixOS的kernel和initrd.img都是在esp分区下的/EFI/PhoenixOS/目录下,不需要额外重新指定volume参数,这和上面的ubuntu,deepin是不同的。
menuentry "FydeOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_fydeos.png
volume FEC7D7FF-2B69-474B-89A1-D2CA9F80CC52
loader /boot/vmlinuz-13729.22.12.13
initrd /boot/dual_boot_ramfs.cpio.xz
options "init=/sbin/init root=/dev/nvme0n1p15 boot=local rootwait noresume noswap ro loglevel=7 console= i915.modeset=1 cros_efi cros_debug fydeos_dualboot"
}
menuentry "FydeOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_fydeos.png
loader /EFI/fydeos/bootx64.efi
disabled
}
这是引导FydeOS的,我先前用两种方式都做了引导,FydeOS(grub)目前已经禁用(disabled),之所以禁用FydeOS(grub)是因为引导进入的是grub界面,略显繁琐
ESP分区下FydeOS的文件结构是下图这样的
FydeOS的refind配置是参考grub.cfg进行配置的
grub中相关的文件可以在FydeOS的boot目录和fydeos目录中找到
grub中/fydeos/fydeos_dual_boot.img被挂载到loopdev
linux (loopdev,gpt12)/syslinux/vmlinuz.A 这个配置项就是从/fydeos/fydeos_dual_boot.img镜像中找到vmlinuz.A,而vmlinuz.A文件中又是vmlinuz-13729.22.12.13,所以我在此处将refind中loader设置为 /boot/vmlinuz-13729.22.12.13 ,initrd 就是用grub文件中的配置,refind中options 也使用grub文件中的配置。
refind中volume可以设置为UUID,也可以设置为label值FYDEOS-DUAL-BOOT,同样的options参数中的root变量可以设置为对应的UUID,也可以设置为label值,本文中为root=/dev/nvme0n1p15
menuentry "OSX" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_mac.png
loader /EFI/CLOVER/CLOVERX64.efi
}
ESP分区下clover的文件结构是下图这样的
配置比较简单,原理就是clover引导黑苹果,refind引导clover。
#这里如果使用UUID的方式不能引导成功,可以改成root=/dev/sdaX这种方式
#X为你自己的电脑安装的centos系统的根目录所挂载的磁盘分区编号
menuentry "CentOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_centos.png
volume 9CC38149-EA82-4584-AAB6-734C4010A065
loader /vmlinuz-4.18.0-240.e18.x86_64
initrd /initramfs-4.18.0-240.e18.x86_64.img
options "root=UUID=f9394421-19e2-447e-9928-9f9cc6a6eef8 ro crashkernel=auto resume=UUID=4f60d357-9dfb-4557-be49-552bf26fb8b9 rhgb quiet "
disabled
}
menuentry "CentOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_centos.png
loader /EFI/centos/grubx64.efi
}
配置原理参见上述方法,不再详述
centOS的XFS文件系统在DiskGenius不能识别文件结构,如下图
menuentry "OpenSUSE" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_opensuse.png
volume 77549760-46AB-4047-9B2A-0D9E96CA70AB
loader /vmlinuz-5.3.18-lp152.72-default
initrd /initrd-5.3.18-lp152.72-default
options "root=UUID=d5031186-2bf2-4a4c-ae1c-114c9a949c34 splash=silent resume=/dev/disk/by-id/nvme-Samsung_SSD_980_1TB_S649NJ0R350885D-part10 mitigations=auto quiet"
}
menuentry "OpenSUSE(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_opensuse.png
loader /EFI/opensuse/grubx64.efi
disabled
}
配置原理参见上述方法,不再详述
menuentry "Kylin" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_kylin.png
volume 67C7AE31-40CB-45A4-8574-EA8803787639
loader /vmlinuz-5.10.0-3-generic
initrd /initrd.img-5.10.0-3-generic
options "root=UUID=185f74e8-d18d-4903-8243-302c28793c65 ro quiet splash loglevel=0 resume=UUID=5b25f24e-b655-471f-88f1-64dd6bb6f966 audit=0 security=none"
}
menuentry "Kylin(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_kylin.png
loader /EFI/kylin/grubx64.efi
disabled
}
配置原理参见上述方法,不再详述
menuentry "ChromeOS" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_chrome.png
volume 73108A43-715C-AD4E-BB15-A72A6CF8213B
loader /syslinux/vmlinuz.A
options "init=/sbin/init boot=local rootwait ro noresume noswap loglevel=7 noinitrd console= i915.modeset=1 cros_efi cros_debug root=PARTUUID=328F6BDB-CE13-F846-8EB0-A5A6578575AD"
disabled
}
#暂时不可用
menuentry "ChromeOS(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_chrome.png
volume 73108A43-715C-AD4E-BB15-A72A6CF8213B
loader /efi/boot/bootx64.efi
}
配置原理参见上述方法,不再详述
menuentry "RedFlag" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_redflag.png
volume 5604D06A-AE60-484F-BA14-ECCB3097E5F5
loader /vmlinuz-4.19.0-16-amd64
initrd /initrd.img-4.19.0-16-amd64
options "root=UUID=a33c3abb-986d-417c-8ef5-fa864a8fb00e ro quiet splash resume=UUID=49901fc4-538a-46fb-8c25-bb3c05f3917d"
}
menuentry "RedFlag(grub)" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_redflag.png
loader /EFI/redflag/grubx64.efi
disabled
}
menuentry "Linux" {
icon /EFI/refind/themes/rEFInd-minimal/icons/os_linux.png
loader /EFI/Boot/grubx64.efi
}
之所以加此配置是因为前面的配置都把grub界面去掉了,在此特意加了一个配置是为了留一个进入grub界面的接口
关于/EFI/Boot/grubx64.efi的详解参见关于Bootmgfw.efi、Bootx64.efi的详解
最后,关于refind.conf的其他配置项感兴趣的话可以参照前面提到的refind的官网
补充一点的是,在装多个linux系统时,后装的Linux系统的grub2会覆盖掉先装的linux系统的grub2,因此,/EFI/Boot/grubx64.efi,/EFI/ubuntu/shimx64.efi,/EFI/UOS/shimx64.efi,/EFI/ubuntu/grubx64.efi,/EFI/UOS/grubx64.efi 这几个引导程序引导的grub2界面是完全一样的。比如我的电脑deepin后装于ubuntu,所以grub2界面是deepin的grub2界面。后来我又将grub2界面修复为ubuntu的grub2界面,当然还可以修复回deepin的grub2界面。其实就是在装完某个linux系统后先到esp分区把对应的grubx64.efi,shimx64.efi,grub.cfg文件备份下来,后装的linux系统肯定会把自己的grub文件覆盖掉之前的grub文件,这时候如果要恢复原先的grub文件,之前的备份就派上用场了。
最后的最后,再附上一篇外网关于清理refind引导的多余的OS菜单的链接Linux Multi-boot with Refind – TeejeeTech
附上几张图片
还有一篇github上的一篇,链接GitHub - castelldev/refind-castell: A custom theme for multiboot systems. Requires rEFInd UEFI bootloader.