[deepin exploration] 在deepin欢迎页添加系统启动项
Tofloor
poster avatar
dont-leave
deepin
2024-04-01 15:48
Author

一、起因

在windows、deepin之后又装了一个fyde,然后又配置了一个rEFInd软件。

开机过程由原来的立即启动,到每次都要手动选择几次才开始开机

graph LR A(开机)-->N(windows)
graph LR A(开机)-->B(rEFInd选项卡)-->D(deepin选项卡)-->E(想要的系统) B-->C(想要的系统)

虽然安装了启动管理软件,但总感觉层次不够分明。

我觉得是应该剪掉一些支点了,所以我卸载了rEFInd,而留下deepin

二、GRUB菜单中添加新的os选项

效果如下图:

image.png

操作步骤:

  1. 上网查了deepin的启动管理相关知识
  2. 发现是基于linux的grub以及bootchain等

进入grub.d,就会看到开头开头的几个文件,就是启动项的配置文件
截图_选择区域_20240401151632.png

模仿40_custom文件编写我的fydeos的启动项

455  cd /etc/grub.d/
456  cp 40_custom  xx_custom  #xx数字越小越前面
457  vi xx_custom      #填写启动项信息:所在分区以及启动文件,样式
458  update-grub        #初始化下
459  grub-mkconfig -o /boot/grub/grub.cfg #根据grub.d文生成grubcfg

457-启动项填写如下:

image.png

三、是否成功

459-执行后会重新生成 包含所有系统的配置汇总到grub.cfg

查看/boot/grub/grub.cfg

image.png

-- 大概意思就是整合了前面所有系统的一个单独配置文件

如果出现属于新增系统的代码段落即为成功。

查看启动菜单

在系统设置通用可以看到新系统也是成功的

image.png

最后我的系统一个选项卡启动,而且想比较其他软件也很简洁

graph LR A(deepin选项卡)-->B(其他系统)

四、一些反复查找的知识:

对于一个小白来说,想在比较复杂的grub里配置一个太不容易了:

  1. 新系统引导存放位置
  2. menuentry的原理
  3. blkid 查看磁盘挂载
  4. grub相关原理
Reply Favorite View the author
All Replies
zccrs
deepin
2024-04-01 15:57
#1

改 grub 要特别小心,搞不到就进不了系统了。可以加个警告说明。

Reply View the author
owen_337
deepin testing team
2024-04-01 16:03
#2

同楼上,建议改grub前,对重要数据进行备份。grub改出问题,那就只能用live去修复了。

Reply View the author
dont-leave
deepin
2024-04-01 16:10
#3
zccrs

改 grub 要特别小心,搞不到就进不了系统了。可以加个警告说明。

重要修改的文件、文件夹打包一份备份ok

Reply View the author
花雨落逝
deepin
2024-04-01 16:15
#4

嗯……如果你是在安装deepin之后安装别的系统,deepin会识别的(

Reply View the author
Tonny
deepin
2024-04-01 16:24
#5
It has been deleted!
dont-leave
deepin
2024-04-01 17:32
#6
Tonny It has been deleted!
root@jc-halo-PC:/home/jc-halo# apt show os-prober
Package: os-prober
Version: 1.77
Priority: optional
Section: utils
Maintainer: Debian Install System Team 
Installed-Size: 111 kB
Depends: libc6 (>= 2.4), grub-common
Download-Size: 30.2 kB
APT-Manual-Installed: yes
APT-Sources: https://community-packages.deepin.com/deepin apricot/main amd64 Packages
Description: utility to detect other OSes on a set of drives
This package detects other OSes available on a system and outputs the
results in a generic machine-readable format.

佬 ,好像真有这个工具能探测系统呢

Reply View the author