Skip to main content
  1. Index/

GRUB (GNU GRand Unified Bootloader)

GRUB (GNU GRand Unified Bootloader) is the bootloader used by the majority of Linux distributions on x86 and x86-64 systems. Its role is to bridge the gap between what firmware hands control to and what the Linux kernel needs: firmware (BIOS or UEFI) loads GRUB, and GRUB locates the kernel image and initrd on disk, assembles a kernel command line, and transfers control to the kernel. Because GRUB understands a wide range of filesystem formats — ext4, XFS, Btrfs, FAT, and more — it can read its own configuration and the kernel directly from the root or boot partition without any intermediate step, which is what distinguishes it from simpler bootloaders that can only read from FAT.

On UEFI systems, GRUB is installed as a PE-signed EFI binary on the EFI System Partition and is loaded directly by firmware (or, on distributions that use Secure Boot with Microsoft’s signing infrastructure, via shim). Its runtime configuration lives in grub.cfg, which GRUB reads from disk and executes as a small scripting language; the config specifies which kernel and initrd to load, any kernel command line arguments, and optional menus for selecting between entries. This dynamic, script-driven model is powerful and flexible — GRUB can discover kernels automatically via grub-mkconfig and os-prober, handle encrypted boot partitions, and support chainloading other bootloaders — but it also means the boot configuration is assembled at runtime from files on disk, making it harder to sign and attest as a unit compared to a static UKI.

When GRUB’s tpm module is loaded, it participates in measured boot: every command it executes and every file it reads — the config file, kernel image, initrd — is hashed and extended into TPM PCR registers, contributing to the platform’s boot measurement log. GRUB measures kernel command line arguments into PCR 8 and all files it loads (including the kernel and initrd) into PCR 9. This gives TPM-based attestation and LUKS PCR-sealing visibility into what GRUB actually loaded, not just that GRUB ran. However, because GRUB’s configuration is mutable and assembled at runtime, pre-calculating the expected PCR values after a config or kernel update is significantly more complex than with UKIs, where the entire payload is a single signed blob with a stable, predictable measurement. This operational friction is one of the primary reasons the Linux ecosystem is gradually shifting toward systemd-boot and UKI-based boot on systems where measured boot and attestation are requirements.

Related

Measured Boot

Measured Boot is a boot process architecture in which each component in the boot chain — firmware, bootloader, kernel, initrd, kernel command line — is cryptographically hashed and that hash is recorded into a TPM Platform Configuration Register (PCR) before the component executes. The critical distinction from Secure Boot is in what each mechanism provides: Secure Boot is an enforcement mechanism that prevents unauthorised components from running at all; Measured Boot is a recording mechanism that creates a tamper-evident log of exactly what did run, without necessarily preventing anything. The two are complementary and typically deployed together — Secure Boot enforces a policy at boot time, Measured Boot produces the evidence that the policy was enforced as claimed. A system can have Measured Boot without Secure Boot (it records everything that ran, even unsigned components), but Secure Boot without Measured Boot provides enforcement with no attestable evidence of what was enforced.

Secure Boot (UEFI Secure Boot)

UEFI Secure Boot is a firmware-level mechanism that ensures each binary executed during the boot process — bootloader, kernel, UEFI drivers — is cryptographically signed by a key the firmware trusts, before it is allowed to run. It is defined in the UEFI specification and implemented by the firmware on virtually all modern x86 and ARM platforms. Its threat model is bootkits and rootkits that install themselves before the OS loads and therefore survive reboots, OS reinstalls, and cannot be detected by any software running after them.

LUKS (Linux Unified Key Setup)

LUKS (Linux Unified Key Setup) is the standard specification for block device encryption on Linux, created by Clemens Fruhwirth in 2004. It sits above the kernel’s dm-crypt subsystem — which performs the actual AES sector-by-sector encryption via the device mapper — and adds a structured, on-disk header that decouples key management from the encryption itself. Any block device can be a LUKS container: a partition, a logical volume, a loop device; anything that sits beneath it (filesystem, swap, LVM) is encrypted transparently, with no changes required to the software using it. The managed cryptsetup tool and the libcryptsetup library provide userspace access to LUKS volumes, and are the canonical interface for all operations on them.