All the necessary components (coreboot, kernel, busybox-based initramfs with cryptsetup/lvm2) are stored entirely in the bootloader flash chip. This leaves no writable unencrypted media in the boot process when the flash chip's write protect pin is shorted.
Ownerboot extends coreboot with a new
fallback mechanism. The flash chip holds two complete copies of the bootloader; only a single page (the bootblock) is shared between them. Each image can be flashed and write-protected indepedently of the other. The
fallback image can be selected by
nvramtool, or physical input (front-panel button on servers, stylus eject on laptops).
Because ownerboot is written in nix, it can ensure that these builds are deterministic. Ownerboot contains no binaries, and instantiates nixpkgs with
config.allowNonSource=false; if you disable nix's binary substituter you are assured that all the software in your bootloader will be built from source on your local machine, all the way back to the compiler which compiles your compiler.
nix-build --option trusted-public-keys "" src -A kgpe.image # kgpe-d16 AMD opteron nix-build --option trusted-public-keys "" src -A am1i.image # am1-i AMD kabini nix-build --option trusted-public-keys "" src -A kevin.image # Samsung chromebook rk3399 arm64
By default ownerboot builds for 16mbyte flash chips with two (NORMAL/FALLBACK) images per chip. You can produce a 8mbyte single-image-per-chip by appending
--arg flash-chip-size-in-mbytes 8 to any of the above commands.
Right now, yes.
On my own machines, I have a pile of big ugly bash scripts for
/linuxrc (i.e. initramfs PID 1, which
exec()s the long-lived PID 1). These are a complete mess and totally unsuitable for public release. I'm rewriting them in Rust and will publish the result of that work when it's ready.
Current (all require a 16mbyte flash chip):
Ownerboot includes three nixpkgs-style packages:
em100: a nix expression for the coreboot project's open-source driver for the em100 flash chip emulator.
nvramtool: a nix expression for the coreboot utility which manipulates the battery-backed (RTC) memory on x86 motherboards.
flashrom-wp: adds an out-of-tree patch to flashrom to configure which range of bytes are protected by the write-protect pin. Upstream does not have this feature. There appears to be adding some work towards adding it. Work on this began in 2016. There is a separate fork maintained by Google for their chromebooks which implements this functionality on them; it is enabled by the
I'm not sure either of these really belongs in nixpkgs, but they are useful to the same kinds of people who might be interested in ownerboot. So this is a good place for them.
The nix language is, by far, the most advanced solution available for auditable and reproducible builds of complex software. An incredible amount of software goes into an ownerboot image (almost none of which was written by me!); it's effectively a tiny Linux distribution, and as a bootloader it is at the pinnacle of security sensitivity. Nothing else besides nix gave me any confidence that I knew what was going into my bootloader.
nixpkgs was chosen because it is policy-free software: it doesn't force any policy decisions on its dependees.
nixpkgs also has amazing support for cross-compilation; once you've used it you'll never want to deal with cross compilers any other way, ever again.
Everything in this repository is licensed under the GNU General Public License, version 2 or version 3 (at your option).