Custom Grub 2

seen from United States

seen from United States
seen from United States
seen from United States
seen from United States
seen from China

seen from Germany
seen from China

seen from China

seen from Germany
seen from United States
seen from United States

seen from Malaysia

seen from China
seen from United States
seen from United States
seen from United States

seen from Malaysia
seen from Mexico
seen from China
Custom Grub 2
The critics and haters will criticize me for having Ubuntu as my go-to Linux distro of choice. But it just works. Yeah I'm not a fan of snap, and I install synaptic as an adjunct. Yeah Canonical does sketchy and annoying shit. Yeah "Mint is better" (is it?).
However I'm pretty concerned about the proposed changes to GRUB, I'm not a real computer expert guy but I like the ease of multi-booting very different operating systems on very different machines of very different ages, as well as the customization options so you can have beautiful, fancy bootloaders if you want. Then we have the whole debate proposed age-attestations in systemd and Linux distros in general, and Ubuntu 26.04 is going to introduce a host of other fundamental changes.
I don't really like changes. I still prefer the classic GNOME 2 user environment with hokey compiz/emerald visual enhancemens. I prefer the synaptic package manager to the window-store like SNAP. I like using BIOS instead of UEFI because UEFI restricts what I can use my machine for. If I want to run a twenty year old unix OS on my machine then I should be allowed to do that (and my new middling laptop doesn't even HAVE BIOS or legacy boot)
Since it's Ubuntu and not windows I don't have to worry about forced upgrades, but I am really considering changing my go-to distro.
This is a dairy entry, not a request for recommendations.
Grand Unified Boot Loader - GRUB 2
Grand Unified Boot Loader – GRUB 2
O Grub 2 é o sistema de boot padrão do Ubuntu desde a versão 9.10 e de outras distribuições com versões mais recentes, em especial no Kernel 2.6 e 3.x. Conheça o poderoso GRUB 2.
O Grub 2 foi reescrito completamente com o objetivo de permitir grande flexibilidade e ganho de performance. Dentre as diversas melhorias, as principais são:
Suporte a script com expressões condicionais e funções;
View On WordPress
New Post has been published on WebSetNet
New Post has been published on http://websetnet.com/grub-2-boot-menu-basics-and-how-to-add-a-custom-splash-image/
GRUB 2 boot menu basics and how to add a custom splash image
GRUB 2 is the boot loader that is used by all current Linux Distributions. In this guide I will explain how to modify the GRUB boot loader menu on your server or desktop, how to add menu entries and add a custom splash screen image.
GRUB 2 overview.
One of the important features in GRUB 2 is flexibility; GRUB understands filesystems and kernel executable formats, so you can load an arbitrary operating system the way you like, without recording the physical position of your kernel on the disk. Thus you can load the kernel just by specifying its file name and the drive and partition where the kernel resides.
The configuration file of GRUB has a new name (‘grub.cfg’ rather than ‘menu.lst’ or ‘grub.conf’), new syntax and many new commands. Configuration cannot be transferred directly, although most GRUB Legacy users should not find the syntax too surprising. The file “grub.cfg” is automatically generated by the command:
grub-mkconfig
Editing your GRUB menu.
Starting with the main file of GRUB “/boot/grub/grub.cfg”. This file is automatically generated and is not meant to be edited directly.You can use any editor you want to display the file. Have a look at the image below.
The GRUB 2 user file to be edited can be found in two places.
/etc/default/grub to change boot menu options. /etc/grub.d/ to edit the script files which create “grub.cfg”.
To start editing boot menu options go ahead and type :
gksu gedit /etc/default/grub
The things you will be able to change are :
GRUB_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=-1 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""
Explaining each one of them lets start with
GRUB_DEFAULT= The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string “saved”. Using the title may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it.
NOTE: IN THE ABOVE FILE SAMPLE THE NUMBER ‘0’ INDICATES THE VERY FIRST ENTRY OF THE grub.cfg FILE.
GRUB_HIDDEN_TIMEOUT= Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is “5”. Set to “0” to boot immediately without displaying the menu, or to “-1″ to wait indefinitely.
GRUB_HIDDEN_TIMEOUT_QUITE= Will display a count down timer if set to false, If set to true will simply display a blank screen all before displaying the actual GRUB menu.
GRUB_TIMEOUT= This is the number of seconds GRUB will display the menu before booting the default option. Setting it to “0” will boot the default option instantly without displaying the menu. Whereas setting in to “-1″ will hold up the menu till the user selects an option.
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian This line simply retrieves the name in the menu entry.
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” Removing “quite” out here will display a text output during the boot, whereas removing “splash” will display a black screen instead of the splash image.
You can go ahead and setup your own splash image by adding it to the /boot/grub/ directory
sudo cp splash1.jpg /boot/grub/
This was what you could do with the /etc/default/grub file. Now if you want to add your own boot menu entry this is where you will be able to do it. Type in the following as per the image.
Now, you will have to use the file 40_custom for writing your own menu entries.
gksu gedit 40_custom
You can go ahead and refer the entries generated by os_prober in /boot/grub/grub.cfg for your reference. The name of the file determines in which order the scripts are run so basically 30_os_prober will generate menu entry before 40_custom and then 41_custom. To make any file executable you will have to change the file permission. To change permission use
sudo chmod +x /etc/grub.d/40_custom
These were the basics. Now to apply all the settings and changes you will have to update GRUB.
sudo update-grub
Restart your system and checkout the changes by yourself.
5:12 am - starting to write this post
Lets see what time I finish writing this post.
Anyway, GRUB 2, here we go!
updating GRUB 2 is so annoying. You have to keep rebooting to see if it shows up in the menu --__--
Fedora: изменить последовательность загрузки в Grub 2
Загрузка Windows по умолчанию
Находим menuentry для ОС Windows
cat /boot/grub2/grub.cfg |grep Windows
Результат
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
Устанавливаем Windows menuentry по умолчанию
grub2-set-default "Windows 7 (loader) (on /dev/sda1)"
Проверяем запись по умолчанию
grub2-editenv list
Создаем обновленный grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg