uniboot#
CLI tool for creating minimal, reproducible bootable disk images.
Overview#
Uniboot builds bootable disk images with GPT partition tables, combining kernel, initramfs (cpio), and rootfs (squashfs) into a single image. Inspired by LinuxKit's workflow for building minimal, reproducible systems.
Features#
- GPT partition table generation
- EFI System Partition support
- Initramfs creation (cpio format)
- Read-only rootfs (squashfs format)
- Configurable partition sizes
- Reproducible builds
Installation#
opam install uniboot
Usage#
# Build a bootable image with kernel and rootfs
uniboot build -o disk.img \
--kernel vmlinuz \
--rootfs /path/to/rootfs/
# Customize partition sizes
uniboot build -o disk.img \
--kernel vmlinuz \
--initramfs /path/to/init \
--rootfs /path/to/rootfs/ \
--esp-size 100 \
--rootfs-size 512
# Use 4K sector size for modern drives
uniboot build -o disk.img \
--kernel vmlinuz \
--rootfs /path/to/rootfs/ \
--sector-size 4096
Options#
| Option | Default | Description |
|---|---|---|
-o, --output |
required | Output disk image file |
-k, --kernel |
- | Path to kernel image |
-i, --initramfs |
- | Paths to include in initramfs |
-r, --rootfs |
- | Paths to include in rootfs |
--esp-size |
64 | EFI System Partition size (MB) |
--rootfs-size |
256 | Root filesystem size (MB) |
--sector-size |
512 | Disk sector size (bytes) |
Related Work#
- LinuxKit - Toolkit for building Linux
- MirageOS - Library operating system
- Solo5 - Sandboxed execution environment
Licence#
ISC License. See LICENSE.md for details.