LinuxCommandLibrary

grub-glue-efi

Prepare GRUB as an EFI application

SYNOPSIS

grub-glue-efi -o output_efi_file input_efi_file1 [input_efi_file2 ...]

PARAMETERS

-o, --output=FILE
    Specifies the path and filename for the resulting combined EFI executable. This option is typically mandatory as the command's primary function is to create a new file.

input_efi_file
    One or more paths to the EFI executable files that need to be combined (e.g., /usr/lib/grub/x86_64-efi/grubx64.efi, /usr/lib/grub/i386-efi/grubia32.efi). At least one input file is required.

DESCRIPTION

The grub-glue-efi command is a specialized utility within the GRUB2 ecosystem designed to combine multiple EFI (Extensible Firmware Interface) executable files into a single, universal EFI image. This is particularly useful for creating a single bootloader file that can be used on systems with different EFI architectures (e.g., 64-bit UEFI firmware and 32-bit UEFI firmware, or when the system might switch between modes).

Typically, it merges a 64-bit GRUB EFI binary (like grubx64.efi) and a 32-bit GRUB EFI binary (like grubia32.efi) into a single output file (often named BOOTX64.EFI or BOOTIA32.EFI, depending on the target boot path). When the EFI firmware loads this combined file, the internal logic within the glued binary determines the correct architecture and executes the appropriate embedded EFI program. This simplifies bootloader deployment and ensures compatibility across a wider range of UEFI systems.

CAVEATS

This command is highly specialized and generally not invoked directly by end-users. It's usually part of GRUB installation scripts or used by system administrators creating custom bootable media or unified EFI bootloaders. Improper use can lead to unbootable systems. It relies on the presence of the specific GRUB EFI binaries for different architectures. The actual behavior might vary slightly depending on the GRUB version and distribution.

UNIFIED EFI BOOTLOADERS

The primary purpose of grub-glue-efi is to create a unified EFI bootloader. Modern EFI firmware often expects a specific file name (e.g., BOOTX64.EFI for x86_64 systems) in the EFI System Partition (ESP). By gluing 32-bit and 64-bit GRUB EFI binaries, a single BOOTX64.EFI file can be created that is capable of booting correctly on both 64-bit and certain 32-bit UEFI systems (if the 32-bit GRUB component is present and the firmware can execute it).

TYPICAL USAGE

A common use case involves combining grubx64.efi and grubia32.efi located in the system's GRUB installation directories into a single BOOTX64.EFI file placed in the standard EFI boot path (e.g., /boot/efi/EFI/BOOT/). This allows a single boot entry to serve both 32-bit and 64-bit capable systems, particularly useful for USB drives or mixed environments.

HISTORY

The grub-glue-efi utility emerged as part of the GRUB2 project, specifically with the increasing prevalence and complexity of UEFI (Unified Extensible Firmware Interface) booting. As systems began to feature different EFI architectures (32-bit and 64-bit) and the need arose for a single boot entry point that could handle both, tools like grub-glue-efi became essential. It provides a mechanism to create a 'fat' EFI binary, simplifying the distribution and deployment of GRUB across diverse UEFI hardware.

SEE ALSO

Copied to clipboard