Peios Learn
Documentation

Peios

Peios Peios Kernel Universal Directory Project

Developer Tools

Trail Acta Provium clackatoo CAF GCSL Pekit

Applications

Framewright

Standards and Conventions

Standards and Conventions Peios Specifications
Peios

Building ISOs

Single-page view · as markdown

Peios ISOs

Peios / Developing for Peios / Building ISOs

A Peios ISO is a disc image that boots a live Peios system under UEFI, on a virtual machine or on a computer it is written to as a USB stick. peiso builds one from Peios packages, as a spec describes. For what a package is, see Packages.

What an ISO holds #

An ISO holds six things:

  • A unified kernel image (UKI). One EFI program holding the kernel, its command line, and the initramfs, the small filesystem the kernel starts from. It sits in an EFI system partition image, where UEFI firmware looks for the loader of a removable medium, so the firmware starts it directly.
  • A package store, at /artifacts. It holds every package the spec names and every package those depend on or require, laid out as ppk stores them.
  • The live system's image, at /live.sqfs. It is the live system's /usr as a read-only squashfs image: the packages the spec places in the live system and everything they need, with the inventory a composed /usr has. Each file and directory carries its security descriptor, and each signed file its signature, which the store's plain files on the medium can't, because ISO9660 holds no extended attributes.
  • The live system's profile and layout. /live.toml is the environment profile the image is the closure of: it asks for the packages the spec places in the live system, each at exactly the version peiso chose. peiso checks, when it builds the ISO, that resolving it from the store gives exactly those packages. /live.layout lists the links and empty directories the spec gives the live system's root outside /usr. For profiles, see Environments.
  • What an installer composes an installed system from, if the spec can be installed: /install/system.toml and /install/initramfs.toml, the requests of its /usr and its initramfs, each pinned to the version peiso chose, and checked as /live.toml is.
  • The medium's identifier, at /peios-medium. It is the SHA-256 hash of the packages, the profiles and the image, so the same spec and packages always make the same medium.

Where each package goes #

A spec places each package in one or more of these places:

  • The live system, whose /usr is the medium's image.
  • The initramfs, which prelude, Peios's early-boot init, runs from. Anything that runs before the live system exists belongs here: prelude itself, the live-boot hook that mounts the live system, and what the hook runs, such as a shell. The initramfs is held in memory, so it holds only what boot needs.
  • The installed system, which an installer composes from the medium, and its initramfs, which mounts the installed system's disk. A spec that places nothing there can't be installed.
  • The medium only, carried in the store and nowhere else. Such a package can be fetched from the medium later, which makes an ISO a library of packages for a machine with no network.

By default, a package goes in the live system and the installed system. Every package is in the store, wherever else it goes.

A package comes with what it needs. peiso resolves the packages the spec names together, with ppk's resolver, and carries one version of each package that they depend on or require. Each place then holds the packages placed there and everything they need, at the versions the store holds.

A dependency goes where the package that needs it goes. A package meant for the initramfs, such as a boot hook, must be placed there by the spec, even when a package of the live system depends on it. For the details, see ISO Specs.

How it boots #

  1. UEFI firmware starts the UKI from the medium's EFI system partition, and the kernel starts prelude from the initramfs.
  2. prelude runs the live-boot hook, which finds the medium: it tries each disc, disk and stick with an ISO9660 filesystem, waiting a few seconds for a USB stick to appear, and keeps the one whose /peios-medium matches the identifier the initramfs holds. Another Peios medium attached alongside is never taken for it.
  3. The hook checks the medium's image against the SHA-256 hash the initramfs holds, and mounts it read-only as the system's /usr, under a root on a fresh tmpfs. The system's /usr/inventory records what the spec asked for and what was chosen. The hook makes what /live.layout lists, and applies the system's root skeleton file, which gives the system its directories outside /usr and the /lib64 link. It moves the medium's mount to /media/peios in the system, where the image is read from and an installer reads the store.
  4. prelude switches to the live system and starts its init.

If the hook can't find the medium, or the image isn't the one the initramfs names, prelude opens its recovery shell when the kernel command line holds rd.shell.

The live system reads its /usr from the medium, so the medium must stay attached while it runs. Everything else lives in memory, so nothing the system writes survives a restart.

Building an ISO

Peios / Developing for Peios / Building ISOs

peiso build builds a bootable Peios ISO from packages you have built. Do this to try a set of packages as a whole system, or to make a medium to boot a machine from. For what an ISO holds, see Peios ISOs.

Before you start #

  • Install peiso, and mkirf and mkuki from peiosutils, or know where they are.
  • Install mkfs.vfat, mtools, xorriso, and mksquashfs from squashfs-tools 4.6 or later. peiso runs them, without any privilege.
  • Have the packages in an artifact directory, such as one that pekit packs into. The live system needs a shell and an init, and the initramfs needs prelude, the live-boot hook, and a shell. Packages bring what they depend on or require, so the artifact directory needs those packages too.
  • Have the kernel package, dev.peios.kernel, in the artifact directory too, or a Peios kernel image built with its EFI stub.

Write the spec #

Write the spec, such as peios.toml, beside the artifact directory. Paths in it are relative to the spec:

disable_default_repos = true

[[repository]]
filepath = "artifacts"

[kernel]
package = "dev.peios.kernel"
cmdline = "console=ttyS0 rd.shell"

[[package]]
name = "net.busybox.busybox"
initramfs = true

[[package]]
name = "dev.peios.ppk"

[[package]]
name = "dev.peios.prelude"
liveboot = false
initramfs = true

[[package]]
name = "dev.peios.live-root"
liveboot = false
initramfs = true

The kernel comes from its package, which the ISO carries in its store. The live system is busybox and ppk, and the initramfs holds busybox, whose shell the live-boot hook runs, with prelude and the hook itself. Each place also holds every package its packages depend on or require, and each package is carried at the newest version the artifact directory holds, unless the spec gives a version. For every key, see ISO Specs.

Check what the spec brings #

Run peiso resolve to list every package the ISO would carry, without building it:

peiso resolve peios.toml

Each line is a package, the places that hold it, and what first asked for it. A package in neither place is in the store only:

dev.peios.kernel@0.25.0-indev-1?arch=x86_64 store (the request for dev.peios.kernel)
dev.peios.prelude@0.0.7-1?arch=x86_64 initramfs (the request for dev.peios.prelude)
org.gnu.glibc@2.44-1?arch=x86_64 liveboot,initramfs (net.busybox.busybox@1.37.0-1 requires libc.so.6)

Build the ISO #

Run peiso build with the spec and where to write the ISO:

peiso build peios.toml --out peios.iso

Give --mkirf, --mkuki and --mksquashfs with their paths if they aren't on PATH. peiso says what it is doing, and prints the ISO's path when it is done:

peiso: fetching net.busybox.busybox@1.37.0-1?arch=x86_64
peiso: fetching dev.peios.ppk@0.1.0-1?arch=x86_64
peiso: fetching dev.peios.prelude@0.0.7-1?arch=x86_64
peiso: fetching dev.peios.live-root@0.1.0-1?arch=x86_64
peiso: fetching dev.peios.kernel@0.25.0-indev-1?arch=x86_64
peiso: writing the live system's image
peiso: composing the initramfs
peiso: building the UKI
peiso: writing the ISO
peios.iso

Boot it #

Boot the ISO in QEMU with OVMF, its UEFI firmware. OVMF writes to its variables, so give it a copy of them:

cp /usr/share/OVMF/OVMF_VARS_4M.fd vars.fd
qemu-system-x86_64 -enable-kvm -m 1G -machine q35 -nographic \
    -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.fd \
    -drive if=pflash,format=raw,file=vars.fd \
    -cdrom peios.iso

prelude reports each step of boot on the console, and starts the live system's init. The live-boot hook says where it found the medium, and checks the live system's image before it mounts it:

ppk-live-root: found the medium on /dev/sr0
ppk-live-root: checking the live system's image

To boot a computer, write the ISO to a USB stick and start the computer from it. The ISO is also a disk with an EFI system partition, so it boots from a stick as it does from a disc.

If peiso refuses #

peiso checks the spec and resolves every package before it builds anything. It refuses a package, or a dependency, that no repository holds at a version that will do, and says what needed it:

peiso: dev.peios.peios-experimental@2026.8-11 depends on dev.peios.bootconfig >= 0.21.0-alpha11-1, but no artifact directory holds dev.peios.bootconfig for x86_64: artifacts

It refuses a spec with no package in the live system, or none in the initramfs, since such an ISO couldn't boot. It also refuses what a spec can say but Peios can't do yet, such as a repository on the network, and says why.

If a tool it runs fails, peiso stops and shows what the tool said.

ISO Specs

Peios / Developing for Peios / Building ISOs

An ISO spec is a TOML file that says which packages an ISO carries, where they come from, and where each goes. Paths in it are relative to the spec's directory. Any key not listed here is an error, so that a misspelt key can't silently change nothing.

Top-level keys #

KeyDefaultMeaning
editionThe Peios edition the live system is, such as "Experimental". Its package is dev.peios.peios- followed by the edition in lowercase, such as dev.peios.peios-experimental, and the live system holds it and everything it needs.
edition_packageThe package of an edition that isn't one of Peios's own, such as com.example.peios-inhouse, in place of edition. Give one or the other.
versionthe newestThe edition package's version, as for a [[package]].
disable_default_reposfalseLeave out the default repository, pkgs.peios.org. It isn't available yet, so a spec must set this to true and give a [[repository]].

Repositories #

Each [[repository]] is a place packages come from. A package is taken from the first repository, in the order given, that holds the version chosen. If two hold the same version of a package, they must agree on what it is.

KeyMeaning
filepathAn artifact directory. Required.

Kernel #

[kernel] is the kernel the ISO boots: a package, such as dev.peios.kernel, or a file. Give one or the other.

KeyDefaultMeaning
packageThe package holding the kernel, at usr/lib/modules/vmlinuz. The ISO carries it in its store, with what it needs, and a [[package]] naming it says where else it goes.
versionthe newestThe kernel package's version, as for a [[package]].
fileA kernel image on this machine, built with its EFI stub.
cmdlineemptyThe kernel command line. rd.shell makes prelude open its recovery shell if boot fails.

Packages #

Each [[package]] is a package the ISO carries, and says where it goes. There are four places: the live system's /usr, an installed system's /usr, the live medium's initramfs, and an installed system's initramfs. Every package is in the ISO's store wherever else it goes, so a package in none of them is carried for fetching from later. An edition's package can't also be given as a [[package]].

KeyDefaultMeaning
nameThe package's name. Required, and given once.
versionthe newestThe versions that will do, as a version constraint, such as ">= 1.2". A version on its own, such as "1.2.0-1", is that version exactly. The newest version that will do is carried.
roottrueShorthand for liveboot and installed together.
livebootrootWhether the live system holds the package and everything it needs.
installedrootWhether an installed system's /usr, its SYSTEM closure, holds it.
initramfsfalseShorthand for liveboot_initramfs and installed_initramfs together.
liveboot_initramfsinitramfsWhether the live medium's initramfs holds it.
installed_initramfsinitramfsWhether an installed system's initramfs, its INITRAMFS closure, holds it.

A place named on its own overrides its shorthand. So most packages need none of these, a package only for the live medium has installed = false, and one only for the initramfses has initramfs = true and root = false. The live medium's boot hook has liveboot_initramfs = true and an installed system's installed_initramfs = true, each with root = false.

At least one package must be in the live system, and at least one in the live medium's initramfs. A spec with no package in an installed system can't be installed from; one with packages there must also have one in an installed system's initramfs.

What packages bring #

A package brings every package it depends on, and a package providing each capability it requires, such as sh or libc.so.6. peiso chooses them with ppk's resolver, from the edition's package, the kernel package, and every [[package]] together:

  • Each package name is chosen once, at the newest version that satisfies what asks for it first. Anything that asks for another version is an error, which names both.
  • A capability is satisfied by a package already chosen if one provides it. Otherwise, the package providing it is chosen. If several packages provide it, name the one to carry with a [[package]].

The ISO's store holds every package chosen. The live system holds the edition, each package with liveboot = true, and everything they need, and each other place likewise holds its packages and everything they need. An installed system holds the edition too. A place takes the versions and providers the store holds, so the live system and the initramfs never hold two versions of a package.

A dependency goes where the package that needs it goes, and nowhere else. A package of the live system can depend on one meant for the initramfs, such as dev.peios.live-boot on its boot hook, dev.peios.live-boot-irf. The live system then holds the hook as well, and the initramfs holds it only if the spec places it there.

To see what a spec brings before building it, run peiso resolve. See Building an ISO.

Registry seeds #

Packages ship seed masters under /usr/share/regim, but the spec chooses which the image applies. No release metadata is read for this policy.

[seeds]
apply = ["base-service"]
live = ["seeds/console-shell.reg"]
install = ["first-boot"]

All three lists default to empty. A bare seed name selects usr/share/regim/<name>.reg from the composed live closure, including dependencies. A package carried only in the store or initramfs cannot supply it. A relative path ending in .reg selects a file beside the spec, staged using its filename. Names use ASCII letters, digits, dots, underscores, and hyphens. Absolute file paths, unknown keys, and duplicate destination names, within or across queues, are errors.

ListMedium directoryApplied on
apply/lcl/policy/autoapply.dThe live medium and an installed system.
live/lcl/policy/autoapply.live.dThe live medium only.
install/lcl/policy/autoapply.install.dAn installed system, after an installer promotes it.

When any seed is named, peiso also stages the executable /lcl/policy/autorun.d/10-apply-seeds.sh. The live-root hook copies the medium's /lcl into the live system's root, preserving modes. After registryd starts, peinit runs the script, applying the common queue and then the live queue with reg apply --once-delete. The install queue remains untouched. An installer must remove the live queue and promote the install queue into the target's common queue.

Seed files have mode 0644 and the script has mode 0755. Their paths, contents, and modes contribute to the medium identifier. With no seeds, peiso stages no /lcl tree.

Layouts #

[initramfs] and [liveboot] give what the initramfs and the live system hold outside /usr, written as an environment profile's keys are. For the format, see Environments.

KeyMeaning
symlinksEach link's path and target. A target that starts with : is in usr.
dirsEmpty directories.
includeProfile fragments whose links and directories the layout holds as well, each relative to the spec's directory. A fragment that names packages is refused, since the spec chooses those.

A table replaces the default, rather than adding to it. The defaults are:

[initramfs]
dirs = ["proc", "sys", "tmp"]

[liveboot]
symlinks = { "bin" = ":bin", "sbin" = ":sbin" }

The initramfs's /init isn't in its layout: prelude's package claims it, and composing the initramfs creates the link. A layout can't also give a path that a package claims.

A layout needs no directories or links that fsbase's skeleton gives, such as /var, /lcl, /tmp or /lib64. Each root gets those from the root skeleton file its own closure holds, at /usr/share/skeleton. Carry dev.peios.fsbase in the live system and dev.peios.fsbase-irf in the initramfs. peiso applies the initramfs's file after composing it, and the live-boot hook applies the live system's at boot, with each directory's security descriptor. An initramfs can't hold descriptors, so its directories get none. peiso warns when the initramfs has no skeleton file.

Don't list a skeleton directory in [liveboot]. The layout's directories are made first, and the skeleton leaves an existing directory as it is, so it would lose the skeleton's descriptor.

Refused until supported #

A spec can already use these keys, but peiso refuses each, saying why, until Peios can do what it asks:

KeyNeeds
url in a [[repository]]Repositories on the network.
autoinstall, offerinstall in a [[package]]An installer.

Peios Learn — documentation for Peios software.

Built with Trail.