Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify GRUB startup background in Linux

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Linux how to modify the GRUB startup background, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

What preparatory work is needed before starting

ImageMagick (used on the command line only) or GIMP (used in GUI)

A sample image

Use GUI to modify the Splash background of Grub

First of all, let's use GUI to operate, here we use GIMP as the image editor.

Step 1. Open the image using GIMP (path: apply (Applications)-> Image (Graphics)-> GIMP Program (GNU Image Manipulation Program))

Step 2. Now we need to scale the image to the 640x480 size according to the actual situation. To do this, click Image-> Zoom the image (Scale Image). Remember to set the parameters in the following figure. Modify the width to 640 and the height to 480. Everything else remains the same.

Scale image

Click the Scale button

Step 3, then we need to index the image so that it uses only 14 colors. To do this, click Image (Image)-> Mode (Mode)-> Index (Indexed). Click the generate * * palette (generate optimum palette) option and set the color * * value (maximum number of colors) to 14 (below).

* the palette is limited to 14 colors

Click the convert button

Step 4. Save the file. It is saved here with the file name "UxTechno.xpm".

Save image file

Step 5. Compress the file in Zip. To do this, go to the saved location of the file-> right-click and select the Compress option, and select the gzip method to compress.

Step 6. Now copy or move "UxTechno.xpm.gz" to / boot/grub/UxTechno.xpm.gz.

Step 7. In this step, open the / boot/grub/grub.conf file to edit the splashimage parameters as follows, and save the file.

*, the content of the file should be like this:

# 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,0) # kernel / vmlinuz-version ro root=/dev/sda2 # initrd / initrd- [generic-] version.img # boot=/dev/sda default=0 timeout=5 splashimage= (hd0,0) / grub/UxTechno.xpm.gz hiddenmenu title Red Hat Enterprise Linux (2.6.32-220.el6.x86_64) root (hd0,0) kernel / vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=1d8c5075-1a5b-4fdc-ba15-0458b65c6012 rd_NO _ LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM initrd / initramfs-2.6.32-220.el6.x86_64.img

When you restart the server, you will see a splash background image with the following effect:

Use the command line to modify the Splash background of Grub

If you are a big fan of the command line, use the following methods.

Step 1. Before we begin, we need to modify the pixel resolution of the image. To do this, we also need to install ImageMagick on the Linux system. Use the following command on CentOS / RHEL to cross-check.

# rpm-qa | grep-I ImageMagick

If the command does not return output (that is, blank), it means that ImageMagick is not installed on your system. You must run the following command to install it.

# yum install ImageMagick

Once installed and re-checked, you will get output similar to the following:

# rpm-qa | grep-I ImageMagick ImageMagick-6.5.4.7-5.el6.x86_64

Then, continue with the next configuration. Here I use UxTechno's logo to do the splash background image.

Step 2. Use the following command to convert the pixel depth.

# convert-depth 8-colors 14-resize 640x480 uxtechno_logo.jpg uxtechno_logo.xpm

The meaning of the above options is as follows:

* use 14 colors

Resolution is 640x480

Use xpm format

Step 3, compress the file in Zip.

# gzip uxtechno_logo.xpm

Step 4. Copy the file to the / boot partition.

# cp uxtechno_logo.xpm.gz / boot/grub/

Step 5. Modify the splashimage parameters in the / boot/grub/grub.conf file as follows, and save the file.

Splashimage= (hd0,0) / grub/uxtechno_logo.xpm after reading the above, have you mastered the method of how to modify the GRUB startup background in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report