Module fs

Source
Expand description

Filesystem helper functions for other modules.

These mostly wrap around the UEFI SimpleFileSystem protocol to make an interface that’s slightly more intuitive and more in line with the Rust standard library.

These filesystem helpers are guaranteed to support FAT filesystems. This is mandated by the UEFI specification. However, UEFI firmwares are not forced to support solely FAT32. It is perfectly possible and even simple to support non FAT filesystems, using EFI filesystem drivers.

Examples of such drivers implementing SimpleFileSystem include those found in efifs, which are built off of GRUB’s drivers, as well as Ext4Pkg. This means that filesystems ranging from Ext4 to Btrfs and ZFS can be supported due to the pluggable nature of UEFI drivers. Note however that drivers must be signed before loading if you are using Secure Boot (or enrolled with MOK if you’re using a custom Shim build).

These drivers can be installed in \EFI\BOOT\drivers of the same EFI partition as bootmgr-rs, and bootmgr-rs will automatically load those drivers for usage in scanning for Configs. Alternatively, if the firmware supports those filesystems in the first place, then bootmgr-rs will already be able to scan those drivers. You also have to explicitly enable those drivers in BootConfig.

This module also provides filesystem-related testing functions, like UefiFileSystem::exists.

Structs§

UefiFileSystem
A rust-ier wrapper around SimpleFileSystem.

Enums§

FsError
An error that may result from performing filesystem operations