From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 21 Mar 2023 12:18:04 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pea0B-0096D1-Uv for lore@lore.pengutronix.de; Tue, 21 Mar 2023 12:18:04 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pea0C-0003Fb-0Z; Tue, 21 Mar 2023 12:18:04 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1peZzl-0003EX-QY; Tue, 21 Mar 2023 12:17:37 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1peZzl-005fvn-74; Tue, 21 Mar 2023 12:17:37 +0100 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1peZzk-00F1MF-IZ; Tue, 21 Mar 2023 12:17:36 +0100 From: Roland Hieber To: ptxdist@pengutronix.de Date: Tue, 21 Mar 2023 12:17:35 +0100 Message-Id: <20230321111735.3580081-1-rhi@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH v2] systemd: add option to install systemd-repart X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Roland Hieber Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false It runs on first boot via systemd-repart.service only if config files are present, which users need to supply in a separate package. Signed-off-by: Roland Hieber --- v1 -> v2: * don't install /usr/lib/repart.d, notice the user in the kconfig help text that they should come from a separate package. rules/systemd.in | 9 +++++++++ rules/systemd.make | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/rules/systemd.in b/rules/systemd.in index 00d922a05c0a..0f47386844dc 100644 --- a/rules/systemd.in +++ b/rules/systemd.in @@ -19,6 +19,7 @@ menuconfig SYSTEMD select LIBKMOD_TOOLS select UTIL_LINUX select UTIL_LINUX_LIBMOUNT + select UTIL_LINUX_LIBFDISK if SYSTEMD_REPART select MACHINE_ID if RUNTIME select XZ if SYSTEMD_XZ select LZ4 if SYSTEMD_LZ4 @@ -170,6 +171,14 @@ config SYSTEMD_NSPAWN bool prompt "install systemd-nspawn" +config SYSTEMD_REPART + bool + prompt "install systemd-repart" + help + systemd-repart repartitions the disk on system boot if configuration + files are present. You should install these files in a separate + PTXdist package, or call systemd-repart explicitely. + config SYSTEMD_DEFAULT_NET_NAMING_SCHEME string prompt "default net.naming-scheme= value" diff --git a/rules/systemd.make b/rules/systemd.make index d42ab860624e..9cf97acbd4a7 100644 --- a/rules/systemd.make +++ b/rules/systemd.make @@ -86,7 +86,7 @@ SYSTEMD_CONF_OPT := \ -Delfutils=$(call ptx/truefalse,PTXCONF_SYSTEMD_COREDUMP) \ -Denvironment-d=false \ -Dfallback-hostname=$(call ptx/ifdef,PTXCONF_ROOTFS_ETC_HOSTNAME,$(PTXCONF_ROOTFS_ETC_HOSTNAME),ptxdist) \ - -Dfdisk=false \ + -Dfdisk=$(call ptx/truefalse,PTXCONF_SYSTEMD_REPART) \ -Dfexecve=false \ -Dfirstboot=false \ -Dfuzz-tests=false \ @@ -162,7 +162,7 @@ SYSTEMD_CONF_OPT := \ -Dquotaon-path=/usr/sbin/quotaon \ -Drandomseed=$(call ptx/falsetrue,PTXCONF_SYSTEMD_DISABLE_RANDOM_SEED) \ -Dremote=$(call ptx/ifdef,PTXCONF_SYSTEMD_JOURNAL_REMOTE,auto,false) \ - -Drepart=false \ + -Drepart=$(call ptx/truefalse,PTXCONF_SYSTEMD_REPART) \ -Dresolve=$(call ptx/truefalse,PTXCONF_SYSTEMD_NETWORK) \ -Drfkill=false \ -Dseccomp=$(call ptx/truefalse,PTXCONF_SYSTEMD_SECCOMP) \ @@ -381,6 +381,10 @@ ifdef PTXCONF_SYSTEMD_NSPAWN @$(call install_copy, systemd, 0, 0, 0755, -, /usr/bin/systemd-nspawn) endif +ifdef PTXCONF_SYSTEMD_REPART + @$(call install_copy, systemd, 0, 0, 0755, -, /usr/bin/systemd-repart) +endif + @$(call install_tree, systemd, 0, 0, -, /usr/lib/systemd/system-generators/) @$(foreach helper, $(SYSTEMD_HELPER), \ $(call install_copy, systemd, 0, 0, 0755, -, \ -- 2.30.2