Minimal bootable disk image builder
OCaml 90.7%
Dune 3.2%
Other 6.2%
21 1 0

Clone this repository

https://tangled.org/gazagnaire.org/uniboot https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/uniboot
git@git.recoil.org:gazagnaire.org/uniboot git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/uniboot

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

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)
  • LinuxKit - Toolkit for building Linux
  • MirageOS - Library operating system
  • Solo5 - Sandboxed execution environment

Licence#

ISC License. See LICENSE.md for details.