feat(v0.2): фазовые systemd-таргеты Stage 0/1/2 + splash/warmup + зонтик

P6.3: shturman.target → зонтик (Wants stage0/1/2). Новые: stage0/1/2.target,
shturman-splash.service (Before=shell, минимум зависимостей → «мгновенно»),
shturman-stage2-warmup.service (After=shell, маркер /run/shturman/stage2.ready),
tmpfiles-shturman.conf (/run/shturman). Члены critical set → stage1.target
(WantedBy+PartOf); у shell убран RuntimeDirectory (каталог теперь от tmpfiles).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
2026-06-24 20:08:10 +03:00
parent 62a6f332e2
commit 86ab11a54b
12 changed files with 56 additions and 13 deletions
+1 -1
View File
@@ -11,4 +11,4 @@ RemainAfterExit=yes
ExecStart=/usr/local/bin/shturman-firstboot
[Install]
WantedBy=shturman.target
WantedBy=shturman-stage1.target
+1 -1
View File
@@ -13,4 +13,4 @@ RemainAfterExit=yes
ExecStart=/bin/sh -c '[ -e /etc/machine-id ] || : > /etc/machine-id; mount --bind /data/state/machine-id /etc/machine-id'
[Install]
WantedBy=shturman.target
WantedBy=shturman-stage1.target
+2 -2
View File
@@ -2,7 +2,7 @@
Description=Штурман Power (ru.shturman.Power1)
Requires=data.mount shturman-firstboot.service
After=data.mount shturman-firstboot.service shturman-machineid.service dbus.service
PartOf=shturman.target
PartOf=shturman-stage1.target
[Service]
ExecStart=/usr/local/bin/shturman-power
@@ -11,4 +11,4 @@ RestartSec=2
OOMScoreAdjust=-600
[Install]
WantedBy=shturman.target
WantedBy=shturman-stage1.target
+2 -2
View File
@@ -3,7 +3,7 @@ Description=Штурман Settings (ru.shturman.Settings1)
# Requires+After firstboot: не стартуем против полу-провиженного /data (Wants недостаточно).
Requires=data.mount shturman-firstboot.service
After=data.mount shturman-firstboot.service shturman-machineid.service dbus.service
PartOf=shturman.target
PartOf=shturman-stage1.target
[Service]
ExecStart=/usr/local/bin/shturman-settings
@@ -13,4 +13,4 @@ RestartSec=2
OOMScoreAdjust=-600
[Install]
WantedBy=shturman.target
WantedBy=shturman-stage1.target
+2 -3
View File
@@ -2,7 +2,7 @@
Description=Штурман Shell — первый Slint-кадр (software-render → PNG, §6)
Requires=data.mount shturman-firstboot.service
After=shturman-power.service shturman-settings.service shturman-machineid.service
PartOf=shturman.target
PartOf=shturman-stage1.target
[Service]
# v0.6: headless software-render кадра в PNG (спека §6 — основной автотест кадра, композитор не нужен).
@@ -10,10 +10,9 @@ PartOf=shturman.target
# Кадр читает ui.theme/Power с системной шины (After=power/settings) и пишет в tmpfs /run (volatile, A11).
Type=oneshot
RemainAfterExit=yes
RuntimeDirectory=shturman
ExecStart=/usr/local/bin/shturman-shell --screenshot /run/shturman/frame.png
TimeoutStartSec=30
OOMScoreAdjust=-600
[Install]
WantedBy=shturman.target
WantedBy=shturman-stage1.target
+15
View File
@@ -0,0 +1,15 @@
[Unit]
Description=Штурман splash (Stage 0, software-render → PNG)
# «Мгновенно»: без Requires=data.mount/dbus — стартует рано, параллельно critical set.
# Before=shell гарантирует splash.png раньше frame.png. /run/shturman даёт tmpfiles.
After=systemd-tmpfiles-setup.service
Before=shturman-shell.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/shturman-splash --screenshot /run/shturman/splash.png
TimeoutStartSec=15
[Install]
WantedBy=shturman-stage0.target
+3
View File
@@ -0,0 +1,3 @@
[Unit]
Description=Штурман Stage 0 — splash (мгновенно)
Wants=shturman-splash.service
+6
View File
@@ -0,0 +1,6 @@
[Unit]
Description=Штурман Stage 1 — ядро + первый кадр
Requires=data.mount
After=data.mount
# Члены critical set (v0.1). Ordering — в самих юнитах (After=/Requires=).
Wants=shturman-firstboot.service shturman-machineid.service shturman-power.service shturman-settings.service shturman-shell.service
+13
View File
@@ -0,0 +1,13 @@
[Unit]
Description=Штурман Stage 2 warmup (плейсхолдер фона)
# Деферред: после первого кадра. Каркас для реальных фоновых сервисов v1+
# (Vehicle-Data/Assistant/Media/Nav). Пишет маркер — E2E проверяет «фаза разделена».
After=shturman-shell.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c 'echo "stage2 warmup" | systemd-cat -t shturman-stage2; : > /run/shturman/stage2.ready'
[Install]
WantedBy=shturman-stage2.target
+4
View File
@@ -0,0 +1,4 @@
[Unit]
Description=Штурман Stage 2 — фон (после интерактива)
After=shturman-stage1.target
Wants=shturman-stage2-warmup.service
+4 -4
View File
@@ -1,10 +1,10 @@
[Unit]
Description=Штурман — v0 critical set (Stage 1: ядро + первый кадр)
Description=Штурман — v0 boot-конвейер (зонтик фаз Stage 0/1/2)
Requires=data.mount
After=data.mount
# Тянем членов critical set: `systemctl enable shturman.target` НЕ каскадит на WantedBy-юниты,
# поэтому target должен явно Wants= их (ordering — в самих юнитах через After=).
Wants=shturman-firstboot.service shturman-machineid.service shturman-power.service shturman-settings.service shturman-shell.service
# Зонтик тянет три фазовых под-таргета. Порядок «splash → кадр → фон» — на уровне сервисов
# (splash Before=shell; warmup After=shell), не сериализацией таргетов (иначе critical set ждал бы splash).
Wants=shturman-stage0.target shturman-stage1.target shturman-stage2.target
[Install]
WantedBy=multi-user.target
+3
View File
@@ -0,0 +1,3 @@
# /run/shturman — volatile-каталог кадров/маркеров (splash.png, frame.png, stage2.ready). A11.
# Создаётся на boot до сервисов; splash/shell/warmup пишут сюда (tmpfs, не на flash).
d /run/shturman 0755 root root -