JustToThePoint English Website Version
JustToThePoint en español
JustToThePoint in Thai

How to configure a bootloader. How to update a microcode.

Pessimists, we’re told, look at a glass containing 50% air and 50% water and see it as half empty. Optimists, in contrast, see it as half full. Engineers, of course, understand the glass is twice as big as it needs to be, Bob Lewis

The more you know, the more you realize you know nothing, Socrates

A boot loader is a critical piece of software running on any system. Immediately after a device starts, a bootloader is launched by a bootable medium, such as a hard drive, a USB stick, or a CD/DVD. The bootloader loads the kernel into memory and passes control to it. Bootloader 

There are four main stages in the boot process of any computer:

  1. The BIOS is the Basic Input/Output System. It is accessed and configured through the BIOS Setup Utility. First, the computer runs a Power-On Self Test. It is a special set of ROM routines designed to test whether system components, such as RAM, keyboards, and disk drives, are functioning properly before attempting to boot the operating system.

    Typically, the BIOS checks the master boot record on the primary hard disk to see what to load next. This is a section on your hard drive where the bootloader is located.

  2. The bootloader loads the kernel of the operating system into memory and then starts it with a set of kernel parameters. One of the most common bootloaders is GRUB.

  3. When the kernel is loaded, it immediately initializes devices, their drivers, and the computer’s memory, and mounts the root file system. The main job of the kernel is to load up the init process.

  4. The init process is the first process that get started. It starts essential services, daemons, and other background processes on your system.

Installing GRUB using grub-install

Grub is one of the most common booloader for GNU/Linux distributions. It allows you to choose between different operating systems, if there is more than one on your system.

pacman -Sy grub efibootmgr networkmanager network-manager-applet 
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB

grub-install’s arguments:
‐‐ efi-directory=/boot/efi = It specifies where the EFI System is mounted.
‐‐ bootloader-id=GRUB = It is the bootloader identifier.
‐‐ target=x86_64-efi = It installs GRUB for x86_64 systems.

If it does not work, you may want to try: grub-install ‐‐target=x86_64-efi ‐‐efi-directory=/boot/efi ‐‐bootloader-id=GRUB ‐‐no-nvram ‐‐removable ‐‐force

After the installation, the configuration file /boot/grub/grub.cfg needs to be generated by using grub-mkconfig:

grub-mkconfig -o /boot/grub/grub.cfg 

# Start the service NetworkManager. It manages your network devices and connections: Ethernet, Wifi, etc. It attempts to keep your network connectivity active all the time.
# This is part of Installing Arch from Scratch, https://justtothepoint.com/software/archlinux2/.
systemctl enable NetworkManager

# Exit the new system, unmount the partitions, and reboot.
exit
umount -R /mnt
echo All Done. Type "reboot" to enjoy!

Configuring GRUB

If you want to set the GRUB’s time to zero because you only have a single operating system on your computer, edit GRUB’s configuration file as follows, sudo vim /etc/default/grub:

GRUB_DEFAULT=0 # It chooses the default OS. By default, it uses the first entry as the default OS.
GRUB_TIMEOUT=0 # It sets the GRUB's time to zero.
GRUB_CMD_LINE_DEFAULT="loglevel=3 quiet" 
# Command-line arguments to add to menu entries for the Linux kernel. "loglevel=3 quiet" makes sure no log messages are displayed during boot (Silent boot).
GRUB_CMDLINE_LINUX="rootfstype=ext4" 
# This option lists command-line arguments to add only to the default menu entry, after those listed in GRUB_CMD_LINE_DEFAULT. The rootfstype=ext4 directive tells Linux that the root filesystem is ext4.
GRUB_GFXMODE=1280x124,auto # The resolution used on the graphical terminal.
GRUB_INIT_TUNE="480 440 1" # Set a beep at GRUB start.

GRUB_THEME=/boot/grub/themes/fallout-grub-theme/theme.txt # Fallout Grub2's theme.

Grub2 bootloader can be customized and there are many cool bootloader themes to choose from. Go to Gnome-look, GRUB Themes, e.g., Fallout. This bootloader theme’s installation is quite simple, just a single line:

wget -O - https://github.com/shvchk/fallout-grub-theme/raw/master/install.sh | bash

![Grub themes](/software/images/bootTheme.jpg ./software/images/bootTheme2.jpg) 

Grub-theme-vimix is a blur theme for grub2. Go to Gnome-look, GRUB Themes, Grub-theme-vimix, select Files, Download Vimix-1080p.tar.xz, and extract it (cd ~/Downloads, tar xvf Vimix-1080p.tar.xz). Finally, move into the theme folder (cd Vimix-1080p) and run the installation script (sudo sh ./install.sh). Grub themes 

An alternative to GRUB is the rEFInd Boot Manager. It is a highly customizable UEFI bootloader, but many users have problems configuring it correctly and have ended up with an unbootable machine. Ubuntu: sudo apt-add-repository ppa:rodsmith/refind && sudo apt-get update && sudo apt install refind. Arch: sudo pacman -S refind && sudo refind-install.

Microcode

Processor manufacturers release stability and security updates to the processor microcode. These updates provide bug fixes that can be critical to the stability of your system”, Microcode, Arch Wiki.

To update your CPU microcode on Arch Linux: sudo pacman -Syy intel-ucode (Intel processors)/sudo pacman -Syy aamd-ucode (AMD processors). sudo grub-mkconfig will automatically detect the microcode update and configure GRUB appropriately.

After installing the microcode package or set the GRUB’s time to zero, regenerate the GRUB’s file configuration by running sudo grub-mkconfig -o /boot/grub/grub.cfg

Bitcoin donation

JustToThePoint Copyright © 2011 - 2024 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.