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