Tuesday, September 10, 2019

11 - UEFI Boot Setup








Toucan Linux Project - 11


A Roll Your Own Distribution
Goal 1 – Base System
Stage 2 – Building the Base System

This installment will cover the changes required to boot the system using UEFI. Last time we did the much simpler legacy boot option using the Master Boot Record of the BIOS. Though UEFI makes booting from multiple media much easier, to do so it introduces complexity. First, we'll cover the UEFI boot process. Even if you are using MBR I suggest you read through this section for additional understanding of the Linux boot process. At the end is a tutorial to boot from the Grub command line in case of serious problems.

UEFI Booting


BIOS booting is very simple, at least in concept, but in practice it started getting more complicated. With BIOS style booting the first sector of the disk contained a table of the partitions on the system and a small space for the boot loader code--very small. When the system is turned on the start address for the CPU is hardwired and jumped into the BIOS firmware. The BIOS firmware did whatever it needed to configure the hardware to known state, and at some point loaded the loader code from the MBR into memory and jumped to it. This code then did whatever it needed to get the hardware ready for the operating system, and then loaded the operating system kernel image into memory and finally executed it. Since the MBR boot code was so small, it might just load a much larger boot loader into memory and jump into it. This is how most modern MBR boot loaders work like Grub, LILO, etc.

UEFI is much different. It is a specification for what firmware should do. Most importantly is defines a type of executable file that the firmware must be able to read, load, and execute. This means as an OS vendor all you need to do is write your boot loader program in the proper executable file format and the firmware can run it. This was very important because in the BIOS MBR world, the BIOS didn't understand executable file formats, partitions, disks, etc. it just loaded the boot code (or whatever was written there, expecting it to be code) and then executed it. UEFI also requires the firmware be able to read at least one partition table format known as GUID Partition Tables (GPT) in order to read and define disk partitions. It also requires the firmware to understand at least one filesystem which is the Microsoft File Allocation Table (FAT) in the FAT12, FAT16, and FAT32 variations. This meant the firmware could now read partitions, understand a file system to read files and directories, and execute code in a given format.

The last important part of the UEFI specification (though there is a lot more) is an area to store variables in NVRAM that will persist between power cycles and defines the format of some of those variables to be standard. Now all that is needed is a piece of code called the boot manager that will read those variables in order to create a set of choices in order to boot whatever operating systems are present and each operating system vendor then only needs to write his boot loader in the native processor binary code and store it in the standard executable file format. After that all that needs to be done is add in the proper variables for the firmware boot manager to add the new operating system to the menu (which might not be a menu at all).

The beauty of this is that the boot loader is now just a file on disk. It can be very complicated or very simple but it is a file not a "magic boot area" that only one operating system can own at a time. So UEFI booting at the bare bones level might go something like this:

1) Read the UEFI variables looking for the variables that define boot loaders
2) Read another variable to determine which one to boot or
3) Show all entries in a menu and let the user pick one

But it might also be something like

1) Start with the first disk on the bus the firmware understands
2) Read the partition table (GPT format)
3) Go through the partitions and look for ones of type "EFI System Partition"
4) This will be a FAT12, FAT16, ro FAT32 filesystem so
5) Go through the files looking for files that are in the proper executable formation and
6) Add them to a list or possible boot loaders
7) Go to the net disk and jump to set 1 or if the last disk then
8) Present a menu to allow the user to choose which boot loader to use

Most UEFI firmwares will do a combination of the two and automatically show a menu containing the boot loaders as defined in the UEFI variables. But they will generally also look at other disks, such as USB, SD, etc. to find other choices. If the "special key" isn't pressed on system startup, it just boots the operating systems in the order provided from the EUFI variables. But if the special key is pressed, it instead interrogates all disks and presents a menu with everything it finds.

EUFI Booting with Grub


To boot using UEFI requires some additional packages be added to the base system. Several have dependencies that must also be added, and because we are using a newer binutils, we are required to  make some changes to the GRUB source code and recompile. Fortunately, we can do this as a patch.

Grub needs a font for the graphics console or boot messages won't appear until the kernel takes over the video. In order to see all messages from the beginning of the boot process, we need to supply a font. Grub does have the ability to make the font using grub-mkfont, but this requires FreeType and its dependencies which, at this point, we want to avoid. Fortunately Grub has a default font we can use as an alternative, allowing us to avoid additional build requirements. At this point we won't support grub-mkfont.

Step 1 - Checking the Environment


First be sure your system booted using UEFI. This will be the method that booted the host operating system (MX Linux) but since we are using its kernel and mounting the sysfs we have everything we need. To verify it was booted using UEFI type

ls /sys/firmware/efi

If you see directories under this then the system booted using UEFI.

As before you should have mounted the target filesystem using mount.sh, the virtual filesystems (proc, sys, dev , dev/pts) , and change the root to the target using chroot_to_lfs. Make sure the boot partition is mounted under /boot on the target. Ensure the confs environment variable is set

Step 2 - Download the source


To fetch the source

cd /sources
cat > wget-efi.files << EOF
http://rpm5.org/files/popt/popt-1.16.tar.gz
https://github.com/dosfstools/dosfstools/releases/download/v4.1/dosfstools-4.1.tar.xz
https://github.com/rhinstaller/efibootmgr/releases/download/16/efibootmgr-16.tar.bz2 
EOF

wget --input-file=wget-efi.files --continue --no-check-certificate

Note we skip the certificate check when using wget since we have no set up the local CA. We'll address that later.

Now switch to the directory where the cci.pl program is located
cd ~/cci

Step 3 - popt-1.16


Create the config

echo "./configure --prefix=/usr --enable-static" > $confs/config.popt

Though we have opted to avoid static libraries this one is require because efivars requires it.

Now build with

./cci.pl -n popt -p popt-1.16.tar.gz -c config.popt 

Step 4 - dosfstool-4.1


This is required by efibootmgr at runtime.
Only a configuration is need for this one.

Create the config

cat > $confs/config.dosfstools << EOF
./configure --prefix=/usr \
     --sbindir=/usr/bin \
     --mandir=/usr/share/man \
     --docdir=/usr/share/doc
EOF

The build with

./cci.pl -n dosfstools -p dosfstools-4.1.tar.xz -c config.dosfstools

Step 5 - efivar-30


Running the test suite for this package has been known to corrupt the UEFI firmware. It isn't ran by default, but because this package has undergone changes in the past regarding how it builds and test, we disable the test suite to make sure it is never ran.

There is also changes required to compile with GCC 9 that are not yet part of a release. We can make a patch or use the GIT master. Using the master presents a problem as we have no official release tarball. We will make one from the master.

pushd /sources
wget https://github.com/rhboot/efivar/archive/master.zip --no-check-certificate
mkdir -v sandbox
cd sandbox
unzip ../master.zip
mv efivar-master/ efivar-37.1pre
tar -czf ../efivar-37.1pre.tar.gz efivar-37.1pre/
cd ..
rm -rf sandbox
popd

Create the config

cat > $confs/config.efivar << "EOF"
cp -p Make.defaults Make.defaults.dist
sed 's|-O2|-Os|g' -i Make.defaults
cp -p src/test/Makefile src/test/Makefile.dist
sed 's|-rpath=$(TOPDIR)/src/|-rpath=$(libdir)|g' -i src/test/Makefile
EOF

It doesn't support parallel builds so we must disable them. Create the compile

cat > $confs/compile.efivar << "EOF"
make libdir="/usr/lib/" bindir="/usr/bin/" \
         mandir="/usr/share/man/"     \
         includedir="/usr/include/" V=1 -j1
EOF

Lastly, create the install

cat > $confs/install.efivar << "EOF"
make -j1 V=1 DESTDIR="${pkgdir}/" libdir="/usr/lib/" \
         bindir="/usr/bin/" mandir="/usr/share/man"   \
         includedir="/usr/include/" install
EOF

The build with

./cci.pl -n efivar -p efivar-37.1pre.tar.gz -c config.efivar -m compile.efivar -t null -i install.efivar

This means we will need to revisit this package once they create a real release.

Step 6 - efibootmgr-16


There is no test. We need to make a config to patch the make files to turn of errors as warnings. These errors are not fatal.

echo "sed -i s/-Werror// Make.defaults" > $confs/config.efibootmgr

Create the install

cat > $confs/install.efibootmgr << EOF
install -v -D -m0755 src/efibootmgr /usr/sbin/efibootmgr
install -v -D -m0644 src/efibootmgr.8 /usr/share/man/man8/efibootmgr.8
install -v -D -m0644 src/efibootdump.8 /usr/share/man/man8/efibootdump.8
EOF

Create the compile

echo "EFIDIR=/boot/efi make" > compile.efibootmgr

Now build with

./cci.pl -n efibootmgr -p efibootmgr-14.tar.bz2 -c config.efibootmgr -m compile.egibootmgr -t null -i install.efibootmgr

Step 7 - Fixing Grub for newer binutils


We need to make a few changes to Grub. Under the newer binutils the x86_64 assembler creates a file that is a different format (R_X86_64_PLT32) which Grub doesn't know how to handle relocation. After a lot of research I found this can be handled the same as the R_X86_64_PC32 file. This change can be applied through a patch.

First make the patch file

cat > /sources/grub-x86_64_plt32_fix_relocation.patch < "EOF"
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index a2bb054..39d7efb 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr
*sections,
           break;

         case R_X86_64_PC32:
+        case R_X86_64_PLT32:
           {
             grub_uint32_t *t32 = (grub_uint32_t *) target;
             *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
index 9179285..a79271f 100644
--- a/util/grub-module-verifier.c
+++ b/util/grub-module-verifier.c
@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = {
       -1
     }, (int[]){
       R_X86_64_PC32,
+      R_X86_64_PLT32,
       -1
     }
   },
EOF

Again we will manually handle the patch path.

Create the config

cat > $confs/config.grub < EOF
patch -Np1 -i /sources/grub-x86_64_plt32_fix_relocation.patch
./configure --prefix=/usr  \
            --sbindir=/sbin        \
            --sysconfdir=/etc      \
            --disable-efiemu       \
            --disable-grub-mkfont  \
            --with-platform=efi    \
            --target=x86_64        \
            --program-prefix=""    \
            --with-bootdir="/boot" \
            --with-grubdir="grub" \
            --disable-werror
EOF

The install with

./cci.pl -n grub -p grub-2.02.tar.xz -c config.grub -t null

Step 8 - Installing the Default Font


Since we chose not to create the grub-mkfont program which will create the font from scratch we need to supply it with a default font. This can be downloaded, but you have a copy available on the host.

First create the directory

mkdir -vp /boot/grub/fonts

In a terminal on the host do
cp /boot/grub/unicode.pf2 $LFS/boot/grub/fonts

Or if you prefer download it

wget --no-certificate-check --directory-prefix=/boot/grub/fonts https://github.com/nlamirault/muk/raw/master/grub/fonts/unicode.pf2

Step 9 - Mount  efivarfs


For the efibootmgr to access the EFI variables on the system, they need to be exposed for access. There is a special virtual filesystem called efivarsfs. Add it the /etc/fstab

echo "efivarfs       /sys/firmware/efi/efivars  efivarfs  defaults  0      1" >> /etc/fstab

The mount with

mount /sys/firmware/efi/efivars

Check to be sure it worked

$ ls /sys/firmware/efi/efivars
AMITCGPPIVAR-a8a2093b-fefa-43c1-8e62-ce526847265e
AWVC-c07a1f7c-fa13-4fcb-92ca-3b32bc092e13
AsusCountryCodeIntel-607005d5-3f75-4b2e-98f0-85ba66797a3e
AsusEDID-607005d5-3f75-4b2e-98f0-85ba66797a3e
...

The contents depend entirely on your system but it should contain files with similar endings. If this doesn't work check all kernel parameters in the next step.

Step 10 - Checking the Kernel


If something didn't work with the previous step it probably means something is missing in the kernel. Check the following options to make sure. With the default configuration it will pick all the right options for UEFI but one and we have already selected it (EFI Stud support). But check the code of the kernel with

cd /sources/linux-5.2.9
make nconfig

Then check the following

       ## CONFIG_EFI_PARTITION=y
         -> Enable the block layer
           -> Partition Types
             [*] Advanced partition selection
             ...
             [*] EFI GUID Partition support

     ## CONFIG_EFI=y
     ## CONFIG_EFI_STUB=y
         -> Processor type and features
           [*] EFI runtime service support
           [*]   EFI stub support
           [*]      EFI mixed-mode support

     ## CONFIG_FB_EFI=y
         -> Device Drivers
           -> Graphics support
             -> Frame buffer Devices
               [*] Support for frame buffer devices
               [*]    EFI-based Framebuffer Support

     ## CONFIG_FRAMEBUFFER_CONSOLE=y
         -> Device Drivers
           -> Graphics support
             -> Console display driver support
             [*]   Framebuffer consoel support 
             [*]      Map the console to primary display device

     ## CONFIG_EFI_VARS is not set
     ## CONFIG_EFI_RUNTIME_MAP=y
         -> Firmware Drivers
           -> EFI (Extensible Firmware Interface) Support
             < > EFI Variable Support via sysfs
             [*] Export efi runtime maps to sysfs

     ## CONFIG_EFIVAR_FS=y
          -> File systems
            -> Pseudo filesystems
              [*] EFI Variable filesystem

If you made any changes rebuild and install the kernel using Steps 5 - 8 of chapter 10.

Step 11 - Installing the Bootloader


Now we use the Grub install to put the bootloader into the EFI partition which is our boot partition that also contains the kernel image itself.

grub-install --target=x86_64-efi --efi-directory=/boot/efi  \
       --bootloader-id=TTLP --recheck --debug

This will call efibootmgr to add a boot entry into the system's boot manager. When complete check the /boot partition for the grub code

ls /boot/efi/EFI/TTLP

also run efibootmgr as root and verify there is a TTLP entry.

Step 12 - Create the GRUB configuration


Now create the configuration for GRUB

cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg for The Toucan Linux Project
set default=0
set timeout=3

if loadfont /grub/fonts/unicode.pf2; then
   set gfxmode=800x600
   insmod all_video
   terminal_output gfxterm
fi

set menu_color_normal=white/blue
set menu_color_highlight=blue/yellow

insmod part_gpt
insmod fat

menuentry "Toucan Linux, Linux 5.2.29" {
   set root=(hd0,1)
   insmod xfs
   linux /vmlinuz-5.2.9-ttlp  root=/dev/sda2 ro rootfstype=xfs
}
EOF

You will need to change the (hd0,1) in the set root entry to the proper disk and partition for your system. See the discussion under MBR last chapter.

Step 13 - Learn How to Boot From the Grub Command Line


In case you make an error in the grub.cfg or have a bad kernel or install the wrong firmware it is good to know how to use the GRUB command line to edit an entry or even how to boot manually to make sure you can boot the system to fix the problems. For that we will have a quick tutorial on the GRUB command line.

When Grub first boots into the menu there will be an option at the bottom to press 'E' to edit the entry and another to press 'C' for the command line. If you select a boot option using the arrow keys and press 'E' it will open up an editor that will let you change the stanza from the grub.cfg file for that boot option. Often this is all you need to make the changes to get the system booted so you can modify the configuration. But you might need to manually boot if the grub.cfg is missing.
Start by pressing 'c' to get into the command mode. Now type

ls

and Grub will show the drives and partitions it sees such as

(hd0) (hd1) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3) (hd1,msdos1) (hd1,msdos2)

This show Grub has found two drives, The first is is called (hd0) which has three GPT partitions. The second drive it calls (hd1) and it has two MSDOS partitions. They might both have boot partitions, maybe one, maybe you know which is the boot, or maybe you don't. The devices that Grub can support include the following

(fd0)
(hd0)
(cd)
(ahci0)
(ata0)
(crypto0)
(usb0)
(cryptouuid/123456789abcdef0123456789abcdef0)
(mduuid/123456789abcdef0123456789abcdef0)
(lvm/system-root)
(lvmid/F1ikgD-2RES-306G-il9M-7iwa-4NKW-EbV1NV/eLGuCQ-L4Ka-XUgR-sjtJ-ffch-bajr-fCNfz5)
(md/myraid)
(md/0)
(ieee1275/disk2)
(ieee1275//pci@1f\,0/ide@d/disk@2)
(nand)
(memdisk)
(host)
(myloop)
(hostdisk//dev/sda)

The partition types are mostly for your information, they aren't need in Grub commands. If you needed to find the boot filesystem you could start by using the 'ls' command

ls (hd0,1)/
ls (hd0,2)/
ls (hd0,3)/

You could use (hd0,gpt1) if you wanted but it isn't necessary. If Grub responds with "Error: unknown filesystem." it means you need to load the module for that file system. It is generally the commonly used abbreviation of the filesystem. For XFS use

insmod xfs

For MSDOS type file systems (except exFAT) use

insmod fat

Then try again

ls (hd0,1)/

which will show the files and directories in that partition. You can use it just like ls such as

ls (hd0,1)/etc

To show the contents of a file use the 'cat' command

cat (hd0,1)/etc/fstab

If you are in rescue mode where the prompt says

grub rescue>:

Then grub wasn't able to find its own files. For this you will need to set the prefix but you can't use the modules so it might not be possible to list the contents of filesystem. You have to know where it is. For this example we'll assume (hd0,3) is the boot drive with the Linux kernel, the EFI partition (if using EFI). In that case it is

set prefix=(hd0,gpt1)/boot/grub
insmod normal

Now you are in normal mode and can proceed with using Grub modules and commands. Once you've found the boot filesystem set the Grub root with

set root=(hd3,0)

Use the ls command to find the kernel

grub>: ls (hd3,0)/ 
System.map-5.2.9 config-5.2.9 efi grub 
vmlinuz-5.2.9

Now load the linux kernel image

grub>: linux /vmlinuz-5.2.9 rootfstype=xfs root=/dev/sda2 ro 
grub>: boot

If you are using an initial ramdisk you need to specify it after the kernel

grub>: ls (hd3,0)/ 
System.map-5.2.9 config-5.2.9 efi grub initrd-5.2.9
vmlinuz-5.2.9

Now load the linux kernel image

grub>: linux /vmlinuz-5.2.9 rootfstype=xfs root=/dev/sda2 ro
grub>: initrd /initrd-5.2.9
grub>: boot

Now reboot and, for the first time, boot into the new system using your system's UEFI Boot Manger. If all went well, you'll be greeted with a login in screen which will allow you login, explore, and finally use shutdown -r now to reboot into the host if you need to do so.

Next time, we'll work on some configuration issues, and move to the second goal, angband.

GRUB Modules


Here's a list of the common Grub 2 modules for your reference

915resolution - This module is used to change the video resolution for Intel 915 video hardware.

acpi - Advanced Configuration and Power Interface (ACPI) is used to perform various power-related functions.

adler32 - This is a cryptography module that contains the tools needed to use the Adler-32 checksum.

affs - Support for the AFFS filesystem is provided by this module.

afs - Support for the AFS filesystem is provided by this module.

ahci - AHCI stands for "Advanced Host Controller Interface" and this is a special hard-drive format (like IDE or SATA). This module offers the needed code for GRUB to recognize such devices.

all_video - Additional video and graphics support can be gained when the "all_video" module is loaded.

ata - This module provides support for ATA computer buses.

at_keyboard - This module is used to support the 84-key keyboards.
backtrace - This module gets the list of functions that are running in an active thread.

bfs - This module provides support for the Be FileSystem which is used by BeOS.

biosdisk - This module provides GRUB with the ability to boot off of LiveDisks.

blocklist - This module displays the list of blocks used by the specified file.

bsd - This module provides support for loading BSD kernels.

btrfs - This module provides support for the B-tree Filesystem.

bufio - This module supports buffer reads and writes.

cat - The "cat" command is provided by this module.

cbfs - This module provides GRUB with support for the Callback Filesystem (CBFS).

cbls - This module lists the coreboot tables.

cbmemc - This module displays the contents of the CBMEM console.

cbtable - This module provides support for Coreboot tables.

chain - This module offers chainloading capabilities.

cmosdump - This command displays the raw CMOS data.

cmp - The "cmp" command is provided by this module.

configfile - This module provides the ability to read and manipulate configuration files.

cpio_be - This module provides support for big-endian CPIO.

cpio - This module provides support for CPIO.

cpuid - This modules tests for various CPU features.

crc64 - This module offers an error-detection tool known as Cyclic Redundancy Check (CRC).

cryptodisk - This module is needed to mount a crypto disk.

date - This module provides the "date" command.

datetime - This module provides the "datetime" command.

diskfilter - This module is needed to read RAID arrays.

disk - This module is needed to read hard-drives.

drivemap - This module contains functions related to BIOS drive mappings.

echo - This module provides the "echo" command.

efiemu - This module provides EFI emulation features.

ehci - This module provides support for the Enhanced Host Controller Interface (EHCI) which is used by USBv2.

elf - This module loads ELF files.

eval - This module provides the "eval" command which is used to evaluate expressions.

exfat - GRUB can gain support for FAT64 (also called exFAT) with this module.

ext2 - This module provides support for EXT2 filesystems.

fat - GRUB can gain support for the FAT filesystem with this module.

file - This module provides the basic file I/O functions.

font - This module provides many font-related functions.

freedos - This module contains the code needed to boot FreeDOS.

fshelp - This module contains functions related to filesystem-helpers.

gdb - This module contains features related to the GNU Debugger (GDB).

geli - This module provides a block device-layer disk encryption system for FreeBSD.

gettext - This module provides language translation abilities.

gfxmenu - This module provides the gfxmenu.

gptsync - A GPT partition table can be synced with an MBR partition table using this module.

gzio - This module offers Gzip I/O abilities.
halt - This module provides the "halt" command.

hashsum - This module provides the features needed to compute and check hash checksums.

hdparm - GRUB can use this module to set and get ATA parameters.

hello - This module is an "Hello World" example for making GRUB modules.

help - This module provides the help utility.

hexdump - This module offers hex dump capabilities.

hfs - GRUB uses this module to gain support for the HFS filesystem.

hfspluscomp - HFS+ compression is supported with this module.

hfsplus - GRUB uses this module to gain support for the HFS+ filesystem.

http - GRUB can boot systems that reside on a Network Filesystem (NFS). This means that GRUB may need some networking capabilities sometimes. The "http" module provides the Hyper Text Transfer Protocol.

hwmatch - Blacklists and whitelists for hardware are used with this module.
iorw - This module is used to read and write the input and output of devices.

iso9660 - This module offers iso9660 support which is needed to read optical discs that use this filesystem.

jfs - GRUB uses this module to gain support for the JFS filesystem.

jpeg - GRUB can have background images (like a wallpaper). The "jpeg" module provides support for JPEG images, which GRUB can use as a background image.
keylayouts - The keyboard layout can be changed using this module.

keystatus - By using the keystatus module, GRUB can detect whether or not key modifiers are active (such as caps-lock, shift, ctrl, etc.).

ldm - The LDM module offers support for the LDM partitioning layout (Microsoft's Logical Disk Manager).

legacycfg - Backwards compatibility for various GRUB Legacy features are provided with this module.

legacy_password_test - This module is used to test the legacy password system.
linux16 - The "linux16" command is in this module. The command is used to load a 16-bit Linux system.

linux - This module is just like the "linux16" module except that this is the standard "linux" command.

loadenv - This module provides the "loadenv" command which is used to load variables from the environment block file.

looback - The "loopback" command comes from the "loopback" module. "loopback" provides the tools needed to create loopback devices.

lsacpi - This module is used to list the detected ACPI devices.

lsapm - This module lists Advanced Power Management (APM) devices. APM is the predessor to ACPI.

lsmmap - This module displays the memory map (LiSt Memory Map).
ls - This module provides GRUB with the "ls" command which is used to list devices or files.

lspci - This module provides the "lspci" command which is used to list PCI devices.

luks - Linux Unified Key Setup (LUKS) is a special disk-encryption format used by Linux systems. With this driver, GRUB can access LUKS partitions with this module.
lvm - This module offers GRUB support for Linux's Logical Volume Manager (LVM).

lzopio - This module provides support for reading and writing (I/O) files that are compressed with lzop. "lzop" is similar to Gzip and uses the LZO compression library.

macbless - With this module, GRUB can "bless" a file or directory that resides on an HFS or HFS+ filesystem. To "bless" a file means to make it bootable and set various options related to startup.

macho - Mach-O files cannot be loaded without using this module. A Mach-O file is a Mach Object file format that has replaced the "a.out" file format.

mda_text - This driver provides text support for MDA (Monochrome Display Adapter) as opposed to VGA.

mdraid09_be - RAID support with big-endian is given to GRUB via this module.

mdraid09 - RAID support is given to GRUB via this module.

mdraid1x - RAID1 support is offered with this module.

memdisk - This module provides GRUB a way to boot old operating systems (like from floppy drives). http://www.syslinux.org/wiki/index.php/MEMDISK

memrw - GRUB uses this module to read and write to physical memory.

minicmd - The commands that are available in rescue mode come from this module.

minix2_be - Support for MinixFS v2 with big-endian is provided by this module.

minix2 - Support for MinixFS v2 without big-endian is provided by this module.

minix3_be - Support for MinixFS v3 with big-endian is provided by this module.

minix3 - Support for MinixFS v3 without big-endian is provided by this module.

minix_be - Support for MinixFS v1 with big-endian is provided by this module.

minix - General support for Minix filesystems is offered by this module.

mmap - This module provides the needed code for memory mapping.

morse - GRUB can provide information via Morse Code when this module is loaded.

mpi - GRUB can support the Message Passing Interface (MPI) which is commonly seen on clusters.

msdospart - Support for MS-DOS partitions (commonly called "MBR partitions") is provided by this module.

multiboot2 - This module provides various functions needed to support multi-booting systems (just like the "multiboot" system). However, this module provides additional and newer features.

multiboot - This module provides various functions needed to support multi-booting systems.

named-colors - This module is a library that contains various color names with the RGB values for that color.

nativedisk - This module makes GRUB use native disk drivers such as pata, ahci, usbms, ohci, uhci, and ehci.

net - Many network drivers and functions are contained in this module. GRUB is able to boot from remote hard-drives via the network.

newc - NewC is a special CPIO format. This module provides a way for GRUB to access such CPIO files.

nilfs2 - This module provides support for NILFS2 (New Implementation of Log filesystem v2).

normal - This module provides "Normal Mode" which is the opposite of "Rescue Mode".

ntfscomp - GRUB is able to support the compression commonly used in NTFS with this module.

ntfs - GRUB uses this module to gain support for the NTFS filesystem.

ntldr - This module is based on the "chainloader" module and is used to boot a Windows partition. This module does not read the Volume Boot Record. This is helpful in cases when the Volume Boot Record is corrupted.

odc - This module provides support for a special CPIO format known as "Octet-oriented cpio format".

ohci - Open Host Controller Interface (OHCI) is a hardware standard commonly used by FireWire devices.

part_acorn - This module provides support for Acorn partitions and partitioning tables.

part_amiga - This module provides support for Amiga partitions and partitioning tables.

part_apple - This module provides support for Apple partitions and partitioning tables.

part_bsd - This module provides support for BSD partitions and partitioning tables.

part_dfly - This module provides support for DFLY partitions and partitioning tables.

part_dvh - This module provides support for DVH partitions and partitioning tables.

part_gpt - This module provides support for GPT (GUID Partition Table) partitions and partitioning tables.

part_msdos - This module provides support for MS-DOS (MBR) partitions and partitioning tables.

part_plan - This module provides support for Plan9 partitions and partitioning tables.

part_sun - This module provides support for Sun partitions and partitioning tables.

part_sunpc - This module provides support for SunPC partitions and partitioning tables.

parttool - This module provides the "parttool" command.

password - This module provides the "password" command.

pata - Support for the Parallel ATA (PATA) disk interface is provided by this module.

pbkdf2 - This module provides the PBKDF2 (Password-Based Key Derivation Function 2) cryptography tool.

pcidump - This module provides information on the detected PCI devices.
pci - This module provides support for Peripheral Component Interconnect (PCI) computer buses.

plan9 - This module is needed by GRUB to load Plan9 kernels.

play - This module provides the "play" command which is used to play sound via the BIOS speaker.

png - PNG files can be used as the background image when this module is loaded.

probe - This module is used to probe for device information.

procfs - This module provides support for ProcFS.

progress - This module provides a progress bar.

pxechain - This module supports PXE chainloading.

pxe - GRUB uses this module to gain support for Preboot eXecution Environment (PXE). This is used to boot an operating system independently of local storage units using a network.

raid5rec - This module provides RAID5 support.

raid6rec - This module provides RAID6 support.

read - This module provides the "read" command.

reboot - This module provides the "reboot" command.

regexp - Regular Expressions (REGEX wildcards) are supported via this module.
reiserfs - This module provides support for the Reiser Filesystem.

romfs - This module provides RomFS support.

scsi - This module provides support for the SCSI (Small Computer System Interface) hardware protocols and standards.

sendkey - This module provides the "sendkey" command which is used to send emulated key-presses to GRUB.

serial - This module provides support for serial devices.

setjmp - This module is a library that provides support for non-local jumps. This is needed to manage errors and interrupts.

setpci - This module is used to configure PCI devices.

sfs - Support for the Smart Filesystem (SFS) is offered by this module. SFS is a journaling filesystem used by Amiga systems.

sleep - The "sleep" command is provided by this module. The "sleep" command is just like the one in BASH; execution will wait/pause for the specified time.
sleep_test - This module is used to test for proper "sleep" support.

squash4 - GRUB can access Squash Filesystem with this module. SquashFS is a read-only filesystem that is compressed.

syslinuxcfg - GRUB can support SysLinux configuration files with this module.

tar - Support for Tar files is offered with this module.

terminal - This module provides support for terminals.

terminfo - GRUB can read terminfo entries via this module.

testload - GRUB can load a file multiple ways to test for errors.

test - This module provides the "test" command which is used to evaluate an expression.

testspeed - GRUB's file reading speed can be measured with this module.

tftp - Trivial File Transfer Protocol (TFTP) provides GRUB a way to get files needed for booting from another system. This also provides a way to support diskless booting.

tga - This module offers support for the Tandy Graphics Adapter (TGA) which is a technology similar to VGA.

time - This module provides the "time" command which prints the current time.
trig - This module provides trigonometric functions to GRUB.

tr - The "tr" command is provided by this module. This is the same "tr" command as seen in BASH and other shells.

truecrypt - Truecrypted MBR partitions require that this module be loaded so that GRUB can boot such partitions. TrueCrypt is an on-the-fly-encryption (OTFE) utility for files or partitions.

true - This module provides the boolean commands "true" and "false".

udf - The "udf" module provides support for the Universal Disk Format (UDF).

ufs1_be - Support for the Unix Filesystem v1 with big-endian is provided with this module.

ufs1 - Support for the Unix Filesystem v1 is provided with this module.

ufs2 - Support for the Unix Filesystem v2 is provided with this module.

uhci - This module provides support for the Universal Host Controller Interface (UHCI).

usb_keyboard - USB keyboards are supported with this module.

usb - USB devices in general are supported with the "usb" module.

usbms - USB mice are supported by this module that offers features needed for USB data streams.

usbtest - USB support is tested with this module.

vbe - VESA BIOS Extensions (VBE) is a specific VESA standard that this module supports.

verify - File signatures can be verified using the "verify" module.

vga - This module provides VGA support.
vga_text - This module provides the text-only (VGA) mode.

video_bochs - This module provides the Bochs video driver.

video_cirrus - This module provides the Cirrus video driver.

video_colors - Many functions related to color come from this module.

video_fb - This module is for the video framebuffer.

videoinfo - Various information concerning the graphics can be displayed using the tools that are part of the "videoinfo" module.

video - This provides code needed for various video modes.

videotest - The video settings can be tested using this module.

xfs - GRUB uses this module to gain support for the XFS filesystem.

xnu - This module provides support for XNU kernels (like OS X).

xnu_uuid - This module converts the 64-bit UUIDs to the 128-bit UUIDs used by Xnu kernels.

xnu_uuid_test - This module is used to ensure that two 128-bit UUIDs match.

xzio - This module provides read and write support for xz-compressed files.

zfscrypt - Encryption tools for the ZFS filesystem are in this module.

zfsinfo - This module displays various information about a ZFS filesystem/partition.

zfs - GRUB uses this module to gain support for the ZFS filesystem.

Copyright (C) 2019 by Michael R Stute

No comments:

Post a Comment