ZoyaPatel

修改boot loader grub 目录展示选择,修改为不跳过,永久展示!

SohaniSharma

 ## grub 跳过问题,我想很多用户在修改linux内核的时候,总是发现grub内核展示页面的总是会轻易跳过,导致无法选择内核,我们通过修改配置来展示内核可选择项!{alertInfo}

由人工编写审核,非AI生成内容,请放心观看!

{getToc} $title={文章目录}

## 问题如何展示可选内核

在我们修改的问题内核的时候,常常会出现,内核修改出错,你重新修复需要登录系统重新进入,但是默认的系统的会自动选择内核。



## 解决方式

修改grub2 程序的默认展示方式,也就是输grub菜单,必须展示出来给我选择,否则不允许你进入系统,这样完全保证了,修改内核出错时候,无法进入内核问题

同样的我们也可以实现,选择画面必须展示,也可以修改为展示时长
注意:⚠️默认是不展示选择界面的,也就是常常遇到自己跳过的问题!

默认展示:

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

修改为:

cat /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 #显示,不需要用户按esc就可以显示
GRUB_TIMEOUT=-1 #表示显示时间,永久显示
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` #显示版本号
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #发给内核参数
GRUB_CMDLINE_LINUX=""
sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.9
Found initrd image: /boot/initrd.img-6.8.9
Found linux image: /boot/vmlinuz-6.8.0-85-generic
Found initrd image: /boot/initrd.img-6.8.0-85-generic
Found linux image: /boot/vmlinuz-6.8.0-84-generic
Found initrd image: /boot/initrd.img-6.8.0-84-generic
Found linux image: /boot/vmlinuz-6.8.0-83-generic
Found initrd image: /boot/initrd.img-6.8.0-83-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done

展示结果:

进入advance 目录选择内核即可:

这样用户就需要担心如何选择内核问题了

版权声明:感谢您的阅读,资源整理自网络,如果您发现任何侵权行为,请联系 理科生网 管理人员,管理员将及时删除侵权内容。否则均为 理科生网 原创内容,转载时请务必以超链接(而非纯文本链接)标注来源于理科生网及本文完整链接,感谢!{alertInfo}

Ahmedabad
Kolkata
Hyderabad
后一页 Bangalore 前一页

Random Manga

Ads

نموذج الاتصال