Linux操作系统之更改启动菜单的背景图实战案例

                                      作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.制作图像并上传到服务器

1>.使用window 10操作系统自带的画图工具指定像素的图片并保存到本地(推荐报错为"JPEG"类型)

2>.安装Linux上传工具包

[root@yinzhengjie ~]# yum -y install lrzsz
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
base | 3.7 kB :
extras | 3.4 kB :
updates | 3.4 kB :
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 :0.12.-27.1.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================
Installing:
lrzsz x86_64 0.12.-27.1.el6 base k Transaction Summary
============================================================================================================================================================================
Install Package(s) Total download size: k
Installed size: k
Downloading Packages:
lrzsz-0.12.-27.1.el6.x86_64.rpm | kB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lrzsz-0.12.-27.1.el6.x86_64 /
Verifying : lrzsz-0.12.-27.1.el6.x86_64 / Installed:
lrzsz.x86_64 :0.12.-27.1.el6 Complete!
[root@yinzhengjie ~]#

[root@yinzhengjie ~]# yum -y install lrzsz

3>.使用rz工具将我们制作好的图片上传到服务器上

[root@yinzhengjie ~]# rz
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ll
total
-rw-r--r-- root root Dec windows.jpg
[root@yinzhengjie ~]#

 

二.使用convert工具(相当于windows中的PS软件)将双穿的图片进行压缩处理

1>.安装convert软件包

[root@yinzhengjie ~]# yum -y install ImageMagick
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.zju.edu.cn
* extras: mirrors.zju.edu.cn
* updates: mirrors.zju.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick.x86_64 :6.7.2.7-.el6 will be installed
--> Processing Dependency: libwmflite-0.2.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libwmf-0.2.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libImath.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libIlmThread.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libIlmImf.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libIex.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Processing Dependency: libHalf.so.()(64bit) for package: ImageMagick-6.7.2.7-.el6.x86_64
--> Running transaction check
---> Package OpenEXR-libs.x86_64 :1.6.-8.1.el6 will be installed
---> Package ilmbase.x86_64 :1.0.-6.1.el6 will be installed
---> Package libwmf.x86_64 :0.2.8.4-.el6_7 will be installed
---> Package libwmf-lite.x86_64 :0.2.8.4-.el6_7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================
Installing:
ImageMagick x86_64 6.7.2.7-.el6 base 1.9 M
Installing for dependencies:
OpenEXR-libs x86_64 1.6.-8.1.el6 base k
ilmbase x86_64 1.0.-6.1.el6 base k
libwmf x86_64 0.2.8.4-.el6_7 base k
libwmf-lite x86_64 0.2.8.4-.el6_7 base k Transaction Summary
============================================================================================================================================================================
Install Package(s) Total download size: 2.4 M
Installed size: 8.7 M
Downloading Packages:
(/): ImageMagick-6.7.2.7-.el6.x86_64.rpm | 1.9 MB :
(/): OpenEXR-libs-1.6.-8.1.el6.x86_64.rpm | kB :
(/): ilmbase-1.0.-6.1.el6.x86_64.rpm | kB :
(/): libwmf-0.2.8.4-.el6_7.x86_64.rpm | kB :
(/): libwmf-lite-0.2.8.4-.el6_7.x86_64.rpm | kB :
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.3 MB/s | 2.4 MB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libwmf-lite-0.2.8.4-.el6_7.x86_64 /
Installing : ilmbase-1.0.-6.1.el6.x86_64 /
Installing : OpenEXR-libs-1.6.-8.1.el6.x86_64 /
Installing : libwmf-0.2.8.4-.el6_7.x86_64 /
Installing : ImageMagick-6.7.2.7-.el6.x86_64 /
Verifying : libwmf-0.2.8.4-.el6_7.x86_64 /
Verifying : ilmbase-1.0.-6.1.el6.x86_64 /
Verifying : libwmf-lite-0.2.8.4-.el6_7.x86_64 /
Verifying : ImageMagick-6.7.2.7-.el6.x86_64 /
Verifying : OpenEXR-libs-1.6.-8.1.el6.x86_64 / Installed:
ImageMagick.x86_64 :6.7.2.7-.el6 Dependency Installed:
OpenEXR-libs.x86_64 :1.6.-8.1.el6 ilmbase.x86_64 :1.0.-6.1.el6 libwmf.x86_64 :0.2.8.4-.el6_7 libwmf-lite.x86_64 :0.2.8.4-.el6_7 Complete!
[root@yinzhengjie ~]#

[root@yinzhengjie ~]# yum -y install ImageMagick

2>.查看conver命令的相关信息

[root@yinzhengjie ~]# which convert
/usr/bin/convert
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# rpm -qf /usr/bin/convert
ImageMagick-6.7.2.7-.el6.x86_64
[root@yinzhengjie ~]#

3>.将上传的jpg格式转换成xpm格式

[root@yinzhengjie ~]# ll
total
-rw-r--r-- root root Dec windows.jpg
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# convert -resize 640x480 -colors windows.jpg windows.xpm      #指定像素为"640x480",指定颜色深度为14,将windows.jps转换成windows.xpm
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ll
total
-rw-r--r-- root root Dec windows.jpg
-rw-r--r-- root root Dec : windows.xpm
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# file windows.xpm         #这是一个图片文件,内部信息如下图所示
windows.xpm: X pixmap image text
[root@yinzhengjie ~]#

 

三.修改"/boot/grub/grub.conf"配置文件

1>.使用gzip命令将xpm格式文件进行压缩

[root@yinzhengjie ~]# ll
total
-rw-r--r-- root root Dec windows.jpg
-rw-r--r-- root root Dec : windows.xpm
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# gzip windows.xpm
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ll
total
-rw-r--r-- root root Dec windows.jpg
-rw-r--r-- root root Dec : windows.xpm.gz
[root@yinzhengjie ~]#

2>.将"windows.xpm.gz"移动到"/boot/grub"目录并修改"/boot/grub/grub.conf"文件内容,将背景图片名称改为咱们自定义的图片即可

[root@yinzhengjie ~]# mv windows.xpm.gz /boot/grub/
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ll /boot/grub/windows.xpm.gz
-rw-r--r-- root root Dec : /boot/grub/windows.xpm.gz
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# grep splashimage /boot/grub/grub.conf
splashimage=(hd0,)/grub/splash.xpm.gz
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# vim /boot/grub/grub.conf
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# grep splashimage /boot/grub/grub.conf
splashimage=(hd0,)/grub/windows.xpm.gz
[root@yinzhengjie ~]#
[root@yinzhengjie ~]#

3>.重启操作系统,观察启动菜单背景是否更改成咱们自定义的图片即可

[root@yinzhengjie ~]# reboot 

Broadcast message from root@yinzhengjie
(/dev/pts/) at : ... The system is going down for reboot NOW!
[root@yinzhengjie ~]#

4>."/boot/grub/grub.conf"配置文件说明

[root@yinzhengjie ~]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_node200-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1                    #默认使用菜单1
timeout=5                    #指定超时时长为5秒
splashimage=(hd0,)/grub/windows.xpm.gz  #指定背景图片
hiddenmenu #默认隐藏菜单选择执行默认的菜单1,当然我们只需要在启动操作系统时敲击任意键就会弹出菜单选项框,如果我们删除了该项,那么在启动操作系统时不管我们是否有按任意键都会弹出启动菜单,在指定的$timeout之内没有选择就会走选择$default菜单。

title CentOS (2.6.-.el6.x86_64)    #菜单0
root (hd0,)
kernel /vmlinuz-2.6.-.el6.x86_64 ro root=/dev/mapper/vg_node200-lv_root nomodeset rd_NO_LUKS LANG=en_US.UTF- rd_LVM_LV=vg_node200/
lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_node200/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
  initrd /initramfs-2.6.-.el6.x86_64.img
title CentOS (4.6.-.el6.x86_64)    #菜单1
kernel (hd0,)/vmlinuz-2.6.-.el6.x86_64 ro root=/dev/mapper/vg_node200-lv_root nomodeset rd_NO_LUKS LANG=en_US.UTF- rd_LVM_LV=vg_n
ode200/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_node200/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
  initrd (hd0,)/initramfs-2.6.-.el6.x86_64.img
[root@yinzhengjie ~]#

Linux操作系统之更改启动菜单的背景图实战案例的更多相关文章

  1. linux操作系统语言更改

    有时候我们的服务器在安装时安装的默认语言不支持中文,导致程序.文档中的汉子显示乱码,从而使系统报一些莫名其妙的错误,这是可以更改操作系统的默认语言 1.echo  $LANG   查看当前操作系统的语 ...

  2. Linux操作系统-CentOS6启动流程和服务管理

    Linux操作系统-CentOS6启动流程和服务管理 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Linux组成 1>.Linux: kernel+rootfs ker ...

  3. 自制Linux操作系统

    自制Linux操作系统 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.添加一块新的磁盘设备 1>.将虚拟机关机,点击"编辑虚拟机设置" 2>.点 ...

  4. 本地访问weblogic控制台无反应,关闭linux操作系统防火墙

    有时候,我们在Linux操作系统上成功启动了weblogic,也查看了7001端口的状态是开启的.但是访问weblogic控制台没有反应,也没有报错. 使用 netstat -ano | grep 7 ...

  5. CentOS7.5更改grub2菜单背景&开机动态画面

    Grub2菜单背景 红帽企业版 Linux 7 的引导装载程序是“GRUB 2”.您可以更改“GRUB 2”外观的几个部分.以下几小节将向您展示如何改变 Linux 发行版名称.菜单颜色,和背景图片. ...

  6. 启动VMware环境下的Linux操作系统,添加新分区

    启动VMware环境下的Linux操作系统,添加新分区,需要root账号身份. 3.1 [fdisk -l] 最大分区为/dev/sda3,说明新创建的分区将会是sda4 3.2 输入[fdisk / ...

  7. Linux操作系统-CentOS7启动流程和服务管理

    Linux操作系统-CentOS7启动流程和服务管理 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.systemd POST --> Boot Sequence --&g ...

  8. 献给初学者:谈谈如何学习Linux操作系统

    本文出自 “技术成就梦想” 博客,请务必保留此出处http://ixdba.blog.51cto.com/2895551/569329. 为了能把这篇不错的文章分享给大家.所以请允许我暂时用原创的形式 ...

  9. (转)Linux 开机引导和启动过程详解

    Linux 开机引导和启动过程详解 编译自:https://opensource.com/article/17/2/linux-boot-and-startup作者: David Both 原创:LC ...

随机推荐

  1. 连接池-Mybatis源码

    持续更新:https://github.com/dchack/Mybatis-source-code-learn Mybatis连接池 有这么个定律,有连接的地方就有池. 在市面上,可以适配Mybat ...

  2. 【Maven学习】定制库到Maven本地资源库

    目标:手工操作将一个jar安装到本地仓库 第一步:首先获取到jar包,可以是第三方的 也可以是自己创建的,放到本地任意目录 比如:joda-time-2.10.3,放到C:\jar\  目录下面 第二 ...

  3. 升级libstdc++、libgcc_s.so、libc.so.6

    参考资料:https://blog.csdn.net/ltl451011/article/details/7763892/ https://blog.csdn.net/na_beginning/art ...

  4. html遮罩层实现

    html文件内容如下 <!--调出子窗口按钮--> <button class="add" onclick="addClick();"> ...

  5. netty自定义解码器

    在socket传输通信中容易丢包问题,什么半包问题,这些都是很正常的问题,处理方法就是定义自己的编解码规则了,让每次接收按定义好的规则为一个完整包作为数据源即可. 下面个例子就是netty自定义的一个 ...

  6. jmeter jtl 文件

    一.获取.jtl文件 使用非 GUI 模式,即命令行模式运行 JMeter .执行完成jmeter后,会生成jtl文件. 1.1. 命令介绍 1)先cmd进入到jmeter的bin文件目录下(这里是 ...

  7. 在CAD中插入谷歌地球卫星地图

    本文主要介绍如何在CAD中插入谷歌地球卫星地图,作为参照光栅图像.谷歌地球卫星地图使用“迈高图-地图数据下载器”(以下简称:迈高图)下载.迈高图会给出相关插入参数(插入点和缩放比例),保证插入卫星地图 ...

  8. c# EF插入数据报错跟踪代码

    我们在使用EF进行数据库插入的时候或出现一些插入失败的情况,但是具体是哪个字段不符合数据库设计要求无法得知,普通的try catch 无法捕获加上一下方法就可以 try            {    ...

  9. golang中,map作为函数参数是如何传递的

    当你声明一个map的时候: m := make(map[int]int) 编译器会调用 runtime.makemap: // makemap implements a Go map creation ...

  10. 四则运算自动出题之javaweb版

    四则运算出题机之JAVAWEB版 要求还是和之前的出题形式一样 begin.jpg <%@ page language="java" contentType="te ...