commit 1cab7664d492170f27292cd660e5f6d072ed9d4c
parent ccc8a1f8e8aeb5710cfbffaef7a28f402079ce32
Author: Divan Visagie <me@divanv.com>
Date: Fri, 20 Nov 2026 21:08:03 +0100
SeFLOS on Fedora 45 bootc and Btrfs, replacing the Ubuntu bootc image on ZFS
The base is quay.io/fedora/fedora-bootc:45 (pinned by digest), installed onto Btrfs. None of the Ubuntu workarounds are needed: no bootc built from source, no kernel swap, no dpkg state. ZFS is gone, so /home is no longer a pool of its own and there is no zfs-home.sh.
The desktop is laid out by patina-desktop's own packaging/deb/build.py --stage in a Fedora 45 builder (rustup Rust, the workspace's build libraries) and copied into the image; the runtime libraries and programs come from dnf. The base carries what nifl runs (Bluetooth, power profiles, bolt, fwupd, CUPS, fprintd, Tailscale, OpenVPN, Avahi, ModemManager, QEMU, fastfetch, htop) and Yaru icons, with nvme.noacpi=1 as a kernel argument.
The image is named SeFLOS in os-release (ID=seflos, ID_LIKE=fedora).
bootc upgrades need OCI layers: Docker's image store pushes an OCI manifest whose own layers carry Docker's media type, which bootc rejects (Unhandled layer type), and skopeo won't convert that from the registry. vm/build.sh now pushes the image again from Docker's daemon with skopeo --format oci.
ostree's finalize-staged fails when the EFI-partition automount systemd-gpt-auto-generator puts on /boot has idled out (2 minutes), and the staged update is dropped without a word. boot.automount is masked in the image. Staging then rebooting inside the idle window was seen to work; the mask itself is not yet tested on a fresh install.
Not done yet: ADR-0009 and the README and ADR updates (they still describe the Ubuntu and ZFS design), Btrfs snapshots of /home, the NVIDIA driver, the zsh and starship setup, the rename of the repository, image and volume names.
Diffstat:
10 files changed, 132 insertions(+), 261 deletions(-)
diff --git a/linux/.dockerignore b/linux/.dockerignore
@@ -3,5 +3,5 @@
# podman, disk images) never goes to the daemon.
*
!system/
-!build/deb/
+!build/desktop/
!vm/registries.conf
diff --git a/linux/Containerfile b/linux/Containerfile
@@ -1,126 +1,72 @@
-# Patina OS: the Ubuntu 26.04 bootc base with a current kernel, the Patina
-# desktop and what it needs, logged into from GDM. Two images come out of it:
+# Patina OS: Fedora 45's bootc image with the Patina desktop and what it needs,
+# logged into from GDM, on Btrfs (ADR-0009). Two images come out of it:
#
# system the real one
# dev the system plus what the test VM needs: a user to log in as, and
# trust in the development registry (vm/README.md)
#
-# The desktop is built first by desktop/build.sh, as the .deb in build/deb/.
-
-# apt's database as a fresh Ubuntu has it: the base image empties /var, so
-# derived images restore it to use apt (as the base's AGENTS.md describes).
-FROM docker.io/library/ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7 AS dpkg-state
-
-# bootc itself, newer than the base's 1.15.2: with 1.15.2 an upgrade that brings
-# a changed layer fails ("Invalid splitstream content type"), as does
-# installing straight from a registry. Built from source as the base builds
-# its own, with rustup's Rust.
-FROM docker.io/library/ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7 AS bootc
-
-ARG BOOTC_VERSION=v1.17.1
-RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- build-essential ca-certificates curl git go-md2man libostree-dev libzstd-dev \
- make ostree pkgconf libselinux1-dev clang libclang-dev && \
- rm -rf /var/lib/apt/lists/*
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
- sh -s -- --profile minimal -y && \
- git clone --depth 1 --branch "$BOOTC_VERSION" https://github.com/bootc-dev/bootc.git /src && \
- cd /src && . "$HOME/.cargo/env" && \
- make bin install-all DESTDIR=/output
-
-# Tailscale's apt signing key, for its repository (Tailscale isn't in Ubuntu's
-# archive). Fetched over https from Tailscale, as its install instructions do;
-# the system stage keeps only the key file.
-FROM docker.io/library/ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7 AS tailscale-key
-
-RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl && \
- curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/resolute.noarmor.gpg \
- -o /tailscale-archive-keyring.gpg
-
-# ubuntu-bootc's minimal 26.04 base, pinned by digest (docs/notes.md).
-FROM ghcr.io/ubuntu-bootc/ubuntu-26.04-bootc@sha256:d50ac19557f0b5bc56a980178aa68e3675735ad06b3750b4c9af967901e966f4 AS system
-
-COPY --from=dpkg-state /var/lib/dpkg /var/lib/dpkg
-# Before the initramfs is built below: its composefs setup is bootc's too.
-COPY --from=bootc /output /
-
-# The base's kernel (7.0.0-15) has the fs-verity regression that stops a
-# composefs system booting ("Failed to execute /sbin/init: Input/output error",
-# bootc issue 2174, fixed from 7.0.7). Take the archive's current kernel, keep
-# only it, and build its initramfs with the base's dracut settings. Kernel hooks
-# are stubbed by the base, and /boot is emptied: bootc boots from /usr/lib/modules.
-#
-# Then what the desktop needs: GDM to log in, NetworkManager (patina-wifi),
-# PipeWire and WirePlumber (wpctl, for the volume keys), Mesa (EGL, GBM),
-# libinput, libseat, xkb's layouts, fonts, and foot as a terminal. The
-# libraries are what the binaries link or load (see desktop/build.sh). For
-# Files: the desktop portal, whose file chooser it is in the Patina session
-# (GTK's backend answers the rest, as patina-portals.conf says), file types
-# from shared-mime-info, and xdg-open for opening files in their apps.
-#
-# And ZFS's tools, for the pool /home lives on (ADR-0001); the module comes
-# with Ubuntu's kernel. A pool belongs to its machine, so the image holds
-# none, nor a host ID (zfsutils makes one as it installs, which every machine
-# would then share) or a pool cache: the installer makes those
-# (vm/zfs-home.sh stands in for it).
-#
-# And the Patina desktop itself: the .deb patina-desktop's own packaging builds
-# (desktop/build.sh), installed here with apt so its dependencies come with it
-# (no recommends: firefox, one of them, is a snap on Ubuntu). It is what `make
-# install` puts in place: every binary and app, the default apps list, the
-# session entry ("Patina" at the login screen), portal and PAM config. It has
-# to go in before /var is emptied below, while dpkg's database exists.
+# The desktop is built first by desktop/build.sh, into build/desktop/.
+
+# Fedora's own bootc image, pinned by digest: the best-tested base bootc has,
+# with its own kernel, so none of the workarounds the Ubuntu base needed (a
+# newer bootc and kernel, dpkg's state) are here. The digest is Fedora 45 as of
+# 2026-11-20; update it to take a new base.
+FROM quay.io/fedora/fedora-bootc@sha256:813fd13fb01363e76310c5e764ddcba8e275a0259255f49b5717a9925e74b177 AS system
+
+# What the desktop needs: GDM to log in, NetworkManager (patina-wifi), PipeWire
+# and WirePlumber (wpctl, for the volume keys), Mesa (EGL, GBM, Vulkan),
+# libinput, libseat, xkb's layouts, fonts and the icon themes, and foot as a
+# terminal. The libraries are what the binaries link or load: GTK4 and WebKitGTK
+# (the web view), ALSA (dictation and Montage), Vulkan, OpenSSL and the rest.
+# For Files: the desktop portal, whose file chooser it is in the Patina session
+# (GTK's backend answers the rest, as patina-portals.conf says), file types from
+# shared-mime-info, and xdg-open for opening files in their apps. The programs
+# patina-desktop's packaging/bundle.toml lists as required: gsettings (glib2),
+# Xwayland, and ffmpeg (Fedora's, which has the free codecs only).
#
# And what nifl, the ThinkPad X1 Carbon this is meant to run on, needs from the
# base (checked by comparing its installed packages and services): Bluetooth,
# power profiles, Thunderbolt authorisation (bolt), firmware updates (fwupd),
-# printing, the fingerprint service, Tailscale (from its own repository) and
-# OpenVPN, Avahi, ModemManager, sensors, QEMU, and fastfetch. The CPU
-# microcode and linux-firmware go in with the kernel, before the initramfs is
-# built, so the microcode is in it. nifl's drivers are all in Ubuntu's kernel.
-COPY --from=tailscale-key /tailscale-archive-keyring.gpg /usr/share/keyrings/tailscale-archive-keyring.gpg
-COPY build/deb/patina-desktop.deb /tmp/patina-desktop.deb
-RUN mkdir -p /var/cache/apt/archives/partial /var/lib/apt/lists/partial /var/log/apt \
- /var/tmp /var/roothome && \
- echo 'deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu resolute main' \
- > /etc/apt/sources.list.d/tailscale.list && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- dracut linux-image-generic intel-microcode linux-firmware && \
- kver=$(ls /usr/lib/modules | sort -V | tail -1) && \
- for k in /usr/lib/modules/*; do [ "${k##*/}" = "$kver" ] || rm -rf "$k"; done && \
- cp "/boot/vmlinuz-$kver" "/usr/lib/modules/$kver/vmlinuz" && \
- dracut --force --kver "$kver" "/usr/lib/modules/$kver/initramfs.img" && \
- rm -rf /boot/* && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- gdm3 dbus-user-session polkitd \
- network-manager \
- pipewire pipewire-pulse wireplumber \
- libegl1 libegl-mesa0 libgbm1 libgl1-mesa-dri mesa-vulkan-drivers \
- libwayland-server0 libwayland-client0 libwayland-egl1 \
- libinput10 libseat1 libxkbcommon0 xkb-data libpixman-1-0 libdrm2 \
- fonts-dejavu-core fonts-ubuntu hicolor-icon-theme adwaita-icon-theme \
- xdg-user-dirs foot \
- xdg-desktop-portal xdg-desktop-portal-gtk shared-mime-info xdg-utils \
- zfsutils-linux zfs-zed \
- bluez bluez-cups power-profiles-daemon bolt fwupd thermald iio-sensor-proxy \
- cups cups-browsed cups-filters printer-driver-hpcups \
- fprintd libpam-fprintd \
- tailscale openvpn network-manager-openvpn avahi-daemon modemmanager \
- qemu-system-x86 fastfetch \
- /tmp/patina-desktop.deb && \
- rm -f /tmp/patina-desktop.deb /etc/hostid /etc/zfs/zpool.cache && \
- apt-get clean && \
- rm -rf /var && mkdir /var
-
-# Files the system adds to the base, as laid out under system/.
+# thermald, sensors, printing, the fingerprint service, Tailscale, OpenVPN,
+# Avahi, ModemManager, QEMU, and fastfetch. nifl's drivers are all in the
+# kernel. Btrfs's tools are in the base; snapshots of /home come with it later.
+#
+# Not here yet: the NVIDIA driver, which comes from RPM Fusion or NVIDIA's own
+# repository and is built against the image's kernel at build time.
+RUN dnf -y --setopt=install_weak_deps=False install \
+ gdm polkit NetworkManager \
+ pipewire pipewire-pulseaudio wireplumber \
+ mesa-dri-drivers mesa-vulkan-drivers mesa-libEGL mesa-libgbm vulkan-loader \
+ libinput libseat libxkbcommon xkeyboard-config pixman libdrm \
+ gtk4 webkitgtk6.0 alsa-lib openssl-libs fontconfig sqlite-libs libsoup3 pam \
+ dejavu-sans-fonts google-noto-color-emoji-fonts \
+ hicolor-icon-theme adwaita-icon-theme yaru-icon-theme \
+ foot xdg-user-dirs \
+ xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr \
+ shared-mime-info xdg-utils glib2 xorg-x11-server-Xwayland ffmpeg-free \
+ bluez power-profiles-daemon bolt fwupd thermald iio-sensor-proxy \
+ cups cups-browsed cups-filters hplip \
+ fprintd fprintd-pam \
+ tailscale openvpn NetworkManager-openvpn avahi ModemManager \
+ qemu-kvm fastfetch htop microcode_ctl linux-firmware btrfs-progs && \
+ dnf clean all
+
+# The Patina desktop and Files, and "Patina" as GDM's session: laid out under /
+# by desktop/build.sh.
+COPY build/desktop/ /
+
+# Files the system adds to the base, as laid out under system/. Among them,
+# boot.automount is masked (a symlink to /dev/null in /etc/systemd/system):
+# systemd-gpt-auto-generator puts an automount for the EFI partition on /boot,
+# with a 2 minute idle timeout, in front of ostree's /boot bind mount. After it
+# idles out, `ostree admin finalize-staged` fails at shutdown ("Remounting /boot
+# read-write: Invalid argument") and the staged update is dropped without a
+# word: the machine reboots into the old image. Seen on Fedora 45 with bootc
+# 1.17.1 and ostree 2026.4 (upstream: cgwalters-forge/tracker#86, ostree#3664,
+# bootc#2402, fixed in bootc 1.18). Remove the mask when the base carries the fix.
COPY system/ /
RUN systemctl enable gdm.service NetworkManager.service \
- zfs-import-cache.service zfs-mount.service zfs-zed.service \
- zfs-import.target zfs.target \
bluetooth.service power-profiles-daemon.service thermald.service \
cups.socket cups.service cups-browsed.service avahi-daemon.service \
ModemManager.service tailscaled.service fwupd-refresh.timer && \
@@ -136,9 +82,9 @@ FROM system AS dev
# from inside a QEMU VM.
COPY vm/registries.conf /etc/containers/registries.conf.d/50-patina-dev.conf
-# A user to log in as at GDM: patina, password patina, allowed sudo. Its home
-# is made at boot, since /var starts empty.
-RUN useradd -M -d /var/home/patina -s /bin/bash -G sudo patina && \
+# A user to log in as at GDM: patina, password patina, allowed sudo (wheel).
+# Its home is made at boot, since /var starts empty.
+RUN useradd -M -d /var/home/patina -s /bin/bash -G wheel patina && \
echo patina:patina | chpasswd && \
echo 'd /var/home/patina 0700 patina patina -' > /usr/lib/tmpfiles.d/patina-dev-user.conf
diff --git a/linux/desktop/build.sh b/linux/desktop/build.sh
@@ -1,28 +1,28 @@
#!/usr/bin/env bash
-# Builds the Patina desktop .deb for the image: patina-desktop's own
-# packaging/deb/build.py (ADR-0099), run in an Ubuntu 26.04 container. It is
-# `make deb` there, so the image gets what `make install-full` puts in place:
+# Builds the Patina desktop for the image: patina-desktop's own
+# packaging/deb/build.py (ADR-0099) in --stage mode, run in a Fedora 45
+# container. That is what `make install-full` runs there, so the image gets
# every binary, the apps packaging/bundle.toml pins, the default apps list, the
-# session entry, portal and PAM config. The .deb lands in build/deb/ as
-# patina-desktop.deb, which the Containerfile installs with apt, so its
-# dependencies come with it.
+# session entry, portal and PAM config, laid out under /usr. It lands in
+# build/desktop/ as it goes under /, and the Containerfile copies it in; the
+# libraries and programs it needs come from dnf there.
#
# PATINA_DESKTOP is the checkout (default: beside patina-os). It builds the
# checkout's last commit, not its working tree, so stray changes don't ship.
# PATINA_DESKTOP_WORKTREE=1 builds the working tree instead, uncommitted
-# changes and all, to try them in the VM; the package version then says
-# "dirty".
+# changes and all, to try them in the VM.
#
# Needs the network: the apps from other repositories are fetched from GitHub
# at the commits bundle.toml pins, and cargo downloads crates. Cargo's
# downloads and the build's work folder are kept in Docker volumes, so
-# rebuilds are incremental. Build output (target/deb) goes into the checkout,
-# as `make deb` there puts it.
+# rebuilds are incremental. The tree is staged in target/full of the checkout,
+# as `make install-full` there does.
set -euo pipefail
ROOT=$(cd "$(dirname "$0")/.." && pwd)
SRC=$(cd "${PATINA_DESKTOP:-$ROOT/../../patina-desktop}" && pwd)
BUILD="$ROOT/build"
+STAGE="$BUILD/desktop"
BUILDER=patina-os-desktop-builder
say() { printf '==> %s\n' "$*"; }
@@ -32,15 +32,17 @@ say() { printf '==> %s\n' "$*"; }
say "the build environment"
docker build -q -f "$ROOT/desktop/builder.Containerfile" -t "$BUILDER" "$ROOT/desktop" >/dev/null
-say "building the .deb from $(basename "$SRC") $(git -C "$SRC" rev-parse --short HEAD)"
-rm -f "$SRC"/target/deb/*.deb
+commit=$(git -C "$SRC" rev-parse --short HEAD)
+say "building patina-desktop $commit"
+rm -rf "$SRC/target/full"
docker run --rm --user "$(id -u):$(id -g)" \
-e CARGO_HOME=/cargo -e HOME=/tmp -e XDG_CACHE_HOME=/cache \
-v patina-os-cargo:/cargo -v patina-os-cache:/cache \
-v "$SRC:/src" -w /src "$BUILDER" \
- python3 packaging/deb/build.py ${PATINA_DESKTOP_WORKTREE:+--worktree}
+ python3 packaging/deb/build.py --stage target/full --prefix /usr ${PATINA_DESKTOP_WORKTREE:+--worktree}
-deb=$(ls -t "$SRC"/target/deb/patina-desktop_*.deb | head -1)
-rm -rf "$BUILD/deb" && mkdir -p "$BUILD/deb"
-cp "$deb" "$BUILD/deb/patina-desktop.deb"
-say "build/deb/patina-desktop.deb ($(basename "$deb"))"
+rm -rf "$STAGE" && mkdir -p "$STAGE"
+cp -a "$SRC/target/full/." "$STAGE/"
+mkdir -p "$STAGE/usr/lib/patina-os"
+echo "$commit" > "$STAGE/usr/lib/patina-os/desktop"
+say "build/desktop/ ($(find "$STAGE/usr/bin" -type f | wc -l) programs in /usr/bin, from $commit)"
diff --git a/linux/desktop/builder.Containerfile b/linux/desktop/builder.Containerfile
@@ -1,27 +1,25 @@
-# The Patina desktop's build environment: Ubuntu 26.04, as the image is, with
+# The Patina desktop's build environment: Fedora 45, as the image is, with
# rustup's Rust and what patina-desktop's `make deps` lists, plus what its
-# packaging/deb/build.py needs to make the .deb (python3, dpkg-dev, binutils,
-# make, git). desktop/build.sh runs build.py in it, and the image installs the
-# .deb, so the image gets exactly what `make install` puts in place: every
+# packaging/deb/build.py needs to lay the bundle out (python3, make, git).
+# desktop/build.sh runs `build.py --stage` in it and the image copies the tree
+# in, so the image gets exactly what `make install-full` puts in place: every
# binary and app, the default apps list, session entry, portal and PAM config.
+# Pinned by digest, as the image's base is.
#
-# Rust comes from rustup, not the archive: patina-desktop's lockfile needs newer
-# Rust than the archive has (26.04's 1.93.1 can't build sysinfo 0.39, which
-# needs 1.95). Pinned, so builds repeat; raise RUST_VERSION when the lockfile
-# asks for more.
-FROM docker.io/library/ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7
+# Rust comes from rustup, pinned, so builds repeat: patina-desktop's lockfile
+# needs 1.95. Raise RUST_VERSION when the lockfile asks for more.
+FROM quay.io/fedora/fedora@sha256:f236063d5a7a15e76ff034f2be5fa6f7a8922fcb655093ad972a1f196b14a007
ARG RUST_VERSION=1.95.0
-RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- ca-certificates curl git make gcc libc6-dev pkg-config python3 dpkg-dev binutils \
- cmake clang glslc \
- libxkbcommon-dev libpixman-1-dev libudev-dev libinput-dev libseat-dev \
- libgbm-dev libegl-dev libdrm-dev libwayland-dev libpam0g-dev \
- libasound2-dev libvulkan-dev libwebkitgtk-6.0-dev \
- libssl-dev libfontconfig-dev libsqlite3-dev libsoup-3.0-dev libclang-dev && \
- rm -rf /var/lib/apt/lists/*
+RUN dnf -y --setopt=install_weak_deps=False install \
+ ca-certificates curl git make gcc gcc-c++ pkgconf-pkg-config python3 binutils \
+ cmake clang clang-devel glslc \
+ libxkbcommon-devel pixman-devel systemd-devel libinput-devel libseat-devel \
+ mesa-libgbm-devel mesa-libEGL-devel libdrm-devel wayland-devel pam-devel \
+ alsa-lib-devel vulkan-loader-devel vulkan-headers webkitgtk6.0-devel \
+ openssl-devel fontconfig-devel sqlite-devel libsoup3-devel && \
+ dnf clean all
# System-wide, so the build can run as an ordinary user (build.sh gives it its
# own CARGO_HOME and cache folders as volumes; the toolchain stays here).
@@ -32,7 +30,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
--default-toolchain "$RUST_VERSION" --no-modify-path && \
chmod -R a+rX /usr/local/rustup /usr/local/cargo
-# Mount points for the volumes build.sh attaches (cargo's downloads, the .deb
-# build's work folder). A new volume takes its owner and mode from here, and
-# the build is not root.
+# Mount points for the volumes build.sh attaches (cargo's downloads, the
+# bundle build's work folder). A new volume takes its owner and mode from here,
+# and the build is not root.
RUN mkdir -m 1777 /cargo /cache
diff --git a/linux/system/etc/NetworkManager/conf.d/10-globally-managed-devices.conf b/linux/system/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
@@ -1,4 +0,0 @@
-# Ubuntu's NetworkManager leaves wired interfaces to netplan, which this
-# system doesn't have; this empty file in /etc masks the package's
-# /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf, so
-# NetworkManager manages every interface itself.
diff --git a/linux/system/etc/systemd/system/boot.automount b/linux/system/etc/systemd/system/boot.automount
@@ -0,0 +1 @@
+/dev/null
+\ No newline at end of file
diff --git a/linux/system/usr/lib/os-release b/linux/system/usr/lib/os-release
@@ -0,0 +1,10 @@
+NAME="SeFLOS"
+VERSION="45"
+ID=seflos
+ID_LIKE=fedora
+VERSION_ID=45
+PRETTY_NAME="SeFLOS 45"
+ANSI_COLOR="0;38;2;60;110;180"
+DEFAULT_HOSTNAME="seflos"
+HOME_URL="https://sectorflabs.com/"
+BUG_REPORT_URL="https://github.com/Sector-F-Labs"
diff --git a/linux/vm/build.sh b/linux/vm/build.sh
@@ -12,3 +12,15 @@ docker build -f "$ROOT/Containerfile" --target dev \
--build-arg BUILD_ID="$build_id" -t "$IMAGE" "$ROOT"
say "pushing $IMAGE"
docker push -q "$IMAGE"
+
+# Docker pushes an OCI manifest whose layers it built carry Docker's media type
+# (application/vnd.docker.image.rootfs.diff.tar.gzip), and bootc can't read
+# those when it upgrades ("Unhandled layer type"). skopeo won't convert that
+# mixed manifest from the registry, so it reads the image from Docker's own
+# daemon instead, where it is a plain image, and pushes it again as OCI (all of
+# its layers recompressed and uploaded: a few minutes). skopeo is the image's
+# own.
+say "pushing $IMAGE again with OCI layers"
+docker run --rm --network host -v /var/run/docker.sock:/var/run/docker.sock "$IMAGE" \
+ skopeo copy --format oci --dest-tls-verify=false \
+ "docker-daemon:$IMAGE" "docker://$IMAGE" >/dev/null
diff --git a/linux/vm/disk.sh b/linux/vm/disk.sh
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# Installs the image onto a fresh disk file, out/disk.raw, the way it would go
# onto a real disk: the image runs its own `bootc install to-disk` through a loop
-# device. The installed system follows the development registry, so `bootc
-# upgrade` in the VM fetches what vm/build.sh pushed. Also makes the SSH key and
-# the empty second disk for ZFS.
+# device, onto Btrfs (ADR-0009). The installed system follows the development
+# registry, so `bootc upgrade` in the VM fetches what vm/build.sh pushed. Also
+# makes the SSH key, which root's authorized_keys gets.
source "$(dirname "$0")/common.sh"
vm_running && die "the VM is running; vm/vm.sh stop first"
@@ -16,10 +16,9 @@ say "installing $IMAGE onto $DISK"
rm -f "$DISK" "$OVMF_VARS"
truncate -s "$DISK_SIZE" "$DISK"
# Privileged with the host's /dev, for the loop device. bootc installs from
-# podman's storage, normally the host's; there's no podman here, so the image's
-# own podman pulls it from the registry into a storage folder of its own first
-# (bootc's composefs backend can't read it straight from the registry). The
-# target is the same image as the VM will see it.
+# podman's storage, normally the host's; there's no podman on the host here, so
+# the image's own podman pulls it from the registry into a storage folder of its
+# own first. The target is the same image as the VM will see it.
mkdir -p "$OUT/containers"
docker run --rm --privileged --network host \
-v /dev:/dev -v "$OUT:/data" -v "$OUT/containers:/var/lib/containers" \
@@ -29,46 +28,13 @@ docker run --rm --privileged --network host \
bootc install to-disk \
--via-loopback /data/disk.raw \
--wipe \
- --filesystem ext4 \
- --composefs-backend \
- --bootloader systemd \
+ --filesystem btrfs \
+ --root-ssh-authorized-keys /data/id_ed25519.pub \
--source-imgref "containers-storage:$1" \
--target-imgref "$2" \
--karg console=tty0 \
- --karg console=ttyS0,115200 \
- --karg systemd.firstboot=no
+ --karg console=ttyS0,115200
' install "$IMAGE" "$VM_IMAGE"
-# systemd 259 on 26.04 doesn't always find the root partition by itself; name it
-# in the boot entries, as ubuntu-bootc's own CI does. And let root in by the SSH
-# key: bootc's --root-ssh-authorized-keys leaves /root/.ssh empty with the
-# composefs backend, so the key goes straight into the installed /var.
-say "naming the root partition, adding the SSH key"
-docker run --rm --privileged -v /dev:/dev -v "$OUT:/data" "$IMAGE" bash -euc '
- loop=$(losetup -f --show --partscan /data/disk.raw)
- trap "losetup -d $loop" EXIT
- udevadm settle 2>/dev/null || sleep 1
- for p in ${loop}p*; do
- case $(blkid -s TYPE -o value "$p") in
- ext4|xfs) root=$p ;;
- vfat) esp=$p ;;
- esac
- done
- uuid=$(blkid -s UUID -o value "$root")
- type=$(blkid -s TYPE -o value "$root")
- mnt=$(mktemp -d) && mount "$esp" "$mnt"
- for conf in "$mnt"/loader/entries/*.conf; do
- grep -q "^options.*root=" "$conf" ||
- sed -i "s|^options |options root=UUID=$uuid rootfstype=$type |" "$conf"
- grep "^options" "$conf"
- done
- umount "$mnt"
- mount "$root" "$mnt"
- ssh=$mnt/state/os/default/var/roothome/.ssh
- install -d -m 700 "$ssh"
- install -m 600 /data/id_ed25519.pub "$ssh/authorized_keys"
- umount "$mnt"
-'
-
[[ -f "$DATA" ]] || qemu-img create -q -f qcow2 "$DATA" "$DATA_SIZE"
say "done: vm/vm.sh start"
diff --git a/linux/vm/zfs-home.sh b/linux/vm/zfs-home.sh
@@ -1,61 +0,0 @@
-#!/usr/bin/env bash
-# Puts /home on ZFS in the running VM, as the Patina installer will on a real
-# machine (ADR-0001); this stands in for it until there is one. On the VM's
-# second disk:
-#
-# - a host ID for the machine (/etc/hostid), which the pool is tied to;
-# - the pool, "patina", recorded in /etc/zfs/zpool.cache so it's imported at
-# boot (the image enables zfs-import-cache and zfs-mount);
-# - patina/home, mounted at /var/home (/home links there on a bootc system),
-# and a dataset of its own for each user's home, so each can be
-# snapshotted and sent alone. The homes there already are moved in.
-#
-# Both files are in /etc, which belongs to the machine and survives updates and
-# rollbacks; the pool is outside the image entirely. Run it once; a second run
-# does nothing.
-source "$(dirname "$0")/common.sh"
-
-vm_running || die "not running; vm/vm.sh start"
-vm_ssh bash -s <<'EOF'
-set -euo pipefail
-pool=patina
-disk=/dev/disk/by-id/virtio-patina-data
-
-if zpool list "$pool" >/dev/null 2>&1; then
- echo "the pool is there already:"
- zfs list -r "$pool"
- exit 0
-fi
-
-[ -s /etc/hostid ] || zgenhostid
-
-# 4K sectors whatever the disk says; zstd; no access times; extended
-# attributes and ACLs as Linux keeps them; the pool itself isn't mounted.
-zpool create -f -o ashift=12 -o cachefile=/etc/zfs/zpool.cache \
- -O compression=zstd -O atime=off -O xattr=sa -O acltype=posixacl \
- -O dnodesize=auto -O normalization=formD \
- -O mountpoint=none -O canmount=off \
- "$pool" "$disk"
-
-# Nobody may be using /var/home while it moves.
-systemctl stop gdm.service
-mv /var/home /var/home.old
-mkdir /var/home
-zfs create -o mountpoint=/var/home "$pool/home"
-for old in /var/home.old/*; do
- [ -d "$old" ] || continue
- user=${old##*/}
- zfs create "$pool/home/$user"
- cp -a "$old/." "/var/home/$user/"
- chown --reference="$old" "/var/home/$user"
- chmod --reference="$old" "/var/home/$user"
-done
-rm -rf /var/home.old
-
-zfs list -r "$pool"
-EOF
-say "rebooting, to check the pool comes back by itself"
-vm_ssh systemctl reboot || true
-sleep 5
-"$ROOT/vm/vm.sh" wait
-vm_ssh 'findmnt -t zfs -o TARGET,SOURCE; zpool status -x'