Minimal bootable disk image builder
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 89.3%
Dune 3.5%
Other 7.1%
686 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#

Install with opam:

$ opam install uniboot

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ 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.