]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
Add systemd service file to launch bricklayer in first install mode.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 24 Feb 2023 16:36:04 +0000 (17:36 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Feb 2023 18:28:37 +0000 (18:28 +0000)
This service file will launch bricklayer in first-install mode
in case the firstinstall flag on the filesystem is set.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/systemd/bricklayer-first-install.service.in

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2ba2dd599fb269455ac1b52cdcd4a7bf58bf8e80 100644 (file)
@@ -0,0 +1,30 @@
+[Unit]
+Description=Launch bricklayer to configure pre-generated images
+After=plymouth-quit-wait.service
+After=systemd-vconsole-setup.service systemd-user-sessions.service
+# getty-pre.target is a pasive target, we need to request it before we can use it
+Wants=getty-pre.target
+# Prevent getty from running on any consoles before we are done
+Before=getty-pre.target
+Conflicts=plymouth-quit-wait.service bricklayer-first-install.service
+ConditionPathExists=/.firstinstall
+
+[Service]
+Type=oneshot
+TimeoutSec=0
+RemainAfterExit=yes
+# Tell systemd to stop logging to the console, to prevent it's messages
+# with interfering with the TUI of bricklayer potentially running there
+ExecStartPre=/bin/kill -SIGRTMIN+21 1
+ExecStartPre=-/bin/plymouth quit
+ExecStart=@BINDIR@/bricklayer --first-install
+# Re-enable systemd console logging once bricklayer is done
+ExecStartPost=/bin/kill -SIGRTMIN+20 1
+TimeoutSec=0
+RemainAfterExit=no
+StandardInput=tty
+StandardOutput=tty
+StandardError=tty
+
+[Install]
+WantedBy=multi-user.target