Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/overpressure-base/50-overpressure-base.preset
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ enable overpressure-storage-ro.service
enable overpressure-usb-link.service
enable overpressure-usb-internet.service
enable overpressure-boot-ok.service
enable overpressure-update-check.timer
14 changes: 14 additions & 0 deletions common/overpressure-base/50-overpressure-update.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Unlicense
// The session's user (the active, local one: the headset's own session, whichever flavour names it) starts the
// updater's three steps without a password, as Overpressure Settings does; nothing else of systemd's units.
polkit.addRule(function (action, subject) {
var units = [
"overpressure-update@check.service",
"overpressure-update@download.service",
"overpressure-update@install.service",
];
if (action.id === "org.freedesktop.systemd1.manage-units" && action.lookup("verb") === "start" &&
units.indexOf(action.lookup("unit")) >= 0 && subject.local && subject.active) {
return polkit.Result.YES;
}
});
27 changes: 21 additions & 6 deletions common/overpressure-base/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# gateway), steamos-readonly for an ext4 image, emergency and rescue back to the bootloader, and the system's
# generic policy files. Its programs source the runtime's lib.sh, and the recovery deadline runs the runtime's
# recovery-watch: the image build installs both from overpressure, as the maintenance system has them, with the
# headset's values in /etc/overpressure/headset. The preset enables the services; the tests run in the build.
# headset's values in /etc/overpressure/headset. The updater's units: its steps (overpressure-update@), which the
# session's user may start (its polkit rule), and its daily check. The preset enables the services and the timer;
# the tests run in the build.
pkgname=overpressure-base
pkgver=2026.12.2
pkgrel=1
pkgrel=2
pkgdesc="overpressure's installed system: preinit, storage and recovery policy, USB link"
arch=(any)
url="https://github.com/overpressure/overpressure/blob/main/docs/runtime.md"
Expand Down Expand Up @@ -42,7 +44,11 @@ source=(50-overpressure-usb.conf
test_config.py test_usb_internet.py
test_boot_attempts.sh test_steamos_readonly.sh
50-overpressure-base.preset
67-overpressure-language-fonts.conf)
67-overpressure-language-fonts.conf
overpressure-update@.service
overpressure-update-check.service
overpressure-update-check.timer
50-overpressure-update.rules)
sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396'
'227246238bcba53b5610fde79395119e0915aefeba8d6184b5c6e59efdeb01d8'
'e490417b57d6b3bd5f59ddaeda87ba02ea1d38032c90678032cdfd471f0d5452'
Expand All @@ -65,12 +71,16 @@ sha256sums=('952324c99b08f87f6d318258eb24915ed4f18a4f9fa219e756bbca70d5bd8396'
'42e864cce089ddec10704c74a404d4713e9b1371284e88e29c8a396f43e0bf42'
'7e2e20deeb0a824f77178be78dd3b52ba3b0eea92723b634279adc2c5e0d38b7'
'3daf42f9b44dfcf6d4ae65018d633198503fa9071596c443a188fe37ec379d78'
'fdca84ee896078af81ecf5f91b7f5863ea95e8c92001e353a928aebf2f8861a9'
'c7dd064ee8c73ae16f18be269c41411820408678cd467e4324cd2414a3b3897e'
'f5f3580f84c53379b59a4de7aa206ba88975a439939a4b8eded66bd5dcced147'
'7983dff5891f654806fdf7b0ac36683df4b13d8ae291e439c3a90ee5abb5ab4e'
'b45bf0dbde89f82a75cd782acce1773f1e2b7d2b0322d66be50c71782dac0eea'
'64a12dac4612f7020db4a355b0ed54618f5c80fa3a84f2607054b9f152fff01f'
'6875447f1422c4567a5fefbd2d525d0c55d0617d067ffe6e4f8b40a07506843f')
'b8294486d9305db74506e5c60f54fa92cc0e81fd0472e5621b23516af019a3e7'
'6875447f1422c4567a5fefbd2d525d0c55d0617d067ffe6e4f8b40a07506843f'
'ab59e4ee787a31adfdd29537bceceb7b9ab411ef588147298de62e3207df99ea'
'4ebc1f7eff4e2f5ed36bce4df967b584a1c005d77fcc8aff961962ed09049551'
'5a8041f96bf0c3f6a88d3477a38b4f5a272dc33cce9dbc29f828509b62c07f16'
'2a8a8885c7f8d594ede33a2de83b38df07953729a210856768c350c94452fd40')

build() {
python3 -B -m unittest test_config test_usb_internet
Expand Down Expand Up @@ -105,4 +115,9 @@ package() {
# The headset's preinit hooks (preinit's header).
install -dm755 "$pkgdir/usr/lib/overpressure/preinit/early.d" "$pkgdir/usr/lib/overpressure/preinit/mounted.d"
install -Dm644 50-overpressure-base.preset -t "$pkgdir/usr/lib/systemd/system-preset"
# The updater (overpressure-update, which the image build installs from overpressure): its steps, its daily
# check, and the rule that lets the session start the steps.
install -Dm644 overpressure-update@.service overpressure-update-check.service overpressure-update-check.timer \
-t "$pkgdir/usr/lib/systemd/system"
install -Dm644 50-overpressure-update.rules "$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules"
}
11 changes: 11 additions & 0 deletions common/overpressure-base/overpressure-update-check.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The daily check for a newer release (overpressure-update-check.timer): a check that fails, offline say, leaves the
# updater's status as it was.
[Unit]
Description=Check for a newer release of the headset's system
Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater

[Service]
Type=oneshot
ExecStart=/usr/bin/overpressure-update check --scheduled
Nice=10
IOSchedulingClass=idle
13 changes: 13 additions & 0 deletions common/overpressure-base/overpressure-update-check.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# A check for a newer release once a day, and after a start that missed one; spread over an hour, so that headsets
# do not all ask at once. Nothing is downloaded: the owner chooses that in Overpressure Settings.
[Unit]
Description=Check for a newer release of the headset's system daily

[Timer]
OnCalendar=daily
Persistent=true
RandomizedDelaySec=1h
OnBootSec=10min

[Install]
WantedBy=timers.target
15 changes: 15 additions & 0 deletions common/overpressure-base/overpressure-update@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# A step of overpressure's updater (check, download or install: overpressure's docs/internals/updates.md, "The
# updater"), which Overpressure Settings starts for the session's user (50-overpressure-update.rules). A download
# runs on with the dashboard closed; install restarts into the recovery, which installs the update.
# It starts at once, without network-online.target (networkd's wait times out on the USB link): the updater reads
# no network as a refusal with its reason.
[Unit]
Description=overpressure's updater: %i
Documentation=https://github.com/overpressure/overpressure/blob/main/docs/internals/updates.md#the-updater

[Service]
Type=oneshot
ExecStart=/usr/bin/overpressure-update %i
# Behind the session: the headset stays playable while it downloads.
Nice=10
IOSchedulingClass=idle
55 changes: 55 additions & 0 deletions common/overpressure-base/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import configparser
import re
import unittest
from pathlib import Path

Expand Down Expand Up @@ -53,5 +54,59 @@ def test_no_key_in_the_package(self):
self.assertEqual(names, [])


class UpdaterTests(unittest.TestCase):
"""The updater's units and the rule that lets the session start its steps (overpressure's updates.md)."""

STEPS = ("check", "download", "install")

@staticmethod
def unit(name: str) -> configparser.ConfigParser:
config = configparser.ConfigParser(interpolation=None) # %i is systemd's
config.read_string((HERE / name).read_text(encoding="utf-8"))
return config

def test_each_step_runs_the_updater_once_behind_the_session(self):
unit = self.unit("overpressure-update@.service")
self.assertEqual(unit["Service"]["Type"], "oneshot")
self.assertEqual(unit["Service"]["ExecStart"], "/usr/bin/overpressure-update %i")
self.assertEqual(unit["Service"]["IOSchedulingClass"], "idle")
# At once when pressed: no wait for network-online.target, which networkd may hold for minutes.
for name in ("overpressure-update@.service", "overpressure-update-check.service"):
waits = [self.unit(name)["Unit"].get(key, "") for key in ("After", "Wants", "Requires")]
self.assertFalse([w for w in waits if "network-online" in w], name)

def test_the_daily_check_fails_quietly_and_is_enabled(self):
check = self.unit("overpressure-update-check.service")
self.assertEqual(check["Service"]["ExecStart"], "/usr/bin/overpressure-update check --scheduled")
timer = self.unit("overpressure-update-check.timer")
self.assertEqual(timer["Timer"]["OnCalendar"], "daily")
self.assertEqual(timer["Timer"]["Persistent"], "true")
self.assertEqual(timer["Install"]["WantedBy"], "timers.target")
preset = (HERE / "50-overpressure-base.preset").read_text(encoding="utf-8").splitlines()
self.assertIn("enable overpressure-update-check.timer", preset)
self.assertNotIn("overpressure-update@", "\n".join(preset)) # the steps start when the owner asks

def test_the_session_starts_the_three_steps_and_nothing_else(self):
rule = (HERE / "50-overpressure-update.rules").read_text(encoding="utf-8")
units = re.findall(r'"(overpressure-update@[a-z]+\.service)"', rule)
self.assertEqual(units, [f"overpressure-update@{step}.service" for step in self.STEPS])
self.assertIn('action.id === "org.freedesktop.systemd1.manage-units"', rule)
self.assertIn('action.lookup("verb") === "start"', rule)
self.assertIn("subject.local && subject.active", rule)
self.assertEqual(rule.count("polkit.Result.YES"), 1)
self.assertNotIn("Result.AUTH", rule)

def test_the_package_installs_them(self):
pkgbuild = (HERE / "PKGBUILD").read_text(encoding="utf-8")
for name in (
"overpressure-update@.service",
"overpressure-update-check.service",
"overpressure-update-check.timer",
"50-overpressure-update.rules",
):
self.assertIn(f" {name}", pkgbuild)
self.assertIn('"$pkgdir/usr/share/polkit-1/rules.d/50-overpressure-update.rules"', pkgbuild)


if __name__ == "__main__":
unittest.main()
53 changes: 30 additions & 23 deletions phoenix/pico4-monado/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# overlays (Overpressure Settings' dashboard tab, the first-run setup).
pkgname=pico4-monado
pkgver=25.1.0
pkgrel=22
pkgrel=23
arch=(aarch64)
url="https://monado.freedesktop.org"
license=(BSL-1.0)
depends=(openxr vulkan-icd-loader libusb systemd-libs dbus libcap libdrm libffi libx11 libxau libxcb
depends=(openxr vulkan-icd-loader libusb systemd-libs dbus libcap libdrm libffi libx11 libxau libxcb librsvg
libxdmcp wayland gcc-libs glibc opencv libbsd cairo pango fontconfig glib2)
makedepends=(git cmake ninja eigen vulkan-headers glslang python cairo pango fontconfig)
makedepends=(git cmake ninja eigen vulkan-headers glslang python cairo pango fontconfig librsvg)
# Loaded at runtime (VIT); without it the HMD stays on 3DoF.
optdepends=('pico4-basalt: 6DoF head tracking')
provides=(openxr-runtime)
Expand All @@ -42,6 +42,7 @@ source=("monado::git+https://gitlab.freedesktop.org/monado/monado.git#commit=$_c
pico4_passthrough.h pico4_passthrough.c pico4_roomview.h pico4-roomview.c
pico4_lens_panel.h test_pico4_lens_panel.c pico4_settings.h overpressure-settings.cpp test_pico4_settings.c
pico4_overlay.hpp pico4_panels.hpp pico4_pairing.h pico4_onboarding.h pico4-onboarding.cpp test_pico4_onboarding.c
pico4_ui.hpp pico4_ui_hits.h pico4_pair_ui.hpp pico4-headset.svg
pico4_setup.h pico4_text.hpp test_pico4_setup.c pico4-onboarding.strings pico4-steamvr-switch.cpp
pico4_slam.h pico4_slam.c pico4_slam_feed.h pico4_blemcu.h pico4_blemcu.c pico4_controller.h pico4_controller.c
pico4_fusion.h pico4_fusion.c test_pico4_tracking.c test_pico4_fusion.c
Expand Down Expand Up @@ -82,29 +83,33 @@ sha256sums=(SKIP
'42d4a1ec923f5a32b93847370cf2c63e9b07a5d68d51c8a2e5214d995d51c1a0'
'787136e02024254b355d1aae427799c206456307040ecc29d543962179364a96'
'732a6738b8e89063d247c820f0fdf6de7be2b2b9435e751886450474ffa7a2d0'
'93a500075473c85d7c9d1ce81f609a26f876d18c8325b10af5e710c44657d7da'
'41bb03af46edb3c3a593cefbc2246382826a16a3b567619b937d9f45df85eedb'
'c6f9b33382bc9abb75942be3588072cb8acc1944116e3f3406bd9dce8565ff48'
'1c7565884f9cacc4b208658d0fc11be770eb263837fea489db0c335d96227a9d'
'46147c0c7d2013e76e4168479651813f462a9ee89e0ba3606427576b24099443'
'723538607265c89266e50d5a301aabfcdf80b695088f0b73256364638bb83330'
'c9aed4ebbe10c87232c89dbd3299072bf311e50ebdc33d0c474ae302106e1900'
'ae0e6142841aba8f4bdccc40347f2669b06a10dabe7c4119ea074335b179ad11'
'54aa815f0d7e4a1370b94cf1e51c3ce84c38d6bdad66d7e2a41e56ed598efbd8'
'e160944ec154fa5caf43d2177396656c8561d1739df07510ce75c3b8ddafa3b3'
'175f5769b65092ccd746309d6dcf9637b430960cc895b15ff103f8455b117bed'
'22304e9a08ef83f9165f329ee704e342971a5d781add852af782474d320caed9'
'ef439cd62f980ac666d74b0eca4b83ea8355bc89d9f702507a097e1d53ee1393'
'250d2c91cba27509443ca50b5422fb6aa6e9255bd28ddcbd1aa2d284a6c44973'
'906a7fc52e55a666645aa5ee3a66100e353134049f59558870c7005dc6c084ac'
'07e474ecbbb1e3a629735c123fe83cb1c9ca7c4dedf34392e1f99e06bdbf37c2'
'de4add87e8b087f7e1edfaa0212b052b435e94fde9cce0a28e8e410bcfeb6264'
'bb6561e792bdbcb7ec78eeb8b0a275fc138d930a3cde818ad34f2e56536a893d'
'03974180cb098b1b5c5d6fc48324a6e44c1fac26ad21e99cde7ec218e68f341f'
'0fe74dbd8f72c6e0763952a3e602771aa4d3c4b9c84871909fb4355d9b3b3756'
'5cbe37ce8152ace06a53c6f0bec5b9fb6b639d9d2b86c6eb47864594112f87ab'
'4b43cde5473deea834e49e02ca14c2fb01900d0bef88c7e6d2b6546fb56b80be'
'7aafc2f95d382c3445c98e546f32a52464183b2b9d0e05c77398c7d011aed823'
'9e9f196f447f64b3177349c95a9be86343da081569b11ba002fec342db41a2dd'
'73a1fd1797b32116158fcda29e6754ea492a1832197f146ecbc785f0f605ed53'
'7e22709542acad80b192fa0cd1ecd7e533e02a33aa233cbd5c17144331e36898'
'fedc001568c106e488b26f2fd4418dd563351089c76af4d05c328d3cd1cf5c51'
'6b0d8e8479f4282bcaaaa46d0090417fa5e1ca72a03600a9b2da95cdf71f28d5'
'8564f2babbd92aa89f26d448c6c6a9d2e9c7c07ac52c1fc9424f09fe11b226ed'
'82cb589128b7047e28c19267ab579abe4033e8003b0560841bbf7ea90bd79c8c'
'68f3ed1ca637c979193aa095819b5b27ebf80087f262488b1d752daf10248975'
'57b052998c5df61a691e163e4e43191e4f4994e610ea95a01ceb6a774b850be3'
'f7419b19ba4a01f570420760a91c74183acc252eded0585dc212c542ba136e0d'
'80948b181cd55b1194842f7c4b284299ed4cf91c5ee9978fa31d1938e5c97501'
'94c45d48bfe6d226b56d10088ae7fc31839f50612db412800c9fb5e566a5797a'
'4b58a623d5ebe53c2a30ed6710f25c66da8c96b2c014525fd08b479a8abbcd83'
'ccb6d333b26d172ac07fc2de3234883afccb2ae5ce0419cf3b067fe971d12372'
'4104d15d75e3dff32b8edf5779b9a73cacd85e5a36d6bd1a8c23f928889a3cc6'
'c282f2979f0785017a988bd439b928a733625b27417d3024e1d28f66531c91f1'
'44ca0d565fd8d0b1c2617d3351413ff0eed242b5daa0b8385edf1ee62f0936d7'
'374bd56d373143725b3a6db79f284a40350a1017eb631f63d4e8d3cd41ef20b2'
'88f2c74f8fb72878f7ba98d5c5007e6c639fe8ef7a078a546c1101e5b48c26ca'
'cc727edbad724f50656255313d81ebc56dc6c168bbe05f10f8c57cfecd3829a4'
'1e216b8317b7dcbdefb623a59dedf67ab580ffcfcd5b671a5420e777ce88aea9'
'58f7dba6fbdb8473b6efffd4a31ce4ce32fd485d499355802ca850923e0bcfd6'
Expand All @@ -115,7 +120,7 @@ sha256sums=(SKIP
'a52d561a66f774bfab2183f626d1eca003e69e40d5b1ef98a5e8fc2b1e4c4377'
'3b5723d2dfee9343828f49228ccaaf490205e2588bb02b39d5171b5d7299b619'
'85c59e96fa7aff425f05c3129679c707a324de9ff7870d11b977e2439c2c6463'
'7e332686ec26c09e0a0162047f3ec99e09cfa8bd1428f7acc8699b5646c46b67'
'3dd972b7ab16bec8b7580d1894abea7168f3777c0d4d2a489bf0dac27955c2db'
'4d65eeb635e98fb994fecf8cd5448e754c97c598eacea86852fb8930eaaadd08'
'6f9e6b63f008118305f60253257bcbf28354594e84b7bd8fa3b5ca33dcd11872'
'6168eaa35df0d363fbd7b5b86fca92b2aa63c2c06979932cf03a9531279773cc'
Expand Down Expand Up @@ -253,11 +258,11 @@ build() {
pico4_cam.c pico4_station.c pico4_ssc.c -lpthread
${CC:-cc} -std=c11 -O2 -Wall -Wextra -Werror -o pico4-roomview pico4-roomview.c -lvulkan -ldl -lm
${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \
$(pkg-config --cflags pangocairo fontconfig) -o overpressure-settings overpressure-settings.cpp \
$(pkg-config --libs pangocairo fontconfig) -lcairo -lvulkan -ldl -lm
$(pkg-config --cflags pangocairo fontconfig librsvg-2.0) -o overpressure-settings overpressure-settings.cpp \
$(pkg-config --libs pangocairo fontconfig librsvg-2.0) -lcairo -lvulkan -ldl -lm
${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \
$(pkg-config --cflags pangocairo fontconfig) -o pico4-onboarding pico4-onboarding.cpp \
$(pkg-config --libs pangocairo fontconfig) -lcairo -lvulkan -ldl -lm
$(pkg-config --cflags pangocairo fontconfig librsvg-2.0) -o pico4-onboarding pico4-onboarding.cpp \
$(pkg-config --libs pangocairo fontconfig librsvg-2.0) -lcairo -lvulkan -ldl -lm
${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-missing-field-initializers -isystem monado/src/external/openvr_includes \
-o pico4-steamvr-switch pico4-steamvr-switch.cpp -lcairo -lvulkan -ldl -lm
${CXX:-c++} -std=c++17 -O2 -Wall -Wextra -Werror -isystem /usr/include/eigen3 -o pico4-ctrack-replay \
Expand Down Expand Up @@ -286,6 +291,8 @@ package() {
ln -s /opt/steamvr/resources/input/default_pico_controller_remapping.json "$input/default_pico_controller_remapping.json"
install -Dm755 overpressure-settings pico4-onboarding pico4-steamvr-switch -t "$pkgdir/usr/bin"
install -Dm644 pico4-onboarding.strings "$pkgdir/usr/share/pico4/onboarding.strings"
# The headset's picture on the panels (the overpressure client's art for it).
install -Dm644 pico4-headset.svg "$pkgdir/usr/share/pico4/headset.svg"
install -Dm755 pico4-openxr-pose pico4-openxr-display pico4-cam pico4-ctrack-replay pico4-roomview -t "$pkgdir/usr/bin"
# The loader's system-wide active runtime.
install -dm755 "$pkgdir/etc/openxr/1"
Expand Down
Loading