📜 ⬆️ ⬇️

Penguin grub color

Introduction


The computer is booting Linux, which was once installed there. Then the structure of the hard disk has undergone a number of changes: partitions were created, and the boot loader was installed. Judging by most distributions, the most popular Linux in the world is the GRUB bootloader.

The action of this operating system loader occurs from the user's point of view as follows: after turning on the computer, the user sees the list of operating systems installed on his computer. By design, this list is completely different: black and white, multi-colored, with penguins.

In the end, the user selects the operating system.

The focus of this article is the GRUB graphics mode with animated penguins, which the programmer Steffen Winterfeldt made him walk back and forth and issue several other numbers. First of all - the penguins, and behind this - the gfxboot utility for changes and configuration tests of the graphic loader.
')
Even in the article there is a lot of information on specific distributions (Mageia, openSUSE, Ubuntu) with different methods of changing the graphical loader. A separate topic is the grub4dos based graphical boot screen.

Thanks


I would like to thank A. Fedorchuk for an article about the VirtualBox virtual machine and operating system images from osboxes.org, the information from which helped a lot when writing this article.

Penguins and gfxboot


A penguin headband includes a number of pigigins in the outside world, among snow and ice, as well as a background image for the list of operating systems in the form of a frozen rectangular stone.

Physically, this screensaver is a cpio-archive, usually it is / boot / message. You can, in principle, view this archive, unpack it into the current directory and repack. But in order to make life easier for you, there is gfxboot utility.

openSUSE


When GRUB2 is installed on the computer, this test system will return to GRUB when the person performing it has a lack of knowledge. This is followed by a block instruction on how to use GRUB as a boot loader.

1. Installing GRUB on the hard disk using the command

sudo zypper in grub 

ends with the message: grub is not the active boot loader.

2. Making GRUB an active loader using the GRUB shell as shown in the screenshot. It assumes that GRUB is installed on the first partition of the first hard disk (hd0,0).


Installing the GRUB code in the MBR

The output of the GRUB shell in response to the last command contains the file name / boot / grub/menu.lst.

3. Create and edit this file with the command

 sudo vi /boot/grub/menu.lst 

It will contain the configuration of the boot menu, analogous to the configuration of the boot menu contained in the file / boot / grub2/grub.cfg. Their syntaxes are essentially related to each other. With some modifications, the text of the GRUB2 configuration file serves as the basis for the text of the GRUB configuration file.

Fragment of the /boot/grub2/grub.cfg file

 menuentry 'openSUSE' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-99d4f445-3170-4ced-a612-fe255dc11b3c' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 99d4f445-3170-4ced-a612-fe255dc11b3c else search --no-floppy --fs-uuid --set=root 99d4f445-3170-4ced-a612-fe255dc11b3c fi echo 'Loading Linux 3.16.6-2-default ...' linux /boot/vmlinuz-3.16.6-2-default root=UUID=99d4f445-3170-4ced-a612-fe255dc11b3c quiet resume=/dev/sda2 splash=silent quiet showopts echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.16.6-1-default } 

and the corresponding fragment of the file /boot/grub/menu.lst

 title openSUSE root (hd0,0) kernel /boot/vmlinuz-3.16.6-2-default root=UUID=99d4f445-3170-4ced-a612-fe255dc11b3c quiet resume=/dev/sda2 splash=silent quiet showopts initrd /boot/initrd-3.16.6-1-default 

4. To enable the GRUB graphic mode with animated penguins, use the text editor vi to add a line to the beginning of the /boot/grub/menu.lst file

 gfxmenu (hd0,0)/boot/message 

and make the probability of occurrence of penguins equal to 100% using the command

 sudo gfxboot --change-config penguin=100 


Penguins

Mageia


When GRUB is installed on the computer, the penguin menu is different. The following is a corresponding instruction.

1. The beginning of the instruction is on the screenshot.


Installing gfxboot and gfxboot-themes

2. In the /boot/grub/menu.lst file instead of the line

 gfxmenu (hd0,0)/boot/gfxmenu 

we enter a line

 gfxmenu (hd0,0)/boot/message 

choose and customize the theme of the graphical boot screen

 gfxboot --new-theme openSUSE gfxboot --change-config penguin=100 

and exit the superuser command shell session using the command

 exit 


Penguins

Ubuntu


This system has gfxboot, gfxboot-themes, grub, but in the latter the graphical boot screen does not work. Instead, it offers static images displayed in the boot menu using the splashimage parameter specified in the GRUB configuration file. In this case, you can use the grub4dos bootloader.

Grub4dos on a bootable flash drive and hard drive


The boundaries of the application grub4dos wider installation on flash drives, but this is probably the main one. Below in the listing is an approximate procedure or scheme of its installation.

Installing grub4dos on a flash drive


 wget https://downloads.sourceforge.net/project/grub4dos/GRUB4DOS/grub4dos%200.4.4/grub4dos-0.4.4.zip unzip grub4dos-0.4.4.zip cd grub4dos-0.4.4 sudo ./bootlace.com /dev/sdb 

After copying the contents of the grub4dos directory to a flash drive and loading the computer with it, we see a multi-colored boot menu, as in the screenshot.


Grub4dos boot menu

After copying to the same file / boot / message, obtained by the method described above, and replacing the contents of the menu.lst file with another containing the string

 gfxmenu /message 

we get all the same penguins.

On the hard disk, grub4dos can be called from GRUB by entering the description of the corresponding menu item in its configuration file:

 default 0 timeout 0 title grub4dos kernel (hd0,5)/grub.exe --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)" initrd (hd0,5)/myfloppy.img 

This is valid if the sixth partition of the hard disk with fat12 or fat32 contains the files grub.exe and myfloppy.img, the last of which is the image file of the boot diskette. It combines files from the archive grub4dos-0.4.4.zip. The following are a few commands, the execution of which provokes the addition of the file myfloppy.img necessary for downloading grub4dos to disk.

 sudo mkfs.msdos - myfloppy.img 1440 sudo ./bootlace.com --floppy myfloppy.img mkdir dos sudo mount -o loop myfloppy.img dos sudo cp grub4dos-0.4.4/* dos sudo vi dos/menu.lst 

It remains to add the message file to the grub.exe and myfloppy.img files directory, replace the contents of the dos / menu.lst file with something similar to that reproduced in the following listing and unmount the myfloppy.img image file using the command

 sudo unmount /dev/loop0 

to get the result, repeatedly obtained earlier in this article.

The contents of the configuration file menu.lst for grub4dos

 default 0 timeout 3 gfxmenu /message title Ubuntu root (hd0,0) chainloader +1 title Reboot reboot 

Source: https://habr.com/ru/post/322586/


All Articles