diff --git a/systemd/shturman-firstboot.service b/systemd/shturman-firstboot.service index 59fef0c..320244d 100644 --- a/systemd/shturman-firstboot.service +++ b/systemd/shturman-firstboot.service @@ -11,4 +11,4 @@ RemainAfterExit=yes ExecStart=/usr/local/bin/shturman-firstboot [Install] -WantedBy=shturman.target +WantedBy=shturman-stage1.target diff --git a/systemd/shturman-machineid.service b/systemd/shturman-machineid.service index 739b57c..77e97ab 100644 --- a/systemd/shturman-machineid.service +++ b/systemd/shturman-machineid.service @@ -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 diff --git a/systemd/shturman-power.service b/systemd/shturman-power.service index b6aab5f..70428e2 100644 --- a/systemd/shturman-power.service +++ b/systemd/shturman-power.service @@ -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 diff --git a/systemd/shturman-settings.service b/systemd/shturman-settings.service index 088c437..9daa506 100644 --- a/systemd/shturman-settings.service +++ b/systemd/shturman-settings.service @@ -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 diff --git a/systemd/shturman-shell.service b/systemd/shturman-shell.service index f6d41bf..99dd23a 100644 --- a/systemd/shturman-shell.service +++ b/systemd/shturman-shell.service @@ -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 diff --git a/systemd/shturman-splash.service b/systemd/shturman-splash.service new file mode 100644 index 0000000..3158815 --- /dev/null +++ b/systemd/shturman-splash.service @@ -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 diff --git a/systemd/shturman-stage0.target b/systemd/shturman-stage0.target new file mode 100644 index 0000000..c50bd11 --- /dev/null +++ b/systemd/shturman-stage0.target @@ -0,0 +1,3 @@ +[Unit] +Description=Штурман Stage 0 — splash (мгновенно) +Wants=shturman-splash.service diff --git a/systemd/shturman-stage1.target b/systemd/shturman-stage1.target new file mode 100644 index 0000000..5397512 --- /dev/null +++ b/systemd/shturman-stage1.target @@ -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 diff --git a/systemd/shturman-stage2-warmup.service b/systemd/shturman-stage2-warmup.service new file mode 100644 index 0000000..f758072 --- /dev/null +++ b/systemd/shturman-stage2-warmup.service @@ -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 diff --git a/systemd/shturman-stage2.target b/systemd/shturman-stage2.target new file mode 100644 index 0000000..6729519 --- /dev/null +++ b/systemd/shturman-stage2.target @@ -0,0 +1,4 @@ +[Unit] +Description=Штурман Stage 2 — фон (после интерактива) +After=shturman-stage1.target +Wants=shturman-stage2-warmup.service diff --git a/systemd/shturman.target b/systemd/shturman.target index 6f0eec7..63a3944 100644 --- a/systemd/shturman.target +++ b/systemd/shturman.target @@ -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 diff --git a/systemd/tmpfiles-shturman.conf b/systemd/tmpfiles-shturman.conf new file mode 100644 index 0000000..71e9c1b --- /dev/null +++ b/systemd/tmpfiles-shturman.conf @@ -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 -