From patchwork Fri Feb 24 16:36:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6611 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PNbBB1fVQz3xHC for ; Fri, 24 Feb 2023 16:36:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PNbB73Vq3z1LH; Fri, 24 Feb 2023 16:36:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PNbB70Yhbz30HD; Fri, 24 Feb 2023 16:36:15 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PNbB514dwz2xm5 for ; Fri, 24 Feb 2023 16:36:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PNbB44HZ8zdM; Fri, 24 Feb 2023 16:36:12 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1677256572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q2aIFADDk0ejN+WLaCMmVLGzQEC7Y/XzbtKz2kiJyV4=; b=Vz9kwnF37Qi4xj0Jt2lVV5odnMEuJgM59J1lHW+KtCstQcBaLIdOKhcwcD1t3tN6DAOygC 9LTNtyUulk+viJBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1677256572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q2aIFADDk0ejN+WLaCMmVLGzQEC7Y/XzbtKz2kiJyV4=; b=UYOPUsbn+7/7UrijxFqeDU3lO44oogP+nkyGpQCKkD/S/82EWBTQ0HeXRcEcNnLHGB9UQX RHjkDZc8CfLQOUC2O9DaUNqiy+boNUqGiHuh7XFJX5dbdrsl0H3YWA+dwJyI0JjXcGWWq/ ZIg0BAe2tb1oyj+cj5gjQDoBCxLZUNitCDVYxnnAByu98j6sY7xFcnkL5yLOZSf6rTGTTu GO0RXtjkqXLs9JDrVcOXPqMecBkPFqqFUFzqdKMBSX8oPGXcvtq800LDle9IqOgjsgLLiw iuNsvHvJIfIY6Y2b4QCPzZ3VSqTO+jHwDTDVdLJ/bPs+0+kQEQIrRSHAAFOUiA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/3] Add systemd service file to launch bricklayer in first install mode. Date: Fri, 24 Feb 2023 17:36:04 +0100 Message-Id: <20230224163605.90519-2-stefan.schantl@ipfire.org> In-Reply-To: <20230224163605.90519-1-stefan.schantl@ipfire.org> References: <20230224163605.90519-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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 --- .../bricklayer-first-install.service.in | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/systemd/bricklayer-first-install.service.in b/src/systemd/bricklayer-first-install.service.in index e69de29..2ba2dd5 100644 --- a/src/systemd/bricklayer-first-install.service.in +++ b/src/systemd/bricklayer-first-install.service.in @@ -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