commit e70597462a7cf35a0e2840e2001c1cf06b60bac0
parent 805c80b13be3c37144f52ddce4598ac9aae90ab1
Author: Divan Visagie <me@divanv.com>
Date: Fri, 20 Nov 2026 19:41:39 +0100
Docs: Patina OS is Ubuntu on a ZFS root; boot environments as ZFS streams are a later stage, bootc is ruled out (ADR-0006 to 0008, comparison)
Diffstat:
7 files changed, 270 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
@@ -1,36 +1,21 @@
# Patina OS
-An experiment to find which operating system base makes the least complicated OS for the
-Patina desktop: one where a machine boots a known-good build of the system, updates by moving to
-the next one whole, rolls back if it breaks, and keeps the user's data and apps apart from it.
+Ubuntu with the Patina desktop: no snaps, the root and every user's home on ZFS, and a snapshot before every apt run, so a bad upgrade is undone by booting the snapshot (ADR-0007). One OS for the laptop and the workstation, with Ubuntu's hardware support (CUDA included) and Debian's packages.
-Two bases are being tried, side by side:
+It started as an experiment to find which base makes the least complicated image-based OS for the Patina desktop, one updated whole and kept apart from the user's software. Two bases were tried, and are kept as the record:
-- **[linux/](linux/)**: Ubuntu 26.04 as a bootc image, built from a Containerfile, with `/home`
- on a ZFS pool. It boots in a VM to GDM and the Patina desktop, and upgrades and rolls back
- ([linux/vm/README.md](linux/vm/README.md)), but took a newer kernel, workarounds for bootc's
- young Ubuntu support, and still has an open bug: upgrades that change a large layer fail.
-- **[freebsd/](freebsd/)**: FreeBSD 15.1 on ZFS, where the system is a boot environment and
- `/home` a dataset out of the box; updates, rollback and shipping a build are `bectl` and ZFS
- streams ([freebsd/README.md](freebsd/README.md)).
+- [**freebsd/**](freebsd/): FreeBSD 15.1 on ZFS, where the system is a boot environment and `/home` a dataset out of the box; updates, rollback and shipping a build are `bectl` and ZFS streams ([freebsd/README.md](freebsd/README.md)). The simplest system, held back by laptop hardware.
+- [**linux/**](linux/): Ubuntu 26.04 as a bootc image, with `/home` on a ZFS pool ([linux/vm/README.md](linux/vm/README.md)). It worked, on a young, community-held base, and is ruled out (ADR-0006).
-The app model (an app is a folder, as on a Mac) and the principles below hold whichever base
-wins. See [docs/adr](docs/adr) for decisions and [docs/notes.md](docs/notes.md) for the research
-and open questions behind them.
+Built boot environments shipped as ZFS streams (ADR-0006) stay a possible later stage: the pool and boot loader are the same. [docs/comparison.md](docs/comparison.md) compares the options on keeping user and system software apart, safe upgrades, turning updates off, ZFS, laptops and commercialisation.
+
+Installing takes the whole disk: the system is built once and received as a ZFS stream into a pool made on the machine, from a USB stick that boots Patina OS itself (ADR-0008).
+
+See [docs/adr](docs/adr) for decisions and [docs/notes.md](docs/notes.md) for the research and open questions behind them.
## Principles
-- **The core is locked; apps are the user's.** The system is one unit, the same on every
- machine and not changed while it runs. Everything a user adds (apps, tools, their settings)
- lives in their home folder, so it survives every system update and rollback, and never
- changes the system under it.
-- **Built, not assembled by hand.** The system is built from a recipe, repeatably, and shipped
- whole, rather than each machine being installed and upgraded package by package. No
- from-scratch distro to maintain: the base provides the packages, we choose and arrange them.
-- **An app is a folder.** `~/Apps/Name.app`, with an `app.toml` saying how to run it:
- copy it in to install, delete it to uninstall, never touch the system. As on a Mac, it brings
- everything but a small, versioned platform the system guarantees (the C library, Wayland, the
- GPU's drivers), so system updates never break it (ADR-0002, ADR-0005).
-- **Opinionated.** One desktop (Patina), one way to add apps, one way to keep data (ZFS).
-- **Something new.** Not a copy of another distro: fix what's missing, starting with the
- blurred line between the system's packages and the user's.
+- **The system can always go back.** The root is on ZFS and every apt run is snapshotted first; a broken upgrade is undone by booting the snapshot. Each user's home is its own dataset, untouched by any rollback.
+- **Stock Ubuntu, no snaps.** Debian packages from Ubuntu's LTS archive, so there's no distro to maintain: the base provides the packages, we choose and arrange them. snapd is pinned out.
+- **An app can be a folder.** `~/Apps/Name.app`, with an `app.toml` saying how to run it: copy it in to install, delete it to uninstall, never touch the system. It brings everything but a small, versioned platform the system guarantees (the C library, Wayland, the GPU's drivers), so system updates never break it (ADR-0002, ADR-0005). The simplest way, beside apt and Flatpak.
+- **Opinionated.** One desktop (Patina), one way to keep data (ZFS).
diff --git a/docs/adr/0001-bootc-image-with-zfs-for-data.md b/docs/adr/0001-bootc-image-with-zfs-for-data.md
@@ -4,7 +4,7 @@ Date: 2026-10-15
## Status
-Proposed
+Superseded by ADR-0006 (bootc ruled out) and ADR-0007 (Ubuntu updated with apt on a ZFS root).
## Context
diff --git a/docs/adr/0006-updates-are-zfs-streams-of-boot-environments.md b/docs/adr/0006-updates-are-zfs-streams-of-boot-environments.md
@@ -0,0 +1,43 @@
+# 0006. Updates are ZFS streams of boot environments, on either base; no bootc
+
+Date: 2026-10-22
+
+## Status
+
+Deferred by ADR-0007: Patina OS is Ubuntu updated with apt on a ZFS root for now. Built boot environments stay a possible later stage. Its ruling-out of bootc stands.
+
+## Context
+
+ADR-0001 chose an Ubuntu bootc image for the system and a ZFS pool for the data. The VM showed it working (linux/vm/README.md), but every step leaned on bootc's young Ubuntu support: a newer kernel than the base's (fs-verity), bootc built from source, a community base image rather than Canonical's, and an upgrade bug still open (an upgrade that changes a large layer fails). bootc also can't sit on ZFS well: its composefs backend wants fs-verity, which ZFS doesn't have, so the system and the data stay on two filesystems.
+
+FreeBSD's VM (freebsd/README.md) did the same job with ZFS alone: the system is a boot environment (a dataset), an update is a new one, a build ships as a `zfs send` stream (2.9 GB whole, 5.1 MB as an increment), and rollback is booting the previous one. Nothing in that is FreeBSD's: OpenZFS is the same code on Linux, and ZFSBootMenu boots Linux from boot environments the way FreeBSD's loader does.
+
+So the update strategy doesn't have to depend on the base. What bootc gave the Linux side (building with containers, no snaps) doesn't need bootc either: the Containerfile builds the system, and its filesystem is what goes into the boot environment.
+
+Weighed and ruled out:
+
+- **Ubuntu + bootc** (ADR-0001): for the reasons above.
+- **CentOS Stream 10 + bootc**: bootc's best-tested path, but still bootc, with ZFS from a third-party repository and a 6.12 kernel that trails on new laptops.
+- **Fedora + bootc**: its kernels outrun OpenZFS.
+- **Ubuntu on a ZFS root, upgraded with apt in place**: snapshots, but the system is assembled on each machine, not built and shipped whole.
+
+## Decision
+
+- **Two bases remain: FreeBSD and Ubuntu.** Both on a ZFS root, both updated the same way. Which one is decided mostly by laptops (docs/comparison.md).
+- **One pool per machine**, laid out the same on both: `patina/ROOT/<build>` for each system build, `patina/home/<user>` for each user. Pools are made with `compatibility=openzfs-2.2` (or whatever both bases' OpenZFS share), so either OS can import them.
+- **A build is a boot environment.** On Ubuntu, the Containerfile builds the system (with its kernel and an initramfs that imports the pool) and its filesystem is written into a new dataset. On FreeBSD, `pkg -r` installs into a new dataset. Either way it's built on a build machine, never assembled on the user's.
+- **A build ships as a ZFS stream**: incremental from recent builds, whole for machines too far behind, signed, served as plain files. The machine receives it beside the running system (`zfs receive -s`, so a broken download resumes) and boots into it next time.
+- **The system is read-only** (`readonly=on` on its dataset), so nothing changes it but a new build. That keeps incremental streams applying cleanly and the system apart from the user's software (ADR-0002).
+- **One updater, in Rust, for both**: check, fetch, verify, receive, set the next boot, and after the reboot confirm it or fall back. Only the last steps differ: `bectl activate -t` on FreeBSD, ZFSBootMenu and the pool's `bootfs` on Ubuntu.
+- **The user decides when**: updates are staged, never rebooted into for them, and can be turned off.
+
+## Consequences
+
+- The update system is designed once and doesn't change with the base. Choosing FreeBSD or Ubuntu later costs a build recipe and a boot loader, not a new update model.
+- What bootc did for us is ours: the updater, the boot-once-then-confirm on Ubuntu (check what ZFSBootMenu offers), and the machine's state in `/etc` (users, hostname, networks), which a new build would otherwise replace. That's one design for both bases: an `etcupdate`-style merge, or the machine's state kept outside the boot environment.
+- Streams carry their checksums, so corruption is caught, but not tampering: signing them (minisign or similar) is required, not optional.
+- The server keeps streams from a few recent builds to the newest, and one whole build. A machine whose system dataset differs from what was shipped can't take an increment; read-only prevents that.
+- On Ubuntu the root is ZFS, so the system can't boot without the CDDL module Canonical ships with its GPL kernel. A product inherits that licence question in full (docs/comparison.md).
+- On Ubuntu the Containerfile can start from Canonical's own `ubuntu` image instead of the community bootc base.
+- The bootc VM in linux/ stays until the Ubuntu boot environment loop replaces it; it's no longer the direction.
+- ZFS everywhere: native encryption can cover the system's `/etc` and `/var` as well as the homes.
diff --git a/docs/adr/0007-ubuntu-without-snaps-on-a-zfs-root.md b/docs/adr/0007-ubuntu-without-snaps-on-a-zfs-root.md
@@ -0,0 +1,62 @@
+# 0007. Ubuntu without snaps, on a ZFS root, snapshotted before every apt run
+
+Date: 2026-10-22
+
+## Status
+
+Accepted. Defers ADR-0006 to a later stage; supersedes ADR-0001.
+
+## Context
+
+ADR-0006 settled on boot environments shipped as ZFS streams, on FreeBSD or Ubuntu, with the system read-only and the user's software somewhere else. Working out the "somewhere else" kept adding parts: a jail or pkgsrc for command-line tools, our own build of packages, wrappers to run them, an updater, a way to keep `/etc`. FreeBSD made most of that simplest, but not the hardware: graphics, Wi-Fi and sleep on laptops trail Linux, and the workstation the Patina desktop is used on every day needs Ubuntu for CUDA.
+
+Plain Ubuntu, kept from snaps, answers what matters most in practice:
+
+- One OS on the laptop and the workstation, with Ubuntu's support for lids, batteries, suspend, NVIDIA and CUDA.
+- Debian's packages: the software people expect, installed the way they expect, for every user on the machine.
+- Ubuntu's LTS releases are stable; 26.04 is supported to April 2031.
+
+It gives up the system as one locked unit, built and shipped whole and kept apart from what the user installs. Most of what that was for (a bad upgrade never leaves the machine broken) a ZFS root gives back: snapshot before every apt run, boot the snapshot if the upgrade breaks something.
+
+## Decision
+
+- **Patina OS is Ubuntu LTS (26.04) with the Patina desktop**, installed from Ubuntu's archive with apt. No from-scratch distro, no image pipeline for now.
+- **No snaps.** `snapd` is pinned so apt never installs it (as Linux Mint's `nosnap.pref` does). What Ubuntu ships only as a snap comes from elsewhere: Firefox and Thunderbird from Mozilla's apt repository, Chromium as a Flatpak or Google Chrome's `.deb`.
+- **The root is on ZFS**, in the pool laid out as before: `patina/ROOT/<name>` for the system, `patina/home/<user>` for each user, so rolling the system back never touches anyone's data.
+- **Every apt run is snapshotted first**, by an apt hook (`DPkg::Pre-Invoke`), and old snapshots are pruned. ZFSBootMenu, on the ESP, boots the system or any of its snapshots, so a broken upgrade is undone at the next boot.
+- **Swap is its own partition**, not a ZFS volume (swap on a zvol can deadlock under memory pressure, and can't take a hibernation image).
+- **Suspend, not hibernate.** Checked 2026-10-22: hibernation with ZFS is possible but not safe enough to ship. OpenZFS's freeze before hibernating is known to let a little I/O through after the memory image is taken, so the disk ends up ahead of what the resumed kernel believes, which can corrupt a pool (OpenZFS issue 12842); this holds wherever swap is. NixOS turns hibernation off whenever ZFS is in use (`nohibernate`), behind an option named `unsafeAllowHibernation`. Swap on a zvol deadlocks instead. ZFSBootMenu adds its own problem: it starts the kernel with kexec, and kernels from 6.8 fail to resume from hibernation when kexec-booted (a regression reported in March 2025). People do run it, for example Kubuntu on ZFS with LUKS-encrypted swap on a Framework laptop, booted by GRUB with Secure Boot off; and Ubuntu's kernel refuses to hibernate under Secure Boot's lockdown whatever the filesystem. So the machine suspends; hibernation can be reconsidered if OpenZFS fixes the freeze and kexec resume works.
+- **Nothing is lost by this: Ubuntu doesn't hibernate by default either.** A default install has no `resume=` target and a swap file smaller than RAM, and logind reports that it can't hibernate. Checked on nifl (a ThinkPad X1 Carbon Gen 9, Ubuntu 26.04 as installed, ext4 on LVM, no ZFS, Secure Boot off): `CanHibernate` is `no`, swap is a 4 GB file against 14 GB of RAM, and it has never hibernated. Hibernating on stock Ubuntu is something a user sets up by hand; with a ZFS root it's the one thing they can't safely set up.
+- **Suspend is the firmware's default, modern standby (s2idle)**, not S3 where the firmware offers it. It wakes at once, which matters more than the drain for a laptop opened and closed through the day; what matters then is that it reaches its deepest state (S0ix). nifl manages that for only about 7% of the time it's suspended, losing about 0.8% of its battery an hour; finding what keeps it awake, and making that a default, is the work.
+- **ZFS's cache is capped** at a quarter of RAM by default (`zfs_arc_max`), since on Linux it gives memory back to programs more slowly than the kernel's own cache does. **Dedup is never on by default**: its table lives in RAM (602 MB for 1.18x on the workstation's `tank/Src`), which ZFS otherwise doesn't need much of.
+- **doas, not sudo, for admin work** (`opendoas`, in universe; nifl uses it today). Its whole configuration is a line or two in `/etc/doas.conf` (`permit persist :sudo`, so the admin group is the same one Ubuntu's installer uses), against sudo's policy language, and it's what OpenBSD and many FreeBSD users use. sudo-rs (Ubuntu's sudo since 25.10) stays installed for scripts and installers that call `sudo` by name; whether to drop it, or make `sudo` a small shim that runs doas, is open. Polkit (pkexec, the desktop's password prompts) is separate and unaffected. *(Check that Ubuntu's opendoas build supports `persist`.)*
+- **Ubuntu's own kernels only**, which come with the ZFS module built for them.
+- **Apps**: apt and Flatpak for most software; `~/Apps` folders (ADR-0002, ADR-0004, ADR-0005) stay as the simplest way, for people who want to copy an app in and delete it to remove it.
+
+## Considered: an ext4 root with ZFS only for data
+
+The workstation is set up this way: Ubuntu on ext4 on the NVMe drive, and a ZFS pool on other disks for the data that matters (`~/Src`, photographs, games, backups). It was weighed against a ZFS root:
+
+| | ext4 root + ZFS for data | Root on ZFS |
+|---|---|---|
+| Always boots | Yes: ZFS isn't needed to boot; if its module breaks only the pool is lost | ZFS is in the boot path (low risk: Ubuntu builds the module with each kernel) |
+| Undo a bad apt upgrade | No (only with a btrfs root and its snapshots) | Yes: snapshot first, boot it from ZFSBootMenu |
+| Hibernation | Possible (with ZFS's pools imported, still exposed to its freeze bug) | No (above) |
+| Installer | Ubuntu's own | Ours |
+| Install from a ZFS stream (ADR-0008) | No (a Pi-style ext4 image, written and grown, would do for the root) | Yes |
+| One-disk laptop | Two partitions, the root's size guessed | One pool, nothing to size |
+| RAM | Two caches compete, ext4's and ZFS's | One cache, ZFS's |
+
+RAM isn't the difference it's often taken to be: ZFS runs well in a few GB, the pool's cache is shared either way, and what costs RAM is dedup, not a ZFS root. The ext4 root is the sturdier choice for a workstation with several drives. For Patina OS, on one-disk laptops, it's the ZFS root: undoing a bad upgrade is what ADR-0007 relies on in place of images, and installing from a stream needs it.
+
+## Consequences
+
+- Little to build: an install script (partitions, pool, datasets, ZFSBootMenu, the no-snaps pin, the apt hook, the desktop), and the Patina desktop as `.deb` packages, ideally from our own apt repository.
+- Usable now, on both the laptop and the workstation, CUDA included.
+- The line between the system's software and the user's is Ubuntu's usual one: both live in `/usr`, installed with apt. Snapshots make upgrades safe to undo, but each machine's system is its own, assembled package by package, not a build we tested.
+- An apt run that fails halfway leaves the running system half upgraded until it's fixed or rolled back; with an image it would never have been touched.
+- ADR-0006 stays possible as a later stage: the pool and the boot loader are the same, so moving to built boot environments changes only how `patina/ROOT` is filled.
+- No hibernation on laptops (above); suspend only, as on a default Ubuntu install. A laptop left closed for days drains its battery (about 18% a day on nifl today), so how deeply it suspends matters.
+- ZFS as the root means the system can't boot without the CDDL module Canonical ships with its GPL kernel; a product sold on it inherits that question (docs/comparison.md).
+- ZFSBootMenu is a third-party project, and Ubuntu's own installer isn't used.
+- The FreeBSD work (freebsd/) and the bootc VM (linux/vm/) stay as the record of what was tried.
diff --git a/docs/adr/0008-install-by-receiving-the-system-as-a-zfs-stream.md b/docs/adr/0008-install-by-receiving-the-system-as-a-zfs-stream.md
@@ -0,0 +1,44 @@
+# 0008. Install by receiving the system as a ZFS stream, onto the whole disk
+
+Date: 2026-10-22
+
+## Status
+
+Proposed
+
+## Context
+
+Patina OS is Ubuntu on a ZFS root (ADR-0007), so it needs an installer: Ubuntu's own doesn't make our pool, datasets and ZFSBootMenu, and the pool layout is ours.
+
+A Raspberry Pi is installed by writing an image to the SD card and growing it on first boot. Raspberry Pi OS, Armbian, ChromeOS and Steam Deck recovery, Apple's restores and Windows OEM images all work this way: every machine starts from the exact build that was tested, and installing takes minutes, not a package-by-package install. Desktop distros mostly don't, for three reasons:
+
+- **They share the disk**: dual boot, keeping an old `/home`, custom partitions. An image that takes the whole disk rules those out.
+- **Some things must differ per machine**: machine-id, SSH host keys, the ZFS host ID and pool GUID, and above all encryption keys. A cloned encrypted image gives every machine the same master key, and ZFS's `zfs change-key` changes only the key wrapping it, not the key itself.
+- **Something has to boot first to write the disk**, which on a laptop means a USB stick, an installer of sorts anyway.
+
+ZFS removes the second problem: rather than copy a disk image block for block, the system can be sent as a stream into a pool made on the machine. And an opinionated OS that owns the whole disk, as a Mac or a Chromebook does, doesn't have the first.
+
+## Decision
+
+- **The system is built once, in CI**, from a recipe (the Containerfile, without bootc, or a debootstrap script) into a dataset, and kept as a ZFS stream: the image.
+- **The USB stick is Patina OS itself**, booting from that same system, so it can be tried before installing. It carries the stream.
+- **Installing takes the whole disk**, and says so. The installer:
+ 1. partitions the target: the ESP, a swap partition (ADR-0007: no swap on ZFS), and the rest for the pool;
+ 2. makes a **new pool** on the disk's stable name (`/dev/disk/by-id/...`) with `zgenhostid` and the layout of ADR-0007, so the pool GUID and host ID are this machine's, and the pool is the disk's full size, with nothing to grow;
+ 3. sets up **encryption on the machine**, if chosen, so its keys exist nowhere else;
+ 4. receives the system: `zfs send | zfs receive` into `patina/ROOT/default`;
+ 5. installs ZFSBootMenu on the ESP and sets the pool's `bootfs`;
+ 6. creates the first user, and their dataset `patina/home/<user>`.
+- **First boot makes what's per machine**: machine-id, SSH host keys, the hostname.
+- **From there it's ADR-0007**: apt, with a snapshot before every run. The machine starts from a known build; it isn't kept as one.
+
+## Consequences
+
+- Installing is a few minutes of copying, the same on every machine, with no packages fetched or configured during it.
+- Every machine starts from exactly the build that was tested. A broken install is a broken build, found in CI, not on someone's laptop.
+- No duplicated pool GUIDs, host IDs or encryption keys between machines.
+- No dual boot, and no installing beside another OS. Patina OS is the whole disk.
+- The installer is ours to write and keep: a script first, a small Patina UI over it later. It's short, since the hard parts (packages, configuration) are done at build time.
+- The stream and the build recipe are the same pieces ADR-0006 would update with, should that stage come: installing becomes the first receive, and an update another.
+- Reinstalling or recovering is the same steps, and keeping a user's data through a reinstall is possible later: receive a new `patina/ROOT/default` and leave `patina/home` alone.
+- The CI build needs ZFS and a way to write a dataset (a VM or a machine with a pool), and the USB stick image needs building too.
diff --git a/docs/comparison.md b/docs/comparison.md
@@ -0,0 +1,92 @@
+# Comparing the bases
+
+How the bases for Patina OS compare on what matters to the product: keeping the user's software apart from the system's, updating safely, letting the user decide when to update, ZFS, laptops, and whether it could be sold. Written 2026-10-22.
+
+**Decided 2026-10-22 (ADR-0007): plain Ubuntu, no snaps, root on ZFS, snapshotted before every apt run.** The comparison below is between the two image-based designs that led there, kept as the record. Ubuntu with apt in place was ruled out below for being assembled on each machine rather than built and shipped whole; that was given up for hardware support (laptops and CUDA on one OS) and software compatibility, with snapshots and ZFSBootMenu standing in for atomic updates. ADR-0006's boot environments remain a possible later stage.
+
+Before that decision, two remained (ADR-0006):
+
+- **FreeBSD** ([freebsd/](../freebsd/)): FreeBSD 15.1 on a ZFS root. Tried in a VM.
+- **Ubuntu** ([linux/](../linux/)): Ubuntu 26.04 built from a Containerfile, written into a ZFS boot environment and booted by ZFSBootMenu. No bootc, no snaps. Not tried yet: the VM in linux/ is still the bootc one this replaced.
+
+Both are updated the same way, so that's no longer what separates them. What's left is mostly laptops.
+
+What each claim rests on is marked: **seen** means a VM here showed it; everything else is what the base documents or is known for, and the ones marked *(check)* need confirming before a decision leans on them.
+
+## At a glance
+
+| | FreeBSD | Ubuntu, Containerfile on ZFS |
+|---|---|---|
+| **User and system software kept apart** | Strong: read-only system dataset *(not tried)* | Strong: the same |
+| **Safe upgrades** | Strong: the shared model; boot-once fallback built in (`bectl activate -t`) | Strong: the shared model; boot-once fallback is ours to add *(check ZFSBootMenu)* |
+| **Letting the user turn updates off** | Strong: our updater, same on both | Strong: the same |
+| **ZFS** | Strong: in the base, its installer and loader | Strong, with a licence question: Canonical's module, ZFS root |
+| **Laptops** | Weak: graphics, Wi-Fi and sleep trail Linux *(check on hardware)* | Strong: newest kernel, widest support |
+| **Commercialisation** | Strong licence; hardware is the limit | Workable: GPL source duty, Ubuntu trademark, CDDL-on-GPL question |
+| **Building the system** | `pkg -r` into a dataset, or FreeBSD's OCI images *(check)*; recipe not written yet | The Containerfile we have, from Canonical's `ubuntu` image |
+| **Our upkeep** | Medium: build recipe, `/etc` | Medium: image-to-dataset step, ZFSBootMenu, `/etc` |
+
+The short version: FreeBSD is the cleaner system, where ZFS and boot environments are the base's own; Ubuntu runs on far more laptops. The update model, the app model (ADR-0002, ADR-0005) and the pool are the same on both, so the decision rests on how FreeBSD runs on the laptops Patina OS is for, which no test has tried yet.
+
+## Updates: one model for both
+
+The same on either base (ADR-0006):
+
+- **A build is a boot environment**: a ZFS dataset, `patina/ROOT/<build>`, holding the whole system with its kernel. It's built on a build machine and never assembled on the user's.
+- **A build ships as a ZFS stream.** Incremental streams carry only the blocks that changed: on FreeBSD, a build with one binary and a file changed was 5.1 MB, against 2.9 GB for the whole system (**seen**). The machine receives it beside the running system and boots into it next time; the running system is never touched (**seen**, on FreeBSD).
+- **Rollback is booting the previous one** (**seen**, on FreeBSD). Old builds are kept as long as wanted, costing only the blocks that differ, and any of them can be picked from the boot menu.
+- **Streams are checked and resumable.** Every block carries its checksum, so a corrupt download isn't booted; `zfs receive -s` resumes an interrupted one. Checksums don't stop tampering, so streams are signed.
+- **Incremental streams need the build they were made from.** The server keeps streams from a few recent builds to the newest, plus a whole one. The system dataset is read-only so a machine's copy never drifts from what was shipped.
+- **The user decides when**: one Rust updater on both, which stages a build, never reboots for the user, and can be turned off.
+- **`/etc` is the open design question, for both.** A new build would replace the machine's users, hostname and networks. Either merge three ways after receiving (as FreeBSD's `etcupdate` does, and bootc did), or keep the machine's state outside the boot environment.
+
+What differs is only the last step:
+
+| | FreeBSD | Ubuntu |
+|---|---|---|
+| Boot loader | FreeBSD's own, reads ZFS | ZFSBootMenu on the ESP |
+| Boot the next build | `bectl activate` | set the pool's `bootfs` |
+| Boot once, then fall back | `bectl activate -t`, built in | ours to add *(check what ZFSBootMenu offers)* |
+| What's in `/etc` to keep | `master.passwd`, `rc.conf`, `wpa_supplicant.conf` | `passwd`, `shadow`, NetworkManager's connections |
+
+### How stable the ground under it is
+
+- **FreeBSD**: 15 is supported to about the end of 2029 *(check)*, with a minor release about every six months. Packages come from the quarterly branch (fixed for three months at a time) or latest. Since 15 the base system is packages too (pkgbase, **seen**: 719 `FreeBSD-*` packages), so one tool builds everything. Boot environments have been in FreeBSD since 12.0 (2018); nothing in the VM needed working around (**seen**).
+- **Ubuntu**: 26.04 LTS has standard support to April 2031. Its kernel moves every six months (HWE), and Canonical builds the ZFS module for every kernel, so the kernel moving doesn't break ZFS. `zfs-dracut` and `zfs-initramfs` (OpenZFS 2.4.1) are in main, so the initramfs can import a ZFS root. Building from Canonical's own `ubuntu` image removes the community bootc base and its workarounds. ZFSBootMenu is a third-party project, though an established one.
+
+## Keeping user software and system software apart
+
+Both run the same app model: apps are folders in `~/Apps`, on the pool, needing nothing from the system but the Patina platform (ADR-0002, ADR-0005). On both, the system dataset is mounted read-only, so not even root's `pkg install` or `apt install` changes it; the only way to change the system is a new build *(not tried)*. Tools a user wants that aren't apps go in their home: `flatpak --user`, distrobox on Ubuntu, cargo and the like.
+
+The separation means the system and apps update independently: a user can hold the system back and still update their apps, or the reverse.
+
+## ZFS
+
+- **FreeBSD**: part of the base system, its installer and its boot loader. `/` and `/home` are datasets out of the box, and boot environments are ZFS itself (**seen**). The licence (CDDL) sits comfortably beside BSD.
+- **Ubuntu**: Canonical builds the module for every kernel and ships the tools and initramfs support (**seen**, for the data pool in the bootc VM). With a ZFS root, the system can't boot without it. Shipping the CDDL module with the GPL kernel is Canonical's call, which the FSF and the Software Freedom Conservancy dispute; a product built on it inherits that question.
+
+Both run OpenZFS, so a pool made with a shared compatibility setting imports on either.
+
+## Laptops
+
+- **Ubuntu**: the best supported. A 7.0 kernel, Wi-Fi and Bluetooth for nearly everything, modern standby (s2idle), Thunderbolt, fingerprint readers, NVIDIA's driver packaged, and a list of certified laptops. New hardware arrives with each six-monthly kernel. nifl, the Patina desktop's own laptop, runs Ubuntu.
+- **FreeBSD**: the weakest, and untested here (the VM ran the desktop nested, with no FreeBSD graphics driver). Graphics come from drm-kmod, ported from Linux and some versions behind it, so the newest Intel and AMD GPUs arrive late. Wi-Fi uses Linux's drivers through LinuxKPI and trails Linux in speed and chips. Bluetooth is limited. Suspend works on many machines with S3, but most new laptops only have modern standby, which FreeBSD is still catching up on. The FreeBSD Foundation has been funding laptop work since 2024 (sleep, Wi-Fi, graphics, with Framework laptops as a target) *(check how far it got by 15.1)*.
+
+## Commercialisation
+
+- **FreeBSD**: the most room. The BSD licence lets a product keep its changes closed and owes no source, which is why Sony, Apple, Netflix and Juniper have built on it. ZFS's CDDL is compatible. Not calling the product FreeBSD avoids its trademark. Consultancies sell FreeBSD support. The limit is the hardware: a laptop OS can only be sold for laptops it runs well on, so commercialising FreeBSD means choosing and certifying a few models.
+- **Ubuntu**: sellable, with duties. The kernel and much of the userland are GPL, so we'd publish the source of what we ship. Canonical's trademark policy means a changed Ubuntu is shipped without Ubuntu's name and branding (Patina OS is its own name already). The packages are Canonical's own archive, which is better footing than the community bootc base was, though Canonical supports Ubuntu, not our way of building and shipping it. Then the ZFS licence question above, sharper with ZFS as the root.
+
+## Ruled out
+
+- **Ubuntu + bootc** (ADR-0001, linux/ today): it worked in the VM, but on a community base, with a newer kernel than the base's, bootc built from source, and an open bug (upgrades that change a large layer fail). bootc can't sit on ZFS well (its composefs backend wants fs-verity, which ZFS lacks), so the system and data stayed on two filesystems. Everything it gave us (building with containers, atomic updates, rollback) the ZFS model gives too.
+- **CentOS Stream 10 + bootc**: bootc's best-tested path and a commercial one (RHEL image mode), but still bootc, with ZFS from a third-party repository and a 6.12 kernel that trails on new laptops.
+- **Fedora + bootc**: its kernels outrun OpenZFS.
+- **Ubuntu on a ZFS root, upgraded with apt in place**: snapshots to roll back to, but the system is assembled package by package on each machine rather than built and shipped whole.
+
+## What would decide it
+
+1. **FreeBSD on real laptops.** If 15.1 runs the Patina desktop on drm-kmod, with Wi-Fi, suspend and resume and battery working, on hardware we'd ship, FreeBSD is the cleaner OS. If not, it's Ubuntu.
+2. **The Ubuntu boot environment in a VM**: Containerfile, written into a dataset, booted by ZFSBootMenu, then an incremental stream from a second build, switched to and rolled back.
+3. **`/etc`**: one design for how a new build keeps the machine's users, hostname and networks, on both.
+4. **A FreeBSD build recipe** on a build machine (`pkg -r` into a new dataset, or a Containerfile on FreeBSD's OCI images), the counterpart of the Containerfile.
diff --git a/docs/notes.md b/docs/notes.md
@@ -2,6 +2,21 @@
Research for Patina OS, and what's still open. Dated, since this moves quickly.
+## Ubuntu with apt, no snaps, ZFS root (2026-10-22)
+
+- ADR-0007: Patina OS is Ubuntu 26.04 with the Patina desktop, no snaps, root and homes on ZFS, a snapshot before every apt run, ZFSBootMenu to boot one. Chosen over the image-based designs for hardware (the laptop's lid, battery and suspend; the workstation's CUDA) and software compatibility; FreeBSD was the simplest system but trails on laptops.
+- To do: the installer (ADR-0008: the system built in CI and received as a ZFS stream onto the whole disk, from a USB stick that is Patina OS itself), the apt hook and its pruning, the Patina desktop as `.deb`s.
+- Check: whether 26.04's own installer offers a ZFS root, and how ZFSBootMenu is best installed on Ubuntu (its release EFI image, or built).
+- The notes below on bootc, ADR-0006's boot environments and FreeBSD are kept as the record.
+
+## No bootc (2026-10-22)
+
+- ADR-0006 rules bootc out: both bases boot ZFS boot environments and update by ZFS streams, so one update model and one updater serve FreeBSD and Ubuntu. docs/comparison.md has the comparison; what's left between them is mostly laptops.
+- The bootc notes below (bases, the kernel, the installer's bootc steps) are kept as the record of what was tried.
+- On Ubuntu: the Containerfile starts from Canonical's `ubuntu` image, adds a kernel and `zfs-dracut` or `zfs-initramfs` (both in 26.04's main, OpenZFS 2.4.1), and its filesystem is written into `patina/ROOT/<build>`; ZFSBootMenu on the ESP boots it. Open: whether ZFSBootMenu can boot a build once and fall back (FreeBSD has `bectl activate -t`).
+- Open, for both: how a new build keeps the machine's `/etc` (users, hostname, networks).
+- Check: FreeBSD's OCI images, which would let FreeBSD's system be built from a Containerfile too.
+
## Ubuntu bootc bases (checked 2026-10-15)
- **bootcrew/ubuntu-bootc** (the Universal Blue people's experiment) is archived since March