mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] custom udev rules and platform dependent projectroot
Date: Thu, 7 May 2015 12:58:38 +0200	[thread overview]
Message-ID: <554B455E.6070505@atsonline.de> (raw)
In-Reply-To: <201505071216.45442.jbe@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

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


[-- Attachment #2: 0001-enabled-copy-of-custom-udev-rules-within-platform-de.patch --]
[-- Type: text/x-patch, Size: 2218 bytes --]

From 77330ea436c87c79279bb2878ac13a0575a8ab68 Mon Sep 17 00:00:00 2001
From: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
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
"<PTXDIST_PLATFORMCONFIGDIR>/projectroot/lib/udev/rules.d/"
and copying them into target system

Signed-off-by: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
---
 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
+	  <PTXDIST_PLATFORMCONFIGDIR>/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


[-- Attachment #3: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2015-05-07 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <554B3561.3030404@atsonline.de>
2015-05-07 10:01 ` Andreas Geisenhainer
2015-05-07 10:16   ` Jürgen Borleis
2015-05-07 10:58     ` Andreas Geisenhainer [this message]
2015-05-07 13:24       ` Jürgen Borleis

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=554B455E.6070505@atsonline.de \
    --to=andreas.geisenhainer@atsonline.de \
    --cc=ptxdist@pengutronix.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