简介

这篇文章记载了我在更改grub时,遇到的一些麻烦事,可能不太详细

正文

尝试编辑 /boot/grub/grub.cfg

cangyue@GEEK:~$ sudo nano /boot/grub/grub.cfg

GNU nano 5.4 /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

文件头部写到由/etc/grub.d/etc/default/grub文件生成

编辑/etc/default/grub

cangyue@GEEK:~$ sudo nano /etc/default/grub

GNU nano 5.4 /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

添加GRUB_THEME="<theme.txt位置>"
将<theme.txt位置>改为你的主题中theme.txt文件位置,为了方便管理,我建议你把主题文件夹放在/boot/grub/themes/
那个双引号最好加上,我一开始没加不生效

再顺便添加GRUB_GFXMODE=1920x1080这个根据你的主题和显示器分辨率自行调整,不正确会糊

最后再更新grub.cfg

cangyue@GEEK:~$ sudo update-grub

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /boot/grub/theme/simple/theme.txt
Found linux image: /boot/vmlinuz-5.11.0-49-generic
Found initrd image: /boot/initrd.img-5.11.0-49-generic
Found linux image: /boot/vmlinuz-5.11.0-46-generic
Found initrd image: /boot/initrd.img-5.11.0-46-generic
Adding boot menu entry for UEFI Firmware Settings
done

最后重启试试效果吧