mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Thorsten Scherer <t.scherer@eckelmann.de>
Cc: mkl@pengutronix.de, ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] tpm2-tss: Fix conflict with SYSTEMD_UDEV_CUST_RULES
Date: Fri, 1 Jul 2022 07:38:07 +0200	[thread overview]
Message-ID: <Yr6IPyQg1s9O43TE@pengutronix.de> (raw)
In-Reply-To: <20220627120629.32925-1-t.scherer@eckelmann.de>

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 |



      reply	other threads:[~2022-07-01  5:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 12:06 Thorsten Scherer
2022-07-01  5:38 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yr6IPyQg1s9O43TE@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=mkl@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    --cc=t.scherer@eckelmann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox