mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] tpm2-tss: Fix conflict with SYSTEMD_UDEV_CUST_RULES
@ 2022-06-27 12:06 Thorsten Scherer
  2022-07-01  5:38 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Scherer @ 2022-06-27 12:06 UTC (permalink / raw)
  To: ptxdist; +Cc: Thorsten Scherer, mkl

The target root.tgz fails with:

 * check_data_file_clashes: Package systemd wants to install file
   <BSP-PATH>/platform-<XYZ>/build-target/image-root-tgz/usr/lib/udev/rules.d/70-tpm-udev.rules
        But that file is already provided by package  * tpm2-tss

Add a check to avoid conflicts.

Signed-off-by: Thorsten Scherer <t.scherer@eckelmann.de>
---
 rules/tpm2-tss.in   | 12 ++++++++++++
 rules/tpm2-tss.make |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/rules/tpm2-tss.in b/rules/tpm2-tss.in
index 75d32188c..8eeb4b5c7 100644
--- a/rules/tpm2-tss.in
+++ b/rules/tpm2-tss.in
@@ -22,3 +22,15 @@ config TPM2_TSS
 	  This package contains the TSS and TCTI libraries that client
 	  applications will link against when they require accessing
 	  the TPM.
+
+if TPM2_TSS
+
+comment "tpm2-tss install udev rules conflicts SYSTEMD_UDEV_CUST_RULES"
+	depends on SYSTEMD_UDEV_CUST_RULES
+
+config TPM2_TSS_INSTALL_UDEV_RULES
+	bool
+	prompt "tpm2-tss install udev rules"
+	depends on !SYSTEMD_UDEV_CUST_RULES
+
+endif
diff --git a/rules/tpm2-tss.make b/rules/tpm2-tss.make
index 7e0b4ff52..8c948a57a 100644
--- a/rules/tpm2-tss.make
+++ b/rules/tpm2-tss.make
@@ -92,8 +92,10 @@ $(STATEDIR)/tpm2-tss.targetinstall:
 	@$(call install_lib, tpm2-tss, 0, 0, 0644, libtss2-tctildr)
 	@$(call install_lib, tpm2-tss, 0, 0, 0644, libtss2-rc)
 
+ifdef TPM2_TSS_INSTALL_UDEV_RULES
 	@$(call install_alternative, tpm2-tss, 0, 0, 0644, \
 		/usr/lib/udev/rules.d/70-tpm-udev.rules)
+endif
 
 	@$(call install_finish, tpm2-tss)
 
-- 
2.30.2




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

* Re: [ptxdist] [PATCH] tpm2-tss: Fix conflict with SYSTEMD_UDEV_CUST_RULES
  2022-06-27 12:06 [ptxdist] [PATCH] tpm2-tss: Fix conflict with SYSTEMD_UDEV_CUST_RULES Thorsten Scherer
@ 2022-07-01  5:38 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2022-07-01  5:38 UTC (permalink / raw)
  To: Thorsten Scherer; +Cc: mkl, ptxdist

On Mon, Jun 27, 2022 at 02:06:29PM +0200, Thorsten Scherer wrote:
> The target root.tgz fails with:
> 
>  * check_data_file_clashes: Package systemd wants to install file
>    <BSP-PATH>/platform-<XYZ>/build-target/image-root-tgz/usr/lib/udev/rules.d/70-tpm-udev.rules
>         But that file is already provided by package  * tpm2-tss
> 
> Add a check to avoid conflicts.

Nack. With this patch, if you have files in
projectroot/usr/lib/udev/rules.d/70-tpm-udev.rules/ in your BSP but no
custom 70-tpm-udev.rules there, then 70-tpm-udev.rules will not be
installed at all.

SYSTEMD_UDEV_CUST_RULES is broken. It will conflict with other packages
that want to install udev rules in various ways and there is no way to fix
this. You need to be very careful where you put udev rules. Or better,
don't use SYSTEMD_UDEV_CUST_RULES and install the rule with whatever
package that actually needs it.

Michael

> Signed-off-by: Thorsten Scherer <t.scherer@eckelmann.de>
> ---
>  rules/tpm2-tss.in   | 12 ++++++++++++
>  rules/tpm2-tss.make |  2 ++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/rules/tpm2-tss.in b/rules/tpm2-tss.in
> index 75d32188c..8eeb4b5c7 100644
> --- a/rules/tpm2-tss.in
> +++ b/rules/tpm2-tss.in
> @@ -22,3 +22,15 @@ config TPM2_TSS
>  	  This package contains the TSS and TCTI libraries that client
>  	  applications will link against when they require accessing
>  	  the TPM.
> +
> +if TPM2_TSS
> +
> +comment "tpm2-tss install udev rules conflicts SYSTEMD_UDEV_CUST_RULES"
> +	depends on SYSTEMD_UDEV_CUST_RULES
> +
> +config TPM2_TSS_INSTALL_UDEV_RULES
> +	bool
> +	prompt "tpm2-tss install udev rules"
> +	depends on !SYSTEMD_UDEV_CUST_RULES
> +
> +endif
> diff --git a/rules/tpm2-tss.make b/rules/tpm2-tss.make
> index 7e0b4ff52..8c948a57a 100644
> --- a/rules/tpm2-tss.make
> +++ b/rules/tpm2-tss.make
> @@ -92,8 +92,10 @@ $(STATEDIR)/tpm2-tss.targetinstall:
>  	@$(call install_lib, tpm2-tss, 0, 0, 0644, libtss2-tctildr)
>  	@$(call install_lib, tpm2-tss, 0, 0, 0644, libtss2-rc)
>  
> +ifdef TPM2_TSS_INSTALL_UDEV_RULES
>  	@$(call install_alternative, tpm2-tss, 0, 0, 0644, \
>  		/usr/lib/udev/rules.d/70-tpm-udev.rules)
> +endif
>  
>  	@$(call install_finish, tpm2-tss)
>  
> -- 
> 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] 2+ messages in thread

end of thread, other threads:[~2022-07-01  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 12:06 [ptxdist] [PATCH] tpm2-tss: Fix conflict with SYSTEMD_UDEV_CUST_RULES Thorsten Scherer
2022-07-01  5:38 ` Michael Olbrich

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