From mboxrd@z Thu Jan  1 00:00:00 1970
Delivery-date: Fri, 25 Jun 2021 13:29:50 +0200
Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33])
	by lore.white.stw.pengutronix.de with esmtp (Exim 4.92)
	(envelope-from <distrokit-bounces+lore=lore.pengutronix.de@pengutronix.de>)
	id 1lwk1u-0003rG-Lg
	for lore@lore.pengutronix.de; Fri, 25 Jun 2021 13:29:50 +0200
Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de)
	by metis.ext.pengutronix.de with esmtp (Exim 4.92)
	(envelope-from <distrokit-bounces@pengutronix.de>)
	id 1lwk1t-0004Lw-W0; Fri, 25 Jun 2021 13:29:49 +0200
Received: from mail.thorsis.com ([92.198.35.195])
 by metis.ext.pengutronix.de with esmtps
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <ada@thorsis.com>)
 id 1lwk1q-0004Lj-Rd; Fri, 25 Jun 2021 13:29:47 +0200
Received: from localhost (localhost [127.0.0.1])
 by mail.thorsis.com (Postfix) with ESMTP id 19B4D4E;
 Fri, 25 Jun 2021 13:29:46 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.thorsis.com
Received: from mail.thorsis.com ([127.0.0.1])
 by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id WbgY4qj-YdOt; Fri, 25 Jun 2021 13:29:46 +0200 (CEST)
Received: by mail.thorsis.com (Postfix, from userid 109)
 id E987B2A4E; Fri, 25 Jun 2021 13:29:45 +0200 (CEST)
From: Alexander Dahl <ada@thorsis.com>
To: distrokit@pengutronix.de
Date: Fri, 25 Jun 2021 13:29:41 +0200
Message-ID: <2990520.xpvgETS0Is@ada>
In-Reply-To: <20210625112214.GG25044@pengutronix.de>
References: <20210625111546.18971-1-ada@thorsis.com>
 <20210625112214.GG25044@pengutronix.de>
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 metis.ext.pengutronix.de
X-Spam-Level: 
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,BAYES_00,SPF_HELO_NONE,
 SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2
Subject: Re: [DistroKit] [PATCH] datapartition: Let systemd install custom
 udev rule
X-BeenThere: distrokit@pengutronix.de
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DistroKit Mailinglist <distrokit.pengutronix.de>
List-Unsubscribe: <http://metis.pengutronix.de/cgi-bin/mailman/options/distrokit>, 
 <mailto:distrokit-request@pengutronix.de?subject=unsubscribe>
List-Archive: <http://metis.pengutronix.de/cgi-bin/mailman/private/distrokit/>
List-Post: <mailto:distrokit@pengutronix.de>
List-Help: <mailto:distrokit-request@pengutronix.de?subject=help>
List-Subscribe: <http://metis.pengutronix.de/cgi-bin/mailman/listinfo/distrokit>, 
 <mailto:distrokit-request@pengutronix.de?subject=subscribe>
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "DistroKit" <distrokit-bounces@pengutronix.de>
X-SA-Exim-Connect-IP: 127.0.0.1
X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false

Hei hei,

Am Freitag, 25. Juni 2021, 13:22:14 CEST schrieb Michael Olbrich:
> Hi,
> 
> On Fri, Jun 25, 2021 at 01:15:46PM +0200, Alexander Dahl wrote:
> > If DistroKit is used as a base layer and any upper layer enables
> > PTXCONF_SYSTEMD_UDEV_CUST_RULES, package installation might fail because
> > both packages, 'systemd' and 'datapartition' try to targetinstall
> > 
> > 'usr/lib/udev/rules.d/91-mkfs-ext4.rules', like this:
> >     Collected errors:
> >      * check_data_file_clashes: Package datapartition wants to install
> >      file
> >      /home/adahl/Work/bsp/xxx/base/platform-v7a/build-target/image-root-t
> >      gz/usr/lib/udev/rules.d/91-mkfs-ext4.rules>      
> >             But that file is already provided by package  * systemd
> >      
> >      * opkg_solver_install: Cannot install package datapartition.
> >     
> >     make: ***
> >     [/usr/local/lib/ptxdist-2021.02.0/rules/image-root-tgz.make:30:
> >     /home/adahl/Work/bsp/xxx/base/platform-v7a/images/root.tgz] Error 255
> NACK.
> 
> An now 91-mkfs-ext4.rules won't be installed unless it is copied into each
> layer that provides udev rules. Don't use SYSTEMD_UDEV_CUST_RULES with
> layers. It doesn't work properly.

Well, I tested it with ptxdist-2021.02.0 and BSP using DistroKit-2021.02.0 as 
base layer.  That file 91-mkfs-ext4.rules was actually copied, and I did not 
duplicate it into the upper layer before.

Was there a post ptxdist-2021.02.0 change preventing that conflict outlined 
above?

However, and that's probably also against this approach: the file won't get 
copied anymore if someone disables SYSTEMD_UDEV_CUST_RULES in an upper layer 
for any reason?

So, if I want to install my own custem udev rule from an upper layer, what am 
I supposed to do, if SYSTEMD_UDEV_CUST_RULES is a no go? Create another 
package like 'datapartition' for just installing that one file?

Greets
Alex

> 
> Michael
> 
> > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > ---
> > 
> >  configs/ptxconfig        | 2 +-
> >  rules/datapartition.make | 2 --
> >  2 files changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/configs/ptxconfig b/configs/ptxconfig
> > index c97e321..a4fa7e9 100644
> > --- a/configs/ptxconfig
> > +++ b/configs/ptxconfig
> > @@ -1437,7 +1437,7 @@ PTXCONF_SYSTEMD_ZSTD=y
> > 
> >  #
> >  PTXCONF_SYSTEMD_UDEV_DRIVERS_RULES=y
> >  # PTXCONF_SYSTEMD_UDEV_HWDB is not set
> > 
> > -# PTXCONF_SYSTEMD_UDEV_CUST_RULES is not set
> > +PTXCONF_SYSTEMD_UDEV_CUST_RULES=y
> > 
> >  # end of install options
> >  
> >  #
> > 
> > diff --git a/rules/datapartition.make b/rules/datapartition.make
> > index b79bcf0..7f3c992 100644
> > --- a/rules/datapartition.make
> > +++ b/rules/datapartition.make
> > 
> > @@ -28,8 +28,6 @@ $(STATEDIR)/datapartition.targetinstall:
> >  	@$(call install_alternative, datapartition, 0, 0, 0644, \
> >  	
> >  		/usr/lib/systemd/system/systemd-autoformat@.service)
> > 
> > -	@$(call install_alternative, datapartition, 0, 0, 0644, \
> > -		/usr/lib/udev/rules.d/91-mkfs-ext4.rules)
> > 
> >  	@$(call install_finish,datapartition)
> > 
> > base-commit: 085bb9b4273c8fd91105d9e149776f144f5fdd65





_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de