sector-f-linux

Sector F Linux
git clone https://git.sectorflabs.com/sector-f-linux.git
Log | Files | Refs | README | LICENSE

commit 3d1ef872c5ac7bcd559f3d0f38fdcc19388eacf7
parent 713e6c57ecb3da45e8e07cf2b6d36c60a4adeb8e
Author: Divan Visagie <me@divanv.com>
Date:   Sat, 28 Nov 2026 16:40:17 +0100

remove the FreeBSD experiment: the base is Fedora bootc, so its folder and README entry go (the ADRs keep the record)

Diffstat:
M.gitignore | 2--
MREADME.md | 3+--
Mdocs/comparison.md | 2+-
Dfreebsd/README.md | 55-------------------------------------------------------
Dfreebsd/bsdt.toml | 35-----------------------------------
Dfreebsd/hardware.md | 199-------------------------------------------------------------------------------
Dfreebsd/hardware/profile.sh | 15---------------
Dfreebsd/hardware/setup.sh | 119-------------------------------------------------------------------------------
Dfreebsd/hardware/start-patina | 12------------
Dfreebsd/stage.sh | 28----------------------------
10 files changed, 2 insertions(+), 468 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -25,6 +25,4 @@ id_rsa .idea/ .vscode/ -# What freebsd/stage.sh copies in for the VM to build. -/freebsd/src/ /greeter/target-fedora/ diff --git a/README.md b/README.md @@ -2,9 +2,8 @@ Sector F Linux is Fedora's bootc image with the Patina desktop, on Btrfs: the system is built once from a Containerfile, shipped whole as an image, updated by moving to the next one and rolled back by booting the previous one (ADR-0009). One OS for the laptop and the workstation, with Fedora's current kernel and packages. It was called Patina OS until that name turned out to be taken; the desktop is still Patina, and the repository, image and volume names still say `patina-os` until a rename pass. -It started as an experiment to find which base makes the least complicated image-based OS for the Patina desktop, kept apart from the user's software. Three bases were tried, and the first two are kept as the record: +It started as an experiment to find which base makes the least complicated image-based OS for the Patina desktop, kept apart from the user's software. Ubuntu was tried first, and kept as the record in the ADRs (so was FreeBSD, whose folder is gone): -- [**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. - Ubuntu 26.04: first as a bootc image with `/home` on ZFS (ADR-0001), then as plain Ubuntu on a ZFS root (ADR-0007). The bootc image's upgrades failed on a young, community-held base (ADR-0006, ADR-0009). - [**linux/**](linux/): Fedora 45's bootc image on Btrfs ([linux/vm/README.md](linux/vm/README.md)), which is what this is now. Dropping ZFS removed the reason Fedora had been ruled out: its kernels outrunning OpenZFS. diff --git a/docs/comparison.md b/docs/comparison.md @@ -8,7 +8,7 @@ How the bases for Patina OS compare on what matters to the product: keeping the Before that decision, two remained (ADR-0006): -- **FreeBSD** ([freebsd/](../freebsd/)): FreeBSD 15.1 on a ZFS root. Tried in a VM. +- **FreeBSD** (its folder has since been removed): 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. diff --git a/freebsd/README.md b/freebsd/README.md @@ -1,55 +0,0 @@ -# Patina OS on FreeBSD - -An experiment: is FreeBSD a simpler base for Patina OS than Ubuntu with bootc (`../linux`)? -FreeBSD has most of what bootc adds to Linux built in, on ZFS: - -| Patina OS needs | Ubuntu (linux/) | FreeBSD | -|---|---|---| -| The system as one unit, booted whole | a bootc image on composefs | a boot environment: a ZFS dataset for `/`, `bectl` | -| Update atomically | `bootc upgrade`, the next image at the next boot | a new boot environment, upgraded, activated for the next boot | -| Roll back | `bootc rollback` | `bectl activate` the previous one, or pick it at the loader | -| Ship a build | an OCI image in a registry | `zfs send` of a built boot environment, `zfs receive` on the machine | -| `/home` on ZFS | zfsutils from Ubuntu's archive, a pool made per machine | `zroot/home`, part of every ZFS install | -| Build the system | a Containerfile, apt, bootc compiled newer than the base's | pkg (and pkgbase on 15) into a boot environment | - -What the VM can't show: QEMU's graphics have no FreeBSD driver, so the desktop runs nested on a -headless sway over VNC, not as a session on real graphics (drm-kmod on hardware). - -## Running it - -``` -freebsd/stage.sh copy patina-desktop's last commit into freebsd/src/ -cd freebsd && bsdt up boot it (the first time: FreeBSD's ZFS image, packages, the build) -bsdt ssh a shell in it -bsdt key super+shift+3 a screenshot, with Patina's own key, into the VM's ~/Pictures/Screenshots -``` - -## What it found (2026-10-16) - -Everything in the table worked the first time, with FreeBSD's own tools and nothing built or -worked around: - -- **The layout is already Patina's.** FreeBSD's ZFS image has `/` as a boot environment - (`zroot/ROOT/default`) and `zroot/home` as its own dataset. `/usr/local`, where packages and - Patina go, is inside the boot environment, so it's part of the system; `/home`, `/var/log` - and `/tmp` are outside it. -- **pkgbase.** 15.1's base system is installed as packages (`FreeBSD-*`, 719 of them), so the - whole system, base and packages, is updated with `pkg`, including into a boot environment - that isn't running (`pkg -r /mnt`). -- **The desktop builds and runs.** patina-desktop built in 4 minutes from FreeBSD's packages and - runs nested on the headless sway. -- **Atomic update.** `bectl create`, change the copy (`bectl mount`, `pkg -r`), `bectl activate`, - reboot: the new system came up whole; the running one was never touched. -- **Rollback.** `bectl activate` the previous one and reboot: back to the first build, with - Patina still installed. -- **Shipping a build.** `bectl export` wrote the whole system as a ZFS stream, 2.9 GB with zstd, - in 15 seconds; `bectl import` took it in as a new boot environment that booted. An - incremental stream (one binary and a file changed) was 5.1 MB, so a machine that has the last - build receives only what changed, as a registry's layers would give. -- **/home stayed put** through every switch: a file written there was the same in every boot - environment. - -The desktop on real graphics (drm-kmod, seatd) is in [hardware.md](hardware.md). - -Not tried here: a login screen, and building a boot -environment from a recipe on a build machine rather than by hand in the VM. diff --git a/freebsd/bsdt.toml b/freebsd/bsdt.toml @@ -1,35 +0,0 @@ -# Patina OS on FreeBSD: a bsdt(1) VM to see whether FreeBSD makes a simpler -# base than Ubuntu with bootc (README.md). FreeBSD 15.1 on a ZFS root, so boot -# environments (bectl) and /home as a dataset come with the system. -# -# freebsd/stage.sh copy patina-desktop's and patina-launcher's last commits into src/ -# bsdt up from freebsd/: boot it, build the desktop on first boot -# -# QEMU's graphics have no FreeBSD driver, so the desktop runs nested: the -# compositor in a window on a headless sway, shown over VNC. - -[vm] -os = "freebsd" -version = "15.1" -cpus = 4 -memory = "4G" -disk = "30G" -filesystem = "zfs" -hostname = "patina" -gui = true - -[packages] -# What patina-desktop builds against (its `make deps`), and Rust. -install = ["rust", "git", "pkgconf", "libxkbcommon", "pixman", "libudev-devd", "libinput", - "seatd", "mesa-libs", "libdrm", "wayland"] - -[sync] -exclude = ["src/patina-desktop/target"] - -[provision] -run = ["cd src/patina-desktop && cargo build --release"] - -[gui] -desktop = "sway" -open = false -start = "exec src/patina-desktop/target/release/patina-compositor" diff --git a/freebsd/hardware.md b/freebsd/hardware.md @@ -1,199 +0,0 @@ -# Patina desktop on FreeBSD hardware - -The VM in `README.md` runs the desktop nested, because QEMU's graphics have no FreeBSD driver. -This is the other half: a real machine, with the desktop as the session on its own display. - -Done on 2026-10-29 on `loki`, a ThinkPad (11th Gen i5-1135G7, Intel Iris Xe, 16 GB) with a fresh -FreeBSD 15.1-RELEASE on a ZFS root (`zroot/ROOT/default`, `zroot/home`), over ssh. Every command -below is as the normal user with `doas`. - -To do all of it from scratch, from this repository, and again whenever the desktop changes: - -``` -freebsd/hardware/setup.sh loki # PATINA_GPU=, PATINA_SCALE= (default 1.2) choose firmware and scale -``` - -It is safe to run twice; the steps below are what it does. It also installs Teleprinter -(the terminal), from its checkout beside this repository, and Files, which is in patina-desktop, with their launcher -entries and Files' file chooser portal, and the portal packages. `PATINA_WORKTREE=1` sends the -checkouts' working trees instead of their last commits. - -## 0. A way back - -``` -doas bectl create pre-wayland -``` - -A boot environment of the system before any change. If the graphics driver ever stops the -machine booting, pick `pre-wayland` at the loader's boot-environment menu, or `bectl activate -pre-wayland` from a rescue shell. `/home` is shared by all of them, so nothing there is lost. - -## 1. Preparing for Wayland - -FreeBSD has no KMS driver in the base system; the DRM drivers are ports of Linux's, built as -kernel modules against the exact release (`drm-kmod`). With them in place, what a Wayland -compositor needs is a DRM device, a way to open it and the input devices without root (seatd, in -place of systemd-logind), libinput, Mesa and a runtime directory. - -``` -doas pkg install drm-kmod gpu-firmware-intel-kmod-tigerlake \ - mesa-dri mesa-libs libdrm seatd libinput libudev-devd evdev-proto \ - libxkbcommon pixman wayland wayland-protocols xwayland pkgconf \ - dbus dejavu noto-basic foot grim -``` - -- `drm-kmod` is the metaport; on 15.1 it brings `drm-612-kmod` (Linux 6.12's drivers). -- The firmware package is per GPU generation: `pciconf -lv | grep -A3 vga` says which (Tiger - Lake here; the others are `gpu-firmware-intel-kmod-*`, or `gpu-firmware-amd-kmod-*` for AMD). -- `libudev-devd` and `evdev-proto` are how libinput finds the keyboard and touchpad on FreeBSD, - which has no udev. -- Fonts: a new install has none, and without them foot and anything else with text fails - (`failed to match font`). The desktop's own pieces carry their font. - -Then configure it, and load the driver without rebooting to see it work: - -``` -doas sysrc kld_list+="i915kms" # amdgpu for AMD -doas sysrc seatd_enable=YES -doas sysrc dbus_enable=YES -doas pw groupmod video -m $USER # seatd's socket is root:video, 0770 -doas service seatd start -doas service dbus start -doas kldload i915kms -``` - -After `kldload`, `/dev/dri/card0` and `renderD128` exist, `dmesg` says `[drm] Initialized i915` -and the console switches from `efifb` to `drmfb`. Over ssh that call can hang for a while as -the console changes; the machine is fine, reconnect. Log out and in again for the `video` group. - -Not needed here: a `devfs.rules` for `/dev/dri` or `/dev/input`. seatd opens them as root and -hands them to the compositor, which is the point of it. - -## 2. Building the desktop - -``` -doas pkg install git rust cmake-core llvm shaderc vulkan-headers vulkan-loader \ - alsa-lib alsa-plugins -``` - -This is `make deps`' FreeBSD line, except that cmake's package is `cmake-core`, not `cmake`. - -patina-desktop is on a private remote, which the machine has no key for, so it's sent from a -checkout over ssh (the same last commit `stage.sh` copies into the VM). Its dependencies -(patina, patina-apps, the Smithay fork) are public GitHub repositories and cargo -fetches them itself. - -``` -# on the machine -mkdir -p ~/src/patina-desktop - -# on the one with the checkout, from the folder holding it -git -C patina-desktop archive HEAD | ssh loki "tar -x -C ~/src/patina-desktop" - -# on the machine -cd ~/src/patina-desktop && cargo build --release # 11.5 minutes on 8 cores, the launcher too -``` - -## 3. Installing it - -`make install` is for Linux (it writes a GDM session and PAM file), -so on FreeBSD the programs and their man pages are copied directly: - -``` -cd ~/src/patina-desktop -doas install -m 755 $(find target/release -maxdepth 1 -type f -perm -u+x -name 'patina-*') \ - /usr/local/bin/ -doas install -m 644 man/*.1 /usr/local/share/man/man1/ -doas install -m 644 man/*.7 /usr/local/share/man/man7/ -``` - -and, from this repository, the start script: - -``` -scp freebsd/hardware/start-patina loki:/tmp/ -ssh loki doas install -m 755 /tmp/start-patina /usr/local/bin/start-patina -``` - -`hardware/start-patina` is what a console login runs. FreeBSD has no logind to make -`XDG_RUNTIME_DIR` and no session bus, and the desktop needs both, so it makes -`/tmp/xdg-<uid>` and starts the session inside `dbus-run-session`. - -## 4. Running it - -Log in at the text console and run: - -``` -start-patina -``` - -First start on `loki`: - -``` -patina-compositor: on eDP-1 at 1920x1200, scale 1.5 -patina-compositor: clients connect on WAYLAND_DISPLAY=wayland-1 -patina-compositor: X11 apps connect on DISPLAY=:0 -``` - -The scale is set to 1.2 in `~/.config/patina-compositor/config.toml` (`setup.sh` does it). The wallpaper, the bar, the clock and the power button came up on the panel, at its own -resolution with scale 1.5 chosen from its density; `foot` opened as a window with its tab in the -bar. It was started over ssh during setup (`XDG_RUNTIME_DIR=/tmp/xdg-1001 dbus-run-session -patina-session --session`), not from the console. A screenshot from the machine itself: -`XDG_RUNTIME_DIR=/tmp/xdg-1001 WAYLAND_DISPLAY=wayland-1 grim shot.png`. - -Ctrl+Alt+Backspace quits the compositor, the way out; Ctrl+Alt+Shift+Backspace restarts it. - -## On the tailnet - -Joined the way the registry host was (the infrastructure repo's tailscale setup), to headscale on the headscale server: - -``` -doas pkg install tailscale -doas sysrc tailscaled_enable=YES -doas service tailscaled start -doas tailscale up --login-server=https://headscale.example.com # prints a register URL -# on the headscale server, at once (the key expires in minutes): -doas headscale --config /etc/headscale/config.yaml auth register --auth-id hskey-authreq-... --user USER -``` - -It registers under the machine's hostname, `loki`, as 100.64.0.3. Don't pass `--hostname`: the -name should be the machine's own, as the others are. (The earlier `loki`, the Home Assistant host -retired on 2026-10-07, had the same name and address; its node was deleted, so a stale -`known_hosts` entry for `loki` fails with a changed host key: `ssh-keygen -R loki`.) - -## Things that were wrong, and what fixed them - -| Symptom | Cause | Fix | -|---|---|---| -| Settings (and every egui app) has a window and a bar tab but draws nothing | eframe's wgpu draws nothing through Mesa's Vulkan on this machine (`Failed to create surface for any enabled backend`) | `WGPU_BACKEND=gl`, set by `start-patina` for everything it starts | -| Locked out: the lock screen never accepts the password | `patina-lock` checks it through a PAM service, `patina-lock`, which Linux's `make install` writes and this setup doesn't; and a non-root program can't check a password against FreeBSD's `master.passwd` anyway | `[lock] command = ""` and the two other lock settings off in `~/.config/patina-compositor/config.toml`, which `setup.sh` does. To get out of a lock already on: remove `/tmp/xdg-<uid>/*.locked` (the compositor starts locked while it's there) and restart the session | -| No battery in the bar | patina-system read `/sys/class/power_supply` | the battery from `sysctl hw.acpi.battery.*` and `acpiconf` (patina-desktop ADR-0095) | -| Wi-Fi menu can't open | patina-system talked to NetworkManager | wpa_supplicant through `wpa_cli` (ADR-0095); `update_config=1` in `/etc/wpa_supplicant.conf` so joined networks are saved, which `setup.sh` adds | -| Teleprinter and Files had no launcher entry or icon | they come from each project's `make install`, which uses `install -D` | `setup.sh` installs the entries and icons itself | -| `Failed to connect to ... /bus` | no session bus | `dbus-run-session`, in `start-patina` | -| foot: `failed to match font` | a new install has no fonts | `dejavu`, `noto-basic` | - -## What it still prints, and what it means - -| Message | Meaning | -|---|---| -| `logind Inhibit: ... login1 was not provided` | no logind on FreeBSD: it can't hold off suspend while a window plays; harmless | -| `patina-dictate: no model at ...ggml-base.en.bin` | dictation's speech model isn't downloaded (the URL is in the message) | -| foot: `compositor does not implement the primary selection interface` etc. | protocols the compositor doesn't offer yet; foot works without | - -## Not done, not tested - -- **A login screen.** `start-patina` from a console login is all there is. greetd with a Patina - entry is the next thing; `patina.desktop` and the PAM file (`make install`) are Linux's. -- **The lock screen.** Off, as above. Wanted: a `patina-lock` PAM service for FreeBSD that works - for a user's own password, or a locker that's allowed to read it. -- **Volume, brightness and power menus.** Volume goes through `wpctl` (PipeWire's WirePlumber, - not installed) and brightness through `/sys/class/backlight`; FreeBSD has `mixer(8)` and - `backlight(8)`. Each wants an implementation behind a trait, as the battery and Wi-Fi have. -- **Wi-Fi off and on** runs `doas -n ifconfig wlan0 down|up`, which works here (doas without a - password) and nowhere else. -- **The battery's history graphs** (from UPower) and charging time (ACPI doesn't say). -- **Sleep and locking before it, `patina-dictate`'s model, Xwayland apps, screen recording.** -- **Keyboard and touchpad on the machine itself, and `start-patina` from the console.** The - session has been started over ssh. -- **Putting this in a boot environment recipe**, so it's part of the system that's shipped - rather than done by hand on one machine (`README.md`'s last paragraph). diff --git a/freebsd/hardware/profile.sh b/freebsd/hardware/profile.sh @@ -1,15 +0,0 @@ - -# >>> patina desktop (freebsd/hardware/setup.sh) >>> -# What patina-session needs, which it takes from here (it runs `sh -l`): the -# runtime dir FreeBSD has no logind to make, GL for egui's renderer (wgpu's -# Vulkan draws nothing through Mesa here), and a session bus, started once per -# console login and not for ssh. -XDG_RUNTIME_DIR=/tmp/xdg-$(id -u) -export XDG_RUNTIME_DIR -mkdir -p -m 700 "$XDG_RUNTIME_DIR" -WGPU_BACKEND=gl -export WGPU_BACKEND -if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && [ -z "$SSH_CONNECTION" ] && command -v dbus-launch >/dev/null; then - eval "$(dbus-launch --sh-syntax)" -fi -# <<< patina desktop <<< diff --git a/freebsd/hardware/setup.sh b/freebsd/hardware/setup.sh @@ -1,119 +0,0 @@ -#!/usr/bin/env bash -# Sets up the Patina desktop on a fresh FreeBSD 15 machine with an Intel GPU, from -# this one, over ssh; hardware.md says what each step is and why. Safe to run again: -# packages, rc.conf, the group and the install are checked or replaced, and cargo -# rebuilds only what changed. -# -# hardware/setup.sh [user@]host -# -# The host needs ssh and doas without a password for the user. It installs the -# desktop (with its launcher and Files) and Teleprinter (the terminal), from their checkouts -# beside patina-os (PATINA_DESKTOP, PATINA_TELEPRINTER -# override where); PATINA_GPU is the firmware's generation (default: -# tigerlake), PATINA_SCALE the screen's scale (default: 1.2). PATINA_WORKTREE=1 sends -# the checkouts' working trees, uncommitted changes and all, instead of their last commits. -set -euo pipefail - -HOST=${1:?usage: setup.sh [user@]host} -HERE=$(cd "$(dirname "$0")" && pwd) -DESKTOP=${PATINA_DESKTOP:-$HERE/../../../patina-desktop} -TELEPRINTER=${PATINA_TELEPRINTER:-$HERE/../../../teleprinter} -GPU=${PATINA_GPU:-tigerlake} -SCALE=${PATINA_SCALE:-1.2} - -run() { ssh "$HOST" "$@"; } - -echo "==> a way back: boot environment pre-wayland" -run 'bectl list -H | cut -f1 | grep -qx pre-wayland || doas bectl create pre-wayland' - -echo "==> packages" -run "doas pkg install -y drm-kmod gpu-firmware-intel-kmod-$GPU mesa-dri mesa-libs libdrm seatd \ - libinput libudev-devd evdev-proto libxkbcommon pixman wayland wayland-protocols xwayland \ - pkgconf dbus xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils \ - desktop-file-utils shared-mime-info gvfs dejavu noto-basic foot grim git rust cmake-core llvm shaderc vulkan-headers \ - vulkan-loader alsa-lib alsa-plugins" - -echo "==> rc.conf, the video group, services" -run 'doas sysrc kld_list+=i915kms seatd_enable=YES dbus_enable=YES >/dev/null - doas pw groupmod video -m "$(id -un)" - doas service seatd start || true - doas service dbus start || true' - -echo "==> source" -ship() { # name checkout - [[ -d $2/.git ]] || { echo "error: no checkout at $2" >&2; exit 1; } - # Replace the sources, keep target/ so the build is incremental. - run "mkdir -p ~/src/$1 && find ~/src/$1 -mindepth 1 -maxdepth 1 ! -name target -exec rm -rf {} +" - if [[ -n ${PATINA_WORKTREE:-} ]]; then - git -C "$2" ls-files -z --cached --others --exclude-standard | tar -c -C "$2" --null -T - | run "tar -x -C ~/src/$1" - echo " $1 working tree (on $(git -C "$2" rev-parse --short HEAD))" - else - git -C "$2" archive HEAD | run "tar -x -C ~/src/$1" - echo " $1 $(git -C "$2" rev-parse --short HEAD)" - fi -} -ship patina-desktop "$DESKTOP" -ship teleprinter "$TELEPRINTER" - -echo "==> build" -for p in patina-desktop teleprinter; do - run "cd ~/src/$p && cargo build --release" -done - -echo "==> install" -run 'cd ~/src/patina-desktop && - doas install -m 755 $(find target/release -maxdepth 1 -type f -perm -u+x -name "patina-*") \ - ../teleprinter/target/release/teleprinter \ - target/release/files /usr/local/bin/ && - doas install -m 644 man/*.1 /usr/local/share/man/man1/ && - doas install -m 644 man/*.7 /usr/local/share/man/man7/' -scp -q "$HERE/start-patina" "$HOST:/tmp/start-patina" -run 'doas install -m 755 /tmp/start-patina /usr/local/bin/start-patina' - -# What each project'"'"'s make install puts beside the program: icons, launcher entries -# (Exec made absolute), the file chooser portal, Patina'"'"'s portal choices. -run 'P=/usr/local S=/usr/local/share ICONS=/usr/local/share/icons/hicolor/scalable/apps - doas install -d $ICONS $S/applications $S/dbus-1/services $S/xdg-desktop-portal/portals \ - $P/etc/xdg/xdg-desktop-portal $P/etc/xdg/xdg-desktop-portal-wlr - cd ~/src/patina-desktop - for f in settings processes; do - d=$(ls $f/packaging/*.desktop); id=$(basename $d .desktop) - doas install -m 644 $f/packaging/$f.svg $ICONS/$id.svg - sed "s|^Exec=patina-$f|Exec=$P/bin/patina-$f|" $d | doas tee $S/applications/$id.desktop >/dev/null - done - doas install -m 644 packaging/patina-mimeapps.list $S/applications/ - doas install -m 644 packaging/portal/patina-portals.conf $P/etc/xdg/xdg-desktop-portal/ - sed "s|@BINDIR@|$P/bin|" packaging/portal/xdg-desktop-portal-wlr.ini | doas tee $P/etc/xdg/xdg-desktop-portal-wlr/Patina >/dev/null - cd ~/src/teleprinter - doas install -m 644 packaging/linux/teleprinter.svg $ICONS/com.sectorflabs.Teleprinter.svg - sed "s|^Exec=teleprinter|Exec=$P/bin/teleprinter|" packaging/linux/com.sectorflabs.Teleprinter.desktop | doas tee $S/applications/com.sectorflabs.Teleprinter.desktop >/dev/null - cd ~/src/patina-desktop/files - doas install -m 644 packaging/linux/files.svg $ICONS/com.sectorflabs.Files.svg - sed "s|^Exec=files|Exec=$P/bin/files|" packaging/linux/com.sectorflabs.Files.desktop | doas tee $S/applications/com.sectorflabs.Files.desktop >/dev/null - sed "s|@BINDIR@|$P/bin|" packaging/portal/org.freedesktop.impl.portal.desktop.patina.service | doas tee $S/dbus-1/services/org.freedesktop.impl.portal.desktop.patina.service >/dev/null - doas install -m 644 packaging/portal/patina.portal $S/xdg-desktop-portal/portals/ - doas update-desktop-database -q $S/applications; true' - -echo "==> scale $SCALE" -run "c=~/.config/patina-compositor/config.toml - mkdir -p \$(dirname \$c) - if [ ! -f \$c ]; then echo 'scale = $SCALE' > \$c - elif grep -q '^scale *=' \$c; then sed -i '' 's/^scale *=.*/scale = $SCALE/' \$c - elif grep -q '^# scale *=' \$c; then sed -i '' 's/^# scale *=.*/scale = $SCALE/' \$c - else echo 'scale = $SCALE' >> \$c; fi - grep -n '^scale' \$c" - -echo "==> lock screen off" -# patina-lock checks passwords through PAM, which a non-root user can't do on FreeBSD -# as it stands: it would lock the screen for good. Off until that's solved. -run 'c=~/.config/patina-compositor/config.toml - grep -q "^command *= *\"\"" $c || awk '"'"'{print} /^\[lock\]/{print "command = \"\""; print "on_suspend = false"; print "on_screen_off = false"}'"'"' $c > /tmp/c.new && cp /tmp/c.new $c - grep -n -A3 "^\[lock\]" $c' - -echo "==> wpa_supplicant may save the networks it joins" -# Read when the supplicant starts. Not reconfigured here: that re-associates, and over -# Wi-Fi it would drop this very connection (so: wpa_cli reconfigure, or reboot). -run 'doas grep -q "^update_config=1" /etc/wpa_supplicant.conf || - doas sh -c "echo update_config=1 >> /etc/wpa_supplicant.conf"' - -echo "==> done. Reboot, log in at the console and run start-patina." diff --git a/freebsd/hardware/start-patina b/freebsd/hardware/start-patina @@ -1,12 +0,0 @@ -#!/bin/sh -# Starts the Patina desktop on the machine's own display, from a text console -# login: a runtime dir for the session (FreeBSD has no logind to make one), and -# a D-Bus session bus for the pieces that talk over it. Installed as -# /usr/local/bin/start-patina; see ../hardware.md. -XDG_RUNTIME_DIR=/tmp/xdg-$(id -u) -export XDG_RUNTIME_DIR -mkdir -p -m 700 "$XDG_RUNTIME_DIR" -# eframe's wgpu draws nothing through Mesa's Vulkan here, so every egui app uses GL. -WGPU_BACKEND=gl -export WGPU_BACKEND -exec dbus-run-session patina-session --session diff --git a/freebsd/stage.sh b/freebsd/stage.sh @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# Copies the last commits of patina-desktop into -# freebsd/src/, which bsdt syncs into the VM (it syncs only this folder); the -# VM builds both (bsdt.toml's provision). PATINA_DESKTOP and PATINA_LAUNCHER -# are the checkouts (default: beside patina-os); PATINA_DESKTOP_WORKTREE=1 -# copies their working trees instead, uncommitted changes and all. -set -euo pipefail - -HERE=$(cd "$(dirname "$0")" && pwd) - -# Copies checkout $1 into src/$2, keeping cargo's target folder, if the VM's -# build left one, so rebuilds are quick. -stage() { - local src=$1 dest="$HERE/src/$2" - [[ -d "$src/.git" ]] || { echo "error: no checkout at $src" >&2; exit 1; } - mkdir -p "$dest" - find "$dest" -mindepth 1 -maxdepth 1 ! -name target -exec rm -rf {} + - if [[ -n "${PATINA_DESKTOP_WORKTREE:-}" ]]; then - git -C "$src" ls-files -z --cached --others --exclude-standard | - tar -c -C "$src" --null -T - | tar -x -C "$dest" - echo "==> staged $2's working tree (on $(git -C "$src" rev-parse --short HEAD))" - else - git -C "$src" archive HEAD | tar -x -C "$dest" - echo "==> staged $2 $(git -C "$src" rev-parse --short HEAD)" - fi -} - -stage "${PATINA_DESKTOP:-$HERE/../../patina-desktop}" patina-desktop