Linux kernels need to be built with CONFIG_EFI_STUB enabled so they can be directly executed as UEFI images. Configuration file fragments, kernel images and initrd images are required to reside on the EFI system partition, as Gummiboot does not provide support for accessing files on other partitions or file systems. systemd-boot) is a simple UEFI boot manager that loads and runs configured UEFI images, accessing only the EFI system partition. It was merged into version 3.3 of the Linux kernel mainline, released on March 18, 2012. Linux kernel's support for the EFI Boot Stub is enabled by turning on option CONFIG_EFI_STUB (EFI stub support) during the kernel configuration. Such kernel images can still be loaded and run by BIOS-based boot loaders thus, EFI Boot Stub allows a single kernel image to work in any boot environment. By masquerading itself as a PE/ COFF image and appearing to the firmware as a UEFI application, an x86 kernel image with EFI Boot Stub enabled can be directly loaded and executed by a UEFI firmware. Once loaded by a UEFI firmware, they both can access and boot kernel images from all devices, partitions and file systems they support, without being limited to the EFI system partition.ĮFI Boot Stub makes it possible to boot a Linux kernel image without the use of a conventional UEFI boot loader. GRUB 2 and elilo serve as conventional, full-fledged standalone UEFI boot loaders for Linux. See also: UEFI and Linux disk device compatibility On the other hand, FAT32 is always expected on fixed drives. For that purpose, a removable device is formatted with a FAT12, FAT16 or FAT32 file system, while a boot loader needs to be stored according to the standard ESP file hierarchy, or by providing a complete path of a boot loader to the system's boot manager. UEFI firmware supports booting from removable storage devices such as USB flash drives. However, some UEFI implementations immediately switch to the BIOS-based CSM booting upon detecting certain types of partition table on the boot disk, effectively preventing UEFI booting to be performed from EFI system partitions contained on MBR-partitioned disks. The UEFI specification requires MBR partition tables to be fully supported.
CREATE EFI SYSTEM PARTITION CODE
UEFI firmware does not execute the code in the MBR, except when booting in legacy BIOS mode through the Compatibility Support Module (CSM).
On legacy BIOS-based systems, the first sector of a partition is loaded into memory and execution is transferred to this code.
UEFI provides backward compatibility with legacy systems by reserving the first block (sector) of the partition for compatibility code, effectively creating a legacy boot sector. Also, El Torito bootable format for CD-ROMs and DVDs is supported. Both GPT- and MBR-partitioned disks can contain an EFI system partition, as UEFI firmware is required to support both partitioning schemes. The globally unique identifier (GUID) for the EFI system partition in the GUID Partition Table (GPT) scheme is C12A7328-F81F-11D2-BA4B-00A0C93EC93B, while its ID in the master boot record (MBR) partition-table scheme is 0圎F. The actual extent of divergence is unknown: Apple maintains a separate tool that should be used, while other systems use FAT utilities just fine. The EFI system partition is formatted with a file system whose specification is based on the FAT file system and maintained as part of the UEFI specification therefore, the file system specification is independent from the original FAT specification. See also: UEFI § UEFI booting, and UEFI § CSM booting