Skip to content
lamco-adminPublic

About

LamBoot: a memory-safe UEFI bootloader for Linux, written in Rust. Public release repository (source at lamco-admin/lamboot-dev).

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LamBoot

Modern, memory-safe UEFI boot for Linux — in Rust.

License: MIT OR Apache-2.0 Rust UEFI

Website · Documentation · Install · Repository · by Lamco Development LLC

LamBoot is a UEFI bootloader for Linux targeting hypervisor-managed VM environments (Proxmox in particular) and homelab / desktop systems. Eight clean architectural layers across 68 modules, ~23,400 lines of Rust. Graphical menu with mouse. BLS + UKI + kernel-install done right. Host-side fleet monitoring without an in-guest agent. A verifiable Secure Boot posture with a JSON trust-evidence log written to the ESP on every boot.

Native filesystem reading, a verifiable Secure Boot posture, and a machine-checked architecture. LamBoot reads ext4, btrfs, FAT, XFS, exFAT, and ZFS boot pools natively and read-only (FAT and XFS on LVM included), plus a read-only media stack (EROFS, ISO 9660, SquashFS, cramfs, romfs, UDF), so the kernel-load path no longer leans on firmware filesystem drivers or BS->LoadImage, and a separate /boot is sourced in place rather than mirrored onto the ESP. Every new backend is read-only by construction — there is no write path, and the ESP writer only ever targets FAT. Its 67-module core is organized into an 8-layer dependency DAG enforced on every commit — dependencies flow one direction, by construction. Every image-authentication decision is written to a JSON trust-evidence log on the ESP, and the shim 15.8 ShimLock-uninstall failure mode that blocked stock /boot on ext4 under Secure Boot is structurally unreachable. Pop!_OS / systemd-boot-discoverable-EFI auto-discovery is first-class. See lamco.ai/products/lamboot/ for the roadmap and documentation.

  • Current version: 0.17.0 (October 2026)
  • Binary size: ~1.2 MB (x86_64; native ext4/btrfs/FAT/XFS/exFAT/ZFS + media readers + goblin-free PE loader compiled in)
  • Platforms: x86_64 UEFI, aarch64 UEFI
  • License: MIT OR Apache-2.0
  • Architecture: 8 layers, codified — see docs/ARCHITECTURE-LAYERS.md

Why LamBoot

🧱 Clean architecture Eight layers, each with a single job. Every module declares its layer and dependencies flow one direction — checked on every commit by a CI gate against a machine-readable layer map. Contribute in an afternoon.
🏭 Proxmox-native Host-side VM boot-health monitoring via NVRAM — no agent in the guest. First Linux bootloader with fleet ops as a first-class concern.
⚖️ Modern Linux boot BLS Type 1 with UAPI.10 version sort. UKI first-class. LoadFile2 initrd (kernel 5.7+). kernel-install + postinst hooks. No GRUB scripting.
🖱️ Graphical menu with a mouse Double-buffered GOP renderer, full pointer support, no flicker. Serial console fallback.
🦀 Memory-safe Rust #![no_std], every unsafe block documented. 68 modules, about 24,500 lines of Rust: a fraction of GRUB's C. It reads /boot where it lives, on ext4, btrfs, XFS, ZFS and LVM, with read-only code compiled into the loader.
📝 Auditable Secure Boot JSON trust-evidence log on \loader\boot-trust.log — every image-authentication decision recorded. Threat model documents what LamBoot can and cannot verify.
🧪 Crash-loop recovery NVRAM state machine with automatic fallback entry selection, systemd-bless-boot compatible.

Posture (v0.17.0):

  • Ships now: native read-only ext4, btrfs, FAT, XFS, exFAT, and ZFS boot-pool read backends (FAT and XFS on LVM included; XFS also inside an .iso loopback region), a native read-only media stack (EROFS, ISO 9660, SquashFS, cramfs, romfs, UDF), a parser-free native PE loader (no goblin) with a native -> firmware BS->LoadImage fallback, native trust chain, read-in-place /boot (no ESP kernel mirror), GPT + MBR + BlockIO-only partition discovery (BIOS-installed msdos-table disks included), bootloader-side NVRAM self-install of the LamBoot boot entry, BLS multi-FS discovery, signing pipeline, SecurityOverride (Path F), trust-evidence log, install-script hardening, Proxmox integration, BLS+UKI handling. Every new backend is read-only by construction. The previous shim 15.8 ShimLock-uninstall failure on stock /boot ext4 under Secure Boot is structurally unreachable on the kernel-load path.
  • Pop!_OS / systemd-boot-discoverable-EFI kernels and recovery entries are auto-discovered.
  • Not shim-review approved yet (parallel track).
  • Not a GRUB drop-in — no legacy BIOS, no rescue shell, no GRUB config language.
  • Standard ecosystem gaps inherited (initrd integrity, kernel cmdline post-verification). See docs/SECURITY-MODEL.md.

Documentation

The canonical product documentation lives at lamco.ai/products/lamboot/docs/ (install reference, Secure Boot deployment, architecture, Proxmox operations, troubleshooting). The in-repo documents below are the source for those pages.

Getting started

Secure Boot

Architecture

Integration

Troubleshooting & policy


Quick install

Homelab (Secure Boot off)

tar xzf lamboot-0.17.0-x86_64.tar.gz && cd lamboot-0.17.0
sudo ./lamboot-install
# Reboot → pick "LamBoot" from firmware boot menu

Linux desktop (Secure Boot on, shim + MOK)

sudo ./lamboot-install --signed
# Reboot → MokManager → Enroll MOK → enter passphrase → Yes → Reboot

Proxmox zero-touch (VM template)

# On host
cp lamboot-0.17.0/OVMF_VARS_lamboot.fd /var/lib/vz/images/100/OVMF_VARS_100.fd
# In VM
sudo ./lamboot-install --signed --no-mok

Full walkthroughs in docs/SECURE-BOOT-DEPLOYMENT.md.


Diagnostic and repair utilities

Companion toolkit: lamboot-tools — eleven CLI tools for diagnosing, repairing, backing up, and migrating Linux UEFI boot configurations. Works on any UEFI system regardless of bootloader; has LamBoot-specific subcommands where useful.

Ships as three RPM subpackages from one source tree:

  • lamboot-tools — core utilities (lamboot-diagnose, lamboot-doctor, lamboot-esp, lamboot-backup, lamboot-repair, lamboot-migrate, lamboot-uki-build, lamboot-signing-keys, lamboot-toolkit dispatcher, and a mirror of this repo's lamboot-inspect).
  • lamboot-migrate — standalone RPM for operators who want only the BIOS→UEFI migrator.
  • lamboot-toolkit-pve — Proxmox host add-on (lamboot-pve-setup, lamboot-pve-fleet, plus mirrors of lamboot-monitor.py and build-ovmf-vars.sh from this repo).

See the companion repository github.com/lamco-admin/lamboot-tools for the toolkit source, releases, and tool-by-tool documentation.


Build from source

# Prerequisites: stable Rust. rust-toolchain.toml selects it and both UEFI targets.
rustup target add x86_64-unknown-uefi aarch64-unknown-uefi
rustup toolchain install nightly --profile minimal --component rustfmt   # only for cargo fmt

# Build
./build.sh

# Output:
#   dist/EFI/LamBoot/lambootx64.efi     (~1.2 MB, x86_64)
#   dist/EFI/LamBoot/lambootaa64.efi    (~1.0 MB, aarch64)
#   dist/EFI/LamBoot/modules/*.efi      (nvme-diag, mem-quick, ...)

# Test in QEMU
./run-qemu.sh

Secure Boot signing (optional)

# Generate production keys — one time; see docs/KEY-GENERATION.md
# ... populates keys/{pk,kek,db}.{key,crt}

# Unlock signing key for this session
./tools/sign-unlock

# Sign bootloader + drivers + modules
./tools/sign-lamboot.sh
# Output: dist/EFI/LamBoot/lambootx64-signed.efi + 14 signed modules/drivers

Trust-evidence log

On every boot, LamBoot writes \loader\boot-trust.log to the ESP. One JSON object per line:

{"seq":0,"event":"boot_start","verified_via":"","status":"","note":"secure_boot=true"}
{"seq":1,"event":"policy_loaded","path":"/EFI/LamBoot/policy.toml","verified_via":"","status":"SUCCESS","note":""}
{"seq":2,"event":"boot_attempt","path":"\\EFI\\Linux\\ubuntu-6.11.efi","verified_via":"firmware_db","status":"Success","note":"uki"}

Read it post-boot from Linux:

cat /boot/efi/loader/boot-trust.log | jq .

No other bootloader keeps a record of each image-authentication decision. rEFInd can write an activity log; the others log to the screen. See docs/SECURITY-MODEL.md for the schema and lamboot-core/src/trust_log.rs for the source.


Architecture

UEFI Firmware → LamBoot
  1. Assess boot health (NVRAM state machine)
  2. Detect Secure Boot; initialise TPM
  3. Mount ESP; instantiate TrustLog
  4. Load policy.toml; measure into PCR 5
  5. Request ShimRetainProtocol (v0.8.3+)
  6. Install SecurityOverride (Path F)
  7. Load filesystem drivers, record trust events
  8. Reconnect controllers; enumerate volumes
  9. Discover BLS entries, ESP entries, UKI, modules
 10. Evaluate crash state; select fallback if CrashLoop
 11. Display menu (GUI or serial)
 12. Decrement boot counter; measure cmdline (PCR 12); measure kernel (PCR 4)
 13. Register initrd via LoadFile2
 14. Flush TrustLog to \loader\boot-trust.log
 15. Boot via uefi::boot::start_image under SecurityOverride
lamboot-core/src/
  main.rs                Orchestration
  security_override.rs   Path F — Security/Security2 arch protocol hooks
  trust_log.rs           v0.8.3 — JSON-lines audit log
  bls.rs                 BLS Type 1 + UAPI.10 sort + boot counting
  gui.rs                 Double-buffered GOP + mouse
  discovery.rs           BLS-first entry discovery, UKI detection
  policy.rs              policy.toml parser
  health.rs              NVRAM state machine, Boot Loader Interface
  fs.rs                  ESP/volume mounting, multi-partition scan
  initrd.rs              LoadFile2 provider
  boot.rs                Chainload, UKI, Linux under SecurityOverride
  input.rs               Keyboard + mouse
  tpm.rs                 TCG2 measured boot
  console.rs             Serial fallback menu
  drivers.rs             Filesystem driver loader + trust events
  secure.rs              SB state + shim integration

Full explanation in docs/ARCHITECTURE.md.


Configuration

policy.toml on the ESP:

version = 1
default_timeout_ms = 5000
default_entry = "fedora-6.12.0"

[security]
secure_boot_required = false
measured_boot = true
crash_threshold = 3
fallback_order = ["fedora-6.11.0", "fallback"]
allowlist = ["\\EFI\\fedora\\*", "\\EFI\\Microsoft\\*"]
denylist = []

[watchdog]
enabled = true
grace_seconds = 300

Full reference in docs/CONFIGURATION-GUIDE.md.


Boot entry discovery priority

  1. BLS entries — /loader/entries/*.conf on all volumes (ESP + XBOOTLDR + driver-mounted)
  2. Unified Kernel Images — \EFI\Linux\*.efi
  3. Windows — \EFI\Microsoft\Boot\bootmgfw.efi
  4. Other distros — \EFI\{fedora,ubuntu,debian,...}\grubx64.efi
  5. Fallback — \EFI\Boot\BOOTX64.EFI
  6. Diagnostic modules — \EFI\LamBoot\modules\*.efi (surfaced in menu with manifest names)

When BLS entries exist, legacy distro-path scanning is skipped to avoid duplicates.


Crash recovery

LamBoot's NVRAM state machine:

Fresh → Booting → BootedOK (OS calls systemd-bless-boot)
           │
           └→ CrashLoop (counter >= threshold)
                 │
                 └→ Fallback entry selected automatically

The OS-side systemd-bless-boot.service marks successful boots; LamBoot counts unsuccessful ones. At crash_threshold, LamBoot auto-selects from fallback_order.

NVRAM variables (4C414D42-4F4F-5400-0000-000000000001):

Variable Type Purpose
LamBootState u8 0=Fresh 1=Booting 2=BootedOK 3=CrashLoop
LamBootCrashCount u8 Crash counter
LamBootLastEntry UTF-8 Last booted entry ID
LamBootTimestamp 8 bytes Packed UTC
LamBootVersion u32 Packed semver
ShimRetainProtocol u8 Ask shim to leave ShimLock installed

Proxmox integration

tools/lamboot-monitor.py runs on the hypervisor host, reads LamBoot NVRAM from OVMF_VARS files on the backing storage — no agent inside the VM.

sudo python3 tools/lamboot-monitor.py

# VMID    Status       State  Crashes  Name
# ----------------------------------------------------------
#   100        OK    BootedOK        0  web-server
#   101      WARN     Booting        1  database
#   102      CRIT   CrashLoop        5  broken-vm

sudo python3 tools/lamboot-monitor.py --json
sudo python3 tools/lamboot-monitor.py --alert-webhook https://hooks.example.com/alert
sudo python3 tools/lamboot-monitor.py --vmid 102

Full walkthrough in docs/PROXMOX-GUIDE.md.


TPM measured boot

PCR What's measured Event type
4 Kernel image (Authenticode hash) EFI_BOOT_SERVICES_APPLICATION
5 policy.toml content IPL
12 Kernel command line (UTF-16) IPL

Gracefully degrades when TPM is absent — never blocks boot.


Diagnostic modules

Chainloaded EFI applications in \EFI\LamBoot\modules\:

Module Size Description
mem-quick.efi 24 KB Walking-ones and address-pattern memory tests
nvme-diag.efi 25 KB NVMe S.M.A.R.T. and health data for every controller
pci-inventory.efi 28 KB PCI device enumeration
diag-shell.efi 40 KB Interactive diagnostic shell

Manifest (modules/manifest.toml) provides friendly names. Modules signed with the same key as the bootloader. Build your own: see docs/DEVELOPER-GUIDE.md.


Filesystem reading

LamBoot reads its boot-relevant filesystems with native, in-binary, read-only Rust readers — no firmware filesystem driver and no GPLv3 EfiFs *.efi on the kernel-load path:

ext4    btrfs    FAT    XFS    exFAT    ZFS (boot pool)
media:  EROFS    ISO 9660    SquashFS    cramfs    romfs    UDF

Every native reader is read-only by construction. ZFS is limited to single-disk, mirror, and single-parity RAIDZ1 boot pools (unencrypted); the media mounts are read-only but not yet integrity/trust-root verified.

LamBoot ships no third-party filesystem drivers. It still loads a UEFI filesystem driver you put in \EFI\LamBoot\drivers\, which is how to reach a filesystem the readers above don't cover (f2fs, NTFS, or a standalone ISO 9660 partition). The [drivers] policy in policy.toml decides which drivers load, and a driver for a filesystem LamBoot reads itself is skipped, because loading it would shadow the native reader. Under Secure Boot a driver must be signed by a key your firmware or shim trusts. LamBoot loads drivers at startup under the SecurityOverride Path F guard, then reconnects controllers to expose their SimpleFileSystem handles.

Earlier releases: Up to 0.16.5 the bundle included drivers from rEFInd 0.14.2 (ext2, ext4 and iso9660 under GPL-2.0, btrfs under GPL-3.0-or-later) and EfiFs 1.12 (f2fs, ntfs, xfs and zfs under GPL-3.0-or-later), as separate programs that weren't linked into LamBoot. Their complete source is attached to the 0.16.5 release.


Comparison

LamBoot GRUB systemd-boot rEFInd Sprout
Language Rust C C C Rust
Memory-safe Yes No No No Yes
Menu Graphical, with mouse Text or themed graphical Text Graphical, with icons Graphical, mouse opt-in
BLS Type 1 Yes Yes (2.14+) Yes No Yes
UKI Yes (command line only; no addons or profiles yet) Yes (2.14+) Yes, with addons and profiles No Yes, with profiles
Boot Loader Interface Yes (0.17) Partial Reference implementation LoaderDevicePartUUID only Yes
Crash recovery Boot counting, an NVRAM state machine, and recovery inside the loader when an entry fails No Boot counting No Boot counting
Per-image authentication record Yes (JSON on the ESP) No No Optional activity log No
Secure Boot Certificate in db, or shim with MOK Shim, signed by distributions Shim, or own keys Shim with MOK Shim with a user-enrolled MOK
TPM measurement PCR 4, 5, 12 Yes, and a TPM2 key protector Yes; pcrlock support No Yes
Filesystems read ext4, btrfs, XFS, ZFS, exFAT, FAT, LVM and install media, in Rust, compiled in Most, in C (Ubuntu 26.10's signed build drops several) FAT only Through separate C drivers Through separate C drivers
Proxmox integration Host-side boot-health monitoring, fleet tools None None None None
Architectures x86_64, aarch64 Many x86_64, aarch64, riscv64, loongarch64 x86_64, aarch64 x86_64, aarch64
License MIT OR Apache-2.0 GPL-3.0-or-later LGPL-2.1-or-later GPL-3.0 (parts BSD) Apache-2.0

Checked against each project's releases on 2026-11-30: GRUB 2.16, systemd v262, rEFInd 0.14.2, Sprout 0.0.31.


Development

Prerequisites: Rust stable (nightly only for cargo fmt), sbsign, llvm-objcopy, QEMU + OVMF.

# Build
./build.sh

# x86_64 only
cargo build --target x86_64-unknown-uefi --release -p lamboot-core

# Lint + format (pre-commit hook runs these)
rustup run nightly cargo fmt
cargo clippy

# QEMU smoke test
./run-qemu.sh

See docs/DEVELOPER-GUIDE.md and CONTRIBUTING.md.


License

LamBoot: MIT OR Apache-2.0 (dual-licensed). See LICENSE, LICENSE-MIT, LICENSE-APACHE.

Third-party code in the binaries: Rust crates under their own permissive licences, listed with their notices in THIRD_PARTY_NOTICES.md.

Filesystem drivers: None ship from 0.17.0 on. Releases up to 0.16.5 bundled GPL drivers from rEFInd 0.14.2 and EfiFs 1.12 as separate programs; their complete source is attached to the 0.16.5 release.


Contact

Development happens in a private repo. The public repo mirrors each release. Pull requests and issues on the public repo are welcome.

About

LamBoot: a memory-safe UEFI bootloader for Linux, written in Rust. Public release repository (source at lamco-admin/lamboot-dev).

Topics

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages