Open Source › LamBoot filesystem crates › lamfat
lamfat
Read and write FAT12, FAT16 and FAT32, the ESP's filesystem: rust-fatfs, republished.
What lamfat is for
lamfat is the battle-tested fatfs engine under a distinct crate name, so it can be a published dependency of the LamBoot family and packaged for Debian and Fedora. The upstream crate hasn't tagged its 0.4.0 on crates.io; when it does, LamBoot moves to it.
It's the one crate in the family that writes as well as reads: LamBoot uses it on the EFI System Partition, which is always FAT.
Basis: A faithful republish of rafalh/rust-fatfs; PROVENANCE.md names the upstream commit and every change. The on-disk format logic is upstream's, unchanged.
Add it to your crate
[dependencies]
lamfat = { version = "0.4", default-features = false, features = ["alloc", "lfn"] }
Or cargo add lamfat. On Debian unstable or testing, the packaged crate is librust-lamfat-dev (rust-lamfat).
Usage
use lamfat::{FileSystem, FsOptions};
let fs = FileSystem::new(disk, FsOptions::new())?;
for entry in fs.root_dir().iter() {
let name = entry?.file_name();
}
The full API, with every type and error, is on docs.rs.
What it reads
| Feature | Status |
|---|---|
| Mounting a volume and its root directory | Yes |
| Reading and writing files; creating and removing files and directories | Yes |
| FAT12, FAT16 and FAT32 | Yes |
| Short (8.3) and long (VFAT) file names | Yes, long names behind lfn |
What it depends on, and what it doesn't
Avoids: A userspace filesystem stack. Its default tree is bitflags and log; chrono is opt-in.
Only with a feature
- chrono 0.4, with
timestamps (off by default)
Cargo features
| Feature | Default | What it adds |
|---|---|---|
| std | Yes | std::io integration |
| alloc | Yes | Long-file-name and format paths that allocate |
| lfn | Yes | Long file names |
| unicode | Yes | Full Unicode case handling |
| log_level_* | Yes | Compile-time log ceilings (trace by default) |
How it's tested
Upstream's test suite, plus the ls, cat, write, mkfatfs and partition examples.
No GPL drivers in the boot path
Until 2026 LamBoot read most Linux filesystems through about a dozen prebuilt UEFI filesystem driver binaries from the EfiFs (GPL-3.0) and rEFInd (GPL-2.0) projects. Three things ruled them out at once. Debian's free-software guidelines and Fedora's packaging rules reject a prebuilt .efi blob that isn't built from source in the archive. Microsoft doesn't sign GPLv3 code for Secure Boot, and loading a separate UEFI driver binary removes the ShimLock protocol that shim 15.8 relies on. And GPL binaries sit badly beside a permissively licensed loader. These crates replace those drivers with readers compiled into LamBoot itself. The whole family · LamBoot
The other disk filesystem readers
Read-only media formats (lamfold): lamfold · lamfold-iso · lamfold-udf · lamfold-squash · lamfold-erofs · lamfold-cramfs · lamfold-romfs · lamfold-cpio