10.2. Boot Loader Screen
The Red Hat Enterprise Linux 7 boot loader is
GRUB 2
. You can change several parts of GRUB 2
's appearance. The following sections show you how to change the distribution name, menu colors, and and the background image.
10.2.1. Distribution Name
By default,
GRUB 2
displays a title containing the distribution name. You can change the title by customizing the GRUB_DISTRIBUTOR
variable in the /etc/default/grub
file.
Procedure 10.1. Setting the Distribution Name
- As root, open the
/etc/default/grub
file. - Use the
GRUB_DISTRIBUTOR
variable to specify your own distribution name. The following is the excerpt of the/etc/default/grub
file. Update the second line with theGRUB_DISTRIBUTOR
variable:GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=Our Corporate Distro V1.2 GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true ...
- Run the following command as root to ensure the changes take effect:
grub2-mkconfig -o /boot/grub2/grub.cfg
Note
You need to update the/etc/default/grub
directory after every change you make in there.
Also, you can change the colors or the font of the text displayed at the
GRUB 2
screen by modifying the /etc/grub.d/40_custom
plain text file or by adding another file in the /etc/grub.d/
directory. You can choose from the following directives:
- set color_normal=foreground/background
- set color_highlight=foreground/background
- set menu_color_normal=foreground/background
- set menu_color_highlight=foreground/background
See the
grub
(8) man page for more information on the semantics and accepted values for these variables.
10.2.2. GRUB 2 Background
There is no
GRUB
background configured in the default setup. Nevertheless, it is possible to add an image to the boot loader screen.
Before you configure a background image for
GRUB 2
, it is necessary to have a GRUB 2
Unicode font installed for the gfxterm
graphical terminal. No font is provided by default, so the prerequisite is to convert an existing TTF or OTF file to the PF2 format used by GRUB 2
:
By running the
grub2-mkfont
command, convert an existing TTF or OTF file to the PF2 format. Name the output file unicode.pf2
to work correctly with the default configuration as written by grub2-mkconfig
.
Example 10.1. Converting a TTF File to PF2 Format
This example demonstrates the conversion from the
LiberationSerif-Bold.ttf
to the .pf2 format. The new .pf2 format file is called unicode2
so as not to be confused with the existing unicode.pf2
in the /grub2/fonts/
directory.
grub2-mkfont --output=/boot/grub2/fonts/unicode2.pf2 --size=24 /usr/share/fonts/liberation/LiberationSerif-Bold.ttf
Now, you can configure a background image for
GRUB 2
. The image file can reside outside of the boot/
directory.
Procedure 10.2. Adding an Image to the Boot Loader Screen
- Open the
/etc/default/grub
file as root. - Edit the following configuration variables in the file:
GRUB_TERMINAL=gfxterm GRUB_BACKGROUND=path_to_the_image.png
Supported formats are PNG, JPG, JPEG, and TGA. - Create a new configuration file with a background image:
grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot your system.
If necessary, the image will be scaled to fit the screen.