Questo contenuto non è disponibile nella lingua selezionata.
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 Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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/grubfile. - Use the
GRUB_DISTRIBUTORvariable to specify your own distribution name. The following is the excerpt of the/etc/default/grubfile. Update the second line with theGRUB_DISTRIBUTORvariable:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the following command as root to ensure the changes take effect:
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
You need to update the/etc/default/grubdirectory 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 Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
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
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/grubfile as root. - Edit the following configuration variables in the file:
GRUB_TERMINAL=gfxterm GRUB_BACKGROUND=path_to_the_image.png
GRUB_TERMINAL=gfxterm GRUB_BACKGROUND=path_to_the_image.pngCopy to Clipboard Copied! Toggle word wrap Toggle overflow Supported formats are PNG, JPG, JPEG, and TGA. - Create a new configuration file with a background image:
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Reboot your system.
If necessary, the image will be scaled to fit the screen.