Skip to content

Building Block View

Whitebox Overall System

Building block Responsibility
mkLibreToyImage and the image modules Turns the declarative configuration into the image: partition table, filesystems, bootloader, optional payload.
libretoy-config One configuration document; read and edited wherever it is needed, consumed by a Nix wrapper at build time.
libretoy-bootloader Generates the GRUB configuration and the boot menu.
libretoy-dd Writes a LibreToy image to the device from the host, then applies the configuration.
libretoy-repartition Repartitions the stick on the device.
modules/images Holds the image catalog (URL and hash) and places images on the stick.
libretoy-live Runs on the target from the full image: hands over to libretoy-config and applies the configuration idempotently.
Deliverables The minimal image (bootloader only) and the full image (bootloader, kernel and initrd).

libretoy-live and libretoy-dd (Whitebox)

Both start the same path at different places: libretoy-dd writes the image to the device on the host, libretoy-live boots from the full image on the target. From there both hand over to libretoy-config and libretoy-apply. Both take an existing configuration as their usual input; it may be created or updated first in the libretoy-config step. libretoy-dd keeps its name for now; the host-side counterpart of libretoy-live will be called libretoy-flash.

flowchart LR
  dd["libretoy-dd"] --> write["dd: write the image"]
  write --> cfg["libretoy-config"]
  live["libretoy-live"] --> cfg
  cfg --> apply["libretoy-apply"]
  apply --> rebuild["libretoy-rebuild"]
  apply --> repart["libretoy-repartition"]
  repart --> catalog["libretoy-catalog-install"]
Component From where Input Reaches
libretoy-live target, full image the existing configuration, or one created with libretoy-config a running stick that applied its updated configuration
libretoy-dd host a LibreToy image, a device and the existing configuration, or one created with libretoy-config a written device with the configuration applied
libretoy-config host, target, web app user input a valid configuration document
libretoy-apply host, target the configuration a stick that matches its declaration
libretoy-repartition host, target the partition part of the config the disk layout the configuration asks for
libretoy-catalog-install host, target the image part of the config and the catalog verified images on the stick
libretoy-rebuild host, target changed partitions or images an updated bootloader and configuration