From 4a5e0c96fe02a3a079decd18e05e03109bc4f3ec Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Wed, 11 Nov 2026 19:44:01 -0500 Subject: [PATCH] omamobile-omarchy 0.1.44: /run is 0755 before Omarchy 4.5's migrations run Omarchy 4.5 refuses to work under a /run that anyone can write: its sudo migration (1788163635) exits 1, which stops omarchy update, and its pacman hooks abort later transactions (#447). Boot images from before #437 mount /run with tmpfs's default, 1777. A phone gets a new boot image only through a restart, and only the Pixel 7 Pro's device package carries one, so with Omarchy pinned at 4.5.0-3 (#670) a release-installed 7 Pro stops in its first update to 4.5 until it is restarted and updated again, and every other phone stops at each attempt until its owner rebuilds and pushes boot images. The 7 Pro that took the update on 2026-11-11 had the new image pushed first, so it didn't show this; the round 52 review of #670 found it. A tmpfiles.d rule, z /run 0755 root root. pacman's own tmpfiles hook (21-systemd-tmpfiles.hook, PostTransaction) applies it in the transaction that installs it, which is before Omarchy's migrations, and systemd-tmpfiles-setup applies it at every boot, on every device and whatever the boot image. On the Pixel 7 Pro (Omarchy 4.5.0-3): with /run set to 1777, Omarchy's omarchy_security_assert_root_directory /run 755 refuses; after systemd-tmpfiles --create with this file /run is 755 root and it passes; a 0700 directory inside a scratch /run keeps its mode. Not run: a whole update from 4.0.6 on a phone booted from an old image. Co-Authored-By: Claude Fable 5.2 --- packages/omamobile-omarchy/install | 1 + packages/omamobile-omarchy/test/all | 3 ++- packages/omamobile-omarchy/test/run-mode.sh | 26 +++++++++++++++++++ .../tmpfiles/omamobile-run.conf | 10 +++++++ packages/omamobile-omarchy/version | 2 +- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 packages/omamobile-omarchy/test/run-mode.sh create mode 100644 packages/omamobile-omarchy/tmpfiles/omamobile-run.conf diff --git a/packages/omamobile-omarchy/install b/packages/omamobile-omarchy/install index 3ad8c0b00..783e2296f 100755 --- a/packages/omamobile-omarchy/install +++ b/packages/omamobile-omarchy/install @@ -28,6 +28,7 @@ for f in patches/*.patch; do install -Dm644 "$f" "$d/usr/share/omamobile/omarchy/patches/${f##*/}" done install -Dm644 zram/91-omamobile.conf "$d/usr/lib/systemd/zram-generator.conf.d/91-omamobile.conf" +install -Dm644 tmpfiles/omamobile-run.conf "$d/usr/lib/tmpfiles.d/omamobile-run.conf" install -Dm644 libalpm/95-omamobile-omarchy-patches.hook "$d/usr/share/libalpm/hooks/95-omamobile-omarchy-patches.hook" install -Dm644 LICENSE "$d/usr/share/licenses/omamobile-omarchy/LICENSE" install -Dm644 LICENSE.omarchy "$d/usr/share/licenses/omamobile-omarchy/omarchy-MIT" diff --git a/packages/omamobile-omarchy/test/all b/packages/omamobile-omarchy/test/all index 35a33d808..c5be96f55 100755 --- a/packages/omamobile-omarchy/test/all +++ b/packages/omamobile-omarchy/test/all @@ -10,7 +10,7 @@ fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } pass() { printf 'ok - %s\n' "$1"; } for f in install omamobile-omarchy.install lib/update-bin/* lib/lock-pam lib/modules-cleanup test/update.sh \ - test/lock-pam.sh test/lock-glance test/sleep-lock.sh test/modules-cleanup.sh test/zram.sh; do + test/lock-pam.sh test/lock-glance test/sleep-lock.sh test/modules-cleanup.sh test/zram.sh test/run-mode.sh; do bash -n "$f" || fail "$f parses" done for f in bin/omamobile-omarchy-patches bin/omamobile-update test/patches.py; do @@ -64,6 +64,7 @@ fi pass "install stages the module cleanup, its timer's wants link and the drop-in for Arch's" bash test/modules-cleanup.sh || fail "modules-cleanup" bash test/zram.sh || fail "zram drop-in" +bash test/run-mode.sh || fail "the /run mode rule" # Every patch file says what it is for, before its first diff for p in patches/*.patch; do diff --git a/packages/omamobile-omarchy/test/run-mode.sh b/packages/omamobile-omarchy/test/run-mode.sh new file mode 100644 index 000000000..6f92bd9a4 --- /dev/null +++ b/packages/omamobile-omarchy/test/run-mode.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# tmpfiles/omamobile-run.conf: the staged file, and, where systemd-tmpfiles +# can run on a made-up root (--root), that it takes a 1777 /run to 0755 and +# leaves what is in it alone. Nothing on this machine's /run is touched. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +pass() { printf 'ok - %s\n' "$1"; } +t=$(mktemp -d); trap 'rm -rf "$t"' EXIT + +./install "$t/stage" >/dev/null +f=$t/stage/usr/lib/tmpfiles.d/omamobile-run.conf +[[ -f $f ]] || fail "the /run rule is staged in usr/lib/tmpfiles.d, where pacman's tmpfiles hook looks" +[[ $(grep -vE '^[[:space:]]*(#|$)' "$f") == "z /run 0755 root root - -" ]] || fail "one rule: z /run 0755 root root" +pass "the /run rule is staged: z /run 0755 root root" + +if command -v systemd-tmpfiles >/dev/null && [[ $(id -u) == 0 ]]; then + mkdir -p "$t/root/run/keep"; chmod 1777 "$t/root/run"; chmod 0700 "$t/root/run/keep" + systemd-tmpfiles --root="$t/root" --create "$f" || fail "systemd-tmpfiles accepts the rule" + [[ $(stat -c %a "$t/root/run") == 755 ]] || fail "a 1777 /run becomes 0755 (got $(stat -c %a "$t/root/run"))" + [[ $(stat -c %a "$t/root/run/keep") == 700 ]] || fail "what is in /run keeps its mode" + pass "systemd-tmpfiles takes a 1777 /run to 0755 and leaves its contents alone" +else + pass "systemd-tmpfiles takes a 1777 /run to 0755 # SKIP needs root and systemd-tmpfiles" +fi diff --git a/packages/omamobile-omarchy/tmpfiles/omamobile-run.conf b/packages/omamobile-omarchy/tmpfiles/omamobile-run.conf new file mode 100644 index 000000000..54d62465c --- /dev/null +++ b/packages/omamobile-omarchy/tmpfiles/omamobile-run.conf @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: MIT +# /run is 0755, as systemd mounts it. Boot images from before 2026-11-11 +# (#437) mounted it with tmpfs's default, 1777, and Omarchy 4.5 refuses to +# work under a /run anyone can write: its sudo migration (1788163635) stops +# `omarchy update`, and its pacman hooks abort later transactions (#447). +# A new boot image only helps after a restart, and only where a device +# package carries one. This line is applied by pacman's own tmpfiles hook in +# the transaction that installs it, before Omarchy's migrations run, and at +# every boot. +z /run 0755 root root - - diff --git a/packages/omamobile-omarchy/version b/packages/omamobile-omarchy/version index 278cbc8db..6871b9e7a 100644 --- a/packages/omamobile-omarchy/version +++ b/packages/omamobile-omarchy/version @@ -1 +1 @@ -0.1.43 +0.1.44