From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from secure12.t-systems.com ([46.29.101.2]) by metis.ext.pengutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YqJVx-0003Pe-Gq for ptxdist@pengutronix.de; Thu, 07 May 2015 12:58:49 +0200 Received: from p50989a7d.dip0.t-ipconnect.de ([80.152.154.125] helo=MAIL-10-4.ATS-Intranet.local) by secure12.t-systems.com with smtp (envelope-from ) id 1YqJVq-0001gW-B7 for ptxdist@pengutronix.de; Thu, 07 May 2015 12:58:42 +0200 Received: from [10.2.1.246] (helo=mail-10-4.ATS-Intranet.local) by MAIL-10-4.ATS-Intranet.local with G Data MailSecurity; for ; Thu, 7 May 2015 12:58:39 +0200 Message-ID: <554B455E.6070505@atsonline.de> Date: Thu, 7 May 2015 12:58:38 +0200 From: Andreas Geisenhainer MIME-Version: 1.0 References: <554B3561.3030404@atsonline.de> <554B37F2.1090903@atsonline.de> <201505071216.45442.jbe@pengutronix.de> In-Reply-To: <201505071216.45442.jbe@pengutronix.de> Content-Type: multipart/mixed; boundary="------------060501020400020901070103" Subject: Re: [ptxdist] custom udev rules and platform dependent projectroot List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de --------------060501020400020901070103 Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit On 07/05/15 12:16 PM, Jürgen Borleis wrote: > Why not "PTXDIST_PLATFORMCONFIGDIR" which always points to the currently used > platform directory? > > -> $PTXDIST_PLATFORMCONFIGDIR/projectroot/lib/udev/rules.d/ Even better, thanks. :) I was not aware of this variable and apparently unable to fully utilize grep. regards, Andreas --------------060501020400020901070103 Content-Type: text/x-patch; name="0001-enabled-copy-of-custom-udev-rules-within-platform-de.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-enabled-copy-of-custom-udev-rules-within-platform-de.pa"; filename*1="tch" >From 77330ea436c87c79279bb2878ac13a0575a8ab68 Mon Sep 17 00:00:00 2001 From: Andreas Geisenhainer Date: Thu, 7 May 2015 12:39:06 +0200 Subject: [PATCH] enabled copy of custom udev rules within platform dependent projectroot directory enable checking for custom udev rules in "/projectroot/lib/udev/rules.d/" and copying them into target system Signed-off-by: Andreas Geisenhainer --- rules/udev.in | 4 +++- rules/udev.make | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/rules/udev.in b/rules/udev.in index e64a1a9..5269f34 100644 --- a/rules/udev.in +++ b/rules/udev.in @@ -102,7 +102,9 @@ config UDEV_CUST_RULES prompt "install customized udev rules" help This will install the customized udev rules files from - projectroot/lib/udev/rules.d into /lib/udev/rules.d + projectroot/lib/udev/rules.d and + /projectroot/lib/udev/rules.d + into /lib/udev/rules.d config UDEV_LIBUDEV bool diff --git a/rules/udev.make b/rules/udev.make index dffb91d..a3c0e33 100644 --- a/rules/udev.make +++ b/rules/udev.make @@ -206,15 +206,24 @@ ifdef PTXCONF_UDEV_KEYMAPS endif ifdef PTXCONF_UDEV_CUST_RULES - @if [ -d $(PTXDIST_WORKSPACE)/projectroot/lib/udev/rules.d/ ]; then \ + @GOT_PROOT=0; \ + if [ -d $(PTXDIST_WORKSPACE)/projectroot/lib/udev/rules.d/ ]; then \ $(call install_tree, udev, 0, 0, \ $(PTXDIST_WORKSPACE)/projectroot/lib/udev/rules.d, \ /lib/udev/rules.d); \ - else \ - echo "UDEV_CUST_RULES is enabled but Directory containing" \ - "customized udev rules is missing!"; \ + GOT_PROOT=$$(($$GOT_PROOT + 1)); \ + fi; \ + if [ -d $(PTXDIST_PLATFORMCONFIGDIR)/projectroot/lib/udev/rules.d/ ]; then \ + $(call install_tree, udev, 0, 0, \ + $(PTXDIST_PLATFORMCONFIGDIR)/projectroot/lib/udev/rules.d, \ + /lib/udev/rules.d); \ + GOT_PROOT=$$(($$GOT_PROOT + 1)); \ + fi; \ + if [ \$GOT_PROOT -eq 0 ]; then \ + echo "UDEV_CUST_RULES is enabled but no Directory containing" \ + "customized udev rules was found!"; \ exit 1; \ - fi + fi; endif @$(foreach helper, $(UDEV_HELPER-y), \ -- 2.1.4 --------------060501020400020901070103 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline LS0gCnB0eGRpc3QgbWFpbGluZyBsaXN0CnB0eGRpc3RAcGVuZ3V0cm9uaXguZGUK --------------060501020400020901070103--