From 6e8fe0796b829928826c5133d7f0ea2fd780786f Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Jun 2026 14:36:50 +0300 Subject: [PATCH] =?UTF-8?q?fix(review):=20systemd=20target=20=D1=82=D1=8F?= =?UTF-8?q?=D0=BD=D0=B5=D1=82=20critical=20set=20(#1)=20+=20harden=20machi?= =?UTF-8?q?ne-id=20bind=20+=20deny=20slint-note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - БЛОКЕР: shturman.target Wants= сервисов (enable target не каскадит) — иначе start поднимал только /data. - machine-id bind: создаём /etc/machine-id, если нет, перед mount --bind. - deny.toml: заметка о хрупкости slint-exceptions к апгрейдам. Co-Authored-By: Claude Opus 4.8 Signed-off-by: Alexander --- deny.toml | 2 ++ systemd/shturman-machineid.service | 2 +- systemd/shturman.target | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index 3203347..1ccc056 100644 --- a/deny.toml +++ b/deny.toml @@ -5,6 +5,8 @@ # Для embedded royalty-free неприменим → берём GPL-3.0 (вариант A; финал по UI-тулкиту/лицензии — к v4, # см. docs/specs/v0.1-v0.6-foundation.md §12). Шипимый UI-бинарь прод-образа (v4) будет копилефтным. # Точечные exceptions для slint-крейтов ниже — НЕ глобальный allow GPL. +# ⚠️ Риск: минорный апгрейд Slint может добавить новый i-slint-* крейт → cargo-deny упадёт (fail-closed) +# на нём — добавить в exceptions. Slint держим запиненным (Cargo.lock), апгрейд — осознанное событие. [advisories] version = 2 diff --git a/systemd/shturman-machineid.service b/systemd/shturman-machineid.service index 6a0c826..739b57c 100644 --- a/systemd/shturman-machineid.service +++ b/systemd/shturman-machineid.service @@ -10,7 +10,7 @@ ConditionPathExists=/data/state/machine-id [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/bin/sh -c 'mount --bind /data/state/machine-id /etc/machine-id' +ExecStart=/bin/sh -c '[ -e /etc/machine-id ] || : > /etc/machine-id; mount --bind /data/state/machine-id /etc/machine-id' [Install] WantedBy=shturman.target diff --git a/systemd/shturman.target b/systemd/shturman.target index b7a456e..6f0eec7 100644 --- a/systemd/shturman.target +++ b/systemd/shturman.target @@ -2,6 +2,9 @@ Description=Штурман — v0 critical set (Stage 1: ядро + первый кадр) 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 [Install] WantedBy=multi-user.target