前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Plymouth 修改开机动画

Plymouth 修改开机动画

作者头像
何其不顾四月天
发布2023-03-10 13:25:53
8740
发布2023-03-10 13:25:53
举报
文章被收录于专栏:四月天的专栏

Plymouth 修改开机动画

Plymouth 修改开机动画

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

相关资料

实验环境:Fedora29 Plymouth 为 Fedora自带的开/关机动画引导工具 下列所作修改均为 Fedora29 系统 所有的相关操作,均为默认引导。

相关命令介绍

下面为plymouth的相关命令介绍

代码语言:javascript
复制
usage: plymouth-set-default-theme { --list | --reset | <theme-name> [ --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)
  <theme-name>           Name of new theme to use (see --list for available themes)
代码语言:javascript
复制
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 主题引导程序编译到内核,重新生成内核

所需安装包/依赖包

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

代码语言:javascript
复制
[root@bogon ~]# plymouth-set-default-theme
charge

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

代码语言:javascript
复制
 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

在线安装: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仓库自带的主题
代码语言:javascript
复制
已安装的软件包
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 

相关查看命令:

代码语言:javascript
复制
yum list plymouth-theme* #plymouth-theme* 列出Yum库所有 Plympouth 支持的主题
yum list plymouth* #plymouth* 列出plymouth 所有对应的包
yum list plymouth-plugin* #plymouth-plugin* 列出 plymouth 所有对应的插件包,即对应的.so 

所有对应插件包:

代码语言:javascript
复制
#已安装的软件包
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 

安装步骤: 安装自带的主题:

代码语言:javascript
复制
plymouth-set-default-theme theme-name #设置开机主题
plymouth-set-default-theme -R theme-name #重新编译镜像,加载开机主题引导程序

下载新的主题

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

plymouth-theme-breeze.x86_64为例 一般结构如下:主题包名,依赖插件包名 从这可以得到:正常一个主题所依赖的安装结构,主题包主题所对应的插件包

代码语言:javascript
复制
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 软件包

设置自己的开机动画

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

代码语言:javascript
复制
#选定自己所需要修改的开机主题,修改对应的开机主题图片,记住同名。

系统默认主题: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 #结束颜色

代码语言:javascript
复制
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- 这两组图片为过场动画图片

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

错误提示

  • 注意:需要先检测ModuleName对应的共享库是否存在,如果不存在则不会加载对应的开机动画,开机动画为 省略号。
  • 如果修改主题,不在对应的so,在执行"plymouth-set-default-theme -R theme-name" 会提示 /usr/lib64/plymouth/modulename.so not exit 不存在。
代码语言:javascript
复制
下载方法:
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

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

代码语言:javascript
复制
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  
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-01-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Plymouth 修改开机动画
  • Plymouth 修改开机动画
    • 相关资料
      • 相关命令介绍
        • 所需安装包/依赖包
          • 修改开机动画
            • 设置自己的开机动画
              • 错误提示
              领券
              问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档