Plymouth 修改开机动画

网友投稿 1222 2022-05-29

Plymouth 修改开机动画

Plymouth 修改开机动画

相关资料

相关命令介绍

所需安装包/依赖包

修改开机动画

设置自己的开机动画

错误提示

Plymouth 修改开机动画

最近接到一个任务,更换开机动画,研究了将近两天查找资料,测试修改总算完成。网上对应的资料的比较少,整理总结出一份相应文档。

相关资料

实验环境:Fedora29

Plymouth 为 Fedora自带的开/关机动画引导工具

下列所作修改均为 Fedora29 系统 所有的相关操作,均为默认引导。

相关命令介绍

下面为plymouth的相关命令介绍

usage: plymouth-set-default-theme { --list | --reset | [ --rebuild-initrd ] | --help } -h, --help Show this help message -l, --list Show available themes -r. --reset Reset to default theme -R, --rebuild-initrd Rebuild initrd (necessary after changing theme) Name of new theme to use (see --list for available themes)

1

2

3

4

5

6

7

plymouth-set-default-theme //显示当前开机动画主题名称 plymouth-set-default-theme theme-name //设置 theme-name 为开机动画主题 plymouth-set-default-theme -l //显示当前系统所有的主题列表 plymouth-set-default-theme -R theme-name //将 theme-name 主题引导程序编译到内核,重新生成内核

1

2

3

4

所需安装包/依赖包

系统默认的开机动画主题:charge

[root@bogon ~]# plymouth-set-default-theme charge

1

2

主题对应安装包: plymouth-theme-charge-0.9.4-3.fc29.x86_64.rpm

主题所依赖安装包:

plymouth-plugin-two-step-0.9.4-3.fc29.x86_64.rpm plymouth-graphics-libs-0.9.4-3.fc29.x86_64.rpm plymouth-plugin-label-0.9.4-3.fc29.x86_64.rpm

1

2

3

在线安装:yum install plymouth-theme-charge-0.9.4-3.fc29.x86_64.rpm

本地安装:yum install --downloadonly --downloaddir=PATH plymouth-theme-charge-0.9.4-3.fc29.x86_64.rpm

ps:此命令,只会下载本地未安装的依赖包到本地,并不是下载所有依赖安装包到本地.

安装命令:rpm -ivh $PWD/* --nodeps --force

修改开机动画

yum仓库自带的主题

已安装的软件包 plymouth-theme-charge.x86_64 0.9.4-3.fc29 @@System 可安装的软件包 plymouth-theme-breeze.x86_64 5.14.5-1.fc29 updates plymouth-theme-fade-in.x86_64 0.9.4-3.fc29 updates plymouth-theme-hot-dog.noarch 0.5-13.fc29 fedora plymouth-theme-script.x86_64 0.9.4-3.fc29 updates plymouth-theme-solar.x86_64 0.9.4-3.fc29 updates plymouth-theme-spinfinity.x86_64 0.9.4-3.fc29 updates plymouth-theme-spinner.x86_64 0.9.4-3.fc29 updates

1

2

3

4

5

6

7

8

9

10

相关查看命令:

yum list plymouth-theme* #plymouth-theme* 列出Yum库所有 Plympouth 支持的主题 yum list plymouth* #plymouth* 列出plymouth 所有对应的包 yum list plymouth-plugin* #plymouth-plugin* 列出 plymouth 所有对应的插件包,即对应的.so

1

2

3

所有对应插件包:

#已安装的软件包 plymouth-plugin-label.x86_64 0.9.4-3.fc29 @@System plymouth-plugin-two-step.x86_64 0.9.4-3.fc29 @@System #可安装的软件包 plymouth-plugin-fade-throbber.x86_64 0.9.4-3.fc29 updates plymouth-plugin-script.x86_64 0.9.4-3.fc29 updates plymouth-plugin-space-flares.x86_64 0.9.4-3.fc29 updates plymouth-plugin-throbgress.x86_64 0.9.4-3.fc29 updates

1

2

3

4

5

6

7

8

安装步骤:

安装自带的主题:

plymouth-set-default-theme theme-name #设置开机主题 plymouth-set-default-theme -R theme-name #重新编译镜像,加载开机主题引导程序

1

2

下载新的主题

yum install plymouth-theme-name #安装所需主题 plymouth-set-default-theme theme-name #设置开机主题 plymouth-set-default-theme -R theme-name #重新编译镜像,加载开机主题引导程序

1

2

3

以 plymouth-theme-breeze.x86_64为例

一般结构如下:主题包名,依赖插件包名

从这可以得到:正常一个主题所依赖的安装结构,主题包,主题所对应的插件包

yum install plymouth-theme-breeze.x86_64 依赖关系解决。 ======================================================================================================================================== Package Architecture Version Repository Size ======================================================================================================================================== 安装: plymouth-theme-breeze x86_64 5.14.5-1.fc29 updates 120 k 安装依赖关系: plymouth-plugin-script x86_64 0.9.4-3.fc29 updates 38 k 事务概要 ======================================================================================================================================== 安装 2 软件包

1

2

3

4

5

Plymouth 修改开机动画

6

7

8

9

10

11

12

设置自己的开机动画

如果不会自制引导插件库,目前题主也不会,没有仔细研究这一块。目前题主的方法。

#选定自己所需要修改的开机主题,修改对应的开机主题图片,记住同名。

1

系统默认主题:charge

主题库对应目录: /usr/share/plymouth/themes/charge

主题引导脚本:charge.plymouth

脚本结构:

Name=Charge #主题名称

Description=A theme that features the shadowy hull of a Fedora logo charge up and and finally burst into into full form. #主题描述

ModuleName=two-step #主题所对应的依赖包

[two-step]

ImageDir=/usr/share/plymouth/themes/charge #图片目录

HorizontalAlignment=.5 #横向坐标设置

VerticalAlignment=.5 #纵向坐标设置

Transition=none #过场时间是否有

TransitionDuration=0.0 #过场时间

BackgroundStartColor=0x202020 #开始颜色

BackgroundEndColor=0x202020 #结束颜色

1.选定所需要的主题,在 /usr/share/plymouth/themes 复制所需要的主题。#默认主题对应引导插件已经拥有 [root@bogon themes]# pwd /usr/share/plymouth/themes [root@bogon themes]# ls breeze breeze-text charge charge-1 details star.png text tribar [root@bogon themes]# cp -r text/ test/ [root@bogon themes]# ls breeze breeze-text charge charge-1 details star.png test text tribar 2.修改脚本名称: [root@bogon test]# plymouth-set-default-theme -l breeze breeze-text charge-1 charge details text text tribar [root@bogon themes]# cd test/ [root@bogon test]# ls text.plymouth [root@bogon test]# mv text.plymouth test.plymouth [root@bogon test]# ls test.plymouth [root@bogon test]# mv text.plymouth test.plymouth [root@bogon test]# plymouth-set-default-theme -l breeze breeze-text charge-1 charge details test text tribar 3.修改脚本对应属性#一般不用修改 4.设置开机主题 plymouth-set-default-theme theme-name #设置开机主题 5.编译镜像 plymouth-set-default-theme -R theme-name #重新编译镜像,加载开机主题引导程序 6.修改对应图片 #主要的是图片名称命名格式,以及图片格式需要相同。 查看主题对应图片名称#以charge为例 主题对应插件目录: # /usr/lib64/plymouth [root@bogon plymouth]# ls breeze-text.so details.so label.so renderers script.so text.so tribar.so two-step.so [root@bogon plymouth]# pwd /usr/lib64/plymouth [root@bogon plymouth]# vim two-step.so /.png ^@progress-^@SuppressMessages^@UseProgressBar^@UseFirmwareBackground^@SubTitle^@ImageDir^@two- step^@%s/lock.png^@%s/box.png^@%s/corner-image.png^@%s/header-image.png^@%s/background- tile.png^@%s/watermark.png^@TitleFont^@WatermarkHorizontalAlignment^@WatermarkVerticalAlign ment^@DialogHorizontalAlignment^@DialogVerticalAlignment^@TitleHorizontalAlignment^@TitleVe rticalAlignment^@Transition^@fade-over^@cross-fade^@merge- fade^@TransitionDuration^@BackgroundStartColor^@BackgroundEndColor^@ProgressBarBackgroundCo lor^@ProgressBarForegroundColor^@boot- up^@shutdown^@updates^@/sys/firmware/acpi/bgrt/image^@MessageBelowAnimation^@ProgressFuncti on^@wwoods^@linear^@%-75.75s: stopping throbber 查找出对应的图片名称: ImageDir^@two-step lock.png box.png corner-image.png header-image.png background-tile.png watermark.png 根据图片目录对比,看出 background-tile.png 为背景图片 progress- throbber- 这两组图片为过场动画图片

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

将你准备好的对应过场动画图片以及背景图片替换之后,重启,即可看到属于自己的开机动画。

错误提示

注意:需要先检测ModuleName对应的共享库是否存在,如果不存在则不会加载对应的开机动画,开机动画为 省略号。

如果修改主题,不在对应的so,在执行"plymouth-set-default-theme -R theme-name" 会提示 /usr/lib64/plymouth/modulename.so not exit 不存在。

下载方法: modulename.so 为 plymouth-plugin包内部的共享库 yum list plymouth-plugin* 列出所存在的安装包,找到对应安装包 yum -y install packegname 安装对应安装包 例如: two-step.so 对应的为 plymouth-plugin-two-step.x86_64 yum -y install plymouth-plugin-two-step.x86_64

1

2

3

4

5

6

下面为charge 所有需要安装包以及依赖包

Package Architecture Version Repository Size ===================================================================================================================================== 安装: plymouth-theme-charge x86_64 0.9.4-3.fc29 updates 14 k 安装依赖关系: plymouth-graphics-libs x86_64 0.9.4-3.fc29 updates 47 k plymouth-plugin-label x86_64 0.9.4-3.fc29 updates 15 k plymouth-plugin-two-step x86_64 0.9.4-3.fc29 updates 28 k

1

2

3

4

5

6

7

8

镜像服务

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:保姆级Mysql读写锁图文教程丨【绽放吧!数据库】
下一篇:华为云布道师谈DevOps:快速交付,做到“德智体美劳”全面发展
相关文章