mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] systemd: add option to install systemd-repart
@ 2023-03-15 20:01 Roland Hieber
  2023-03-16 14:47 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Hieber @ 2023-03-15 20:01 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

It runs on first boot via systemd-repart.service, so don't install it by
default.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 rules/systemd.in   | 8 ++++++++
 rules/systemd.make | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/rules/systemd.in b/rules/systemd.in
index 00d922a05c0a..3829bb925a96 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,13 @@ config SYSTEMD_NSPAWN
 	bool
 	prompt "install systemd-nspawn"
 
+config SYSTEMD_REPART
+	bool
+	prompt "install systemd-repart"
+	help
+	  systemd-repart repartitions the disk on first start according to
+	  configuration files in /usr/lib/repart.d
+
 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..cd8c0bf9a70d 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,11 @@ 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)
+	@$(call install_alternative_tree, systemd, 0, 0, /usr/lib/repart.d/)
+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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] systemd: add option to install systemd-repart
  2023-03-15 20:01 [ptxdist] [PATCH] systemd: add option to install systemd-repart Roland Hieber
@ 2023-03-16 14:47 ` Michael Olbrich
  2023-03-21 11:17   ` [ptxdist] [PATCH v2] " Roland Hieber
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2023-03-16 14:47 UTC (permalink / raw)
  To: Roland Hieber, ptxdist

On Wed, Mar 15, 2023 at 09:01:31PM +0100, Roland Hieber wrote:
> It runs on first boot via systemd-repart.service, so don't install it by
> default.
> 
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  rules/systemd.in   | 8 ++++++++
>  rules/systemd.make | 9 +++++++--
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/rules/systemd.in b/rules/systemd.in
> index 00d922a05c0a..3829bb925a96 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,13 @@ config SYSTEMD_NSPAWN
>  	bool
>  	prompt "install systemd-nspawn"
>  
> +config SYSTEMD_REPART
> +	bool
> +	prompt "install systemd-repart"
> +	help
> +	  systemd-repart repartitions the disk on first start according to
> +	  configuration files in /usr/lib/repart.d
> +
>  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..cd8c0bf9a70d 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,11 @@ 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)

> +	@$(call install_alternative_tree, systemd, 0, 0, /usr/lib/repart.d/)

I don't think these configs should be installed here. Upstream systemd does
not provide any configs (for good reasons) so targetinstall will fail
unless this directory exists in the BSP. That's not acceptable for ptxdist
upstream.

And if a config is installed here on the target, then
systemd-repart.service runs at every boot and I don't think all use-cases
that want the systemd-repart tool will also want to run this service.

So I think the configuration should be in a separate package in the BSP.

Michael

> +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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH v2] systemd: add option to install systemd-repart
  2023-03-16 14:47 ` Michael Olbrich
@ 2023-03-21 11:17   ` Roland Hieber
  2023-03-24  9:03     ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Hieber @ 2023-03-21 11:17 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

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 <rhi@pengutronix.de>
---
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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [APPLIED] systemd: add option to install systemd-repart
  2023-03-21 11:17   ` [ptxdist] [PATCH v2] " Roland Hieber
@ 2023-03-24  9:03     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2023-03-24  9:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Thanks, applied as c5a6fa668f8ed80f12133d86ad37392d322893b7.

Michael

[sent from post-receive hook]

On Fri, 24 Mar 2023 10:03:40 +0100, Roland Hieber <rhi@pengutronix.de> wrote:
> 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 <rhi@pengutronix.de>
> Message-Id: <20230321111735.3580081-1-rhi@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> 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, -, \



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-24  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 20:01 [ptxdist] [PATCH] systemd: add option to install systemd-repart Roland Hieber
2023-03-16 14:47 ` Michael Olbrich
2023-03-21 11:17   ` [ptxdist] [PATCH v2] " Roland Hieber
2023-03-24  9:03     ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox