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

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


Hello.

I expected the udev.make to look for custom rules in the platform 
projectroot
(<PTXDIST_WORKSPACE>/configs/<platform>/projectroot/lib/udev/rules.d/),
but it didn't for me.

The patch expands the path from the PTXCONF_PLATFORM variable, which
chooses the configured platform from multiple potential platforms.


regards,
Andreas Geisenhainer


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

From 94053170a999c83476c4d7ec30d2b5f6abd858b8 Mon Sep 17 00:00:00 2001
From: Andreas Geisenhainer <Andreas.Geisenhainer@atsonline.de>
Date: Wed, 6 May 2015 14:23:21 +0200
Subject: [PATCH] enabled copy of custom udev rules within platform dependent
 projectroot directory

enable checking for custom udev rules in
"<PTXDIST_WORKSPACE>/configs/<platform>/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..3146606 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
+	  configs/<platform>/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..28f8280 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_WORKSPACE)/configs/$(wildcard *$(PTXCONF_PLATFORM)*)/projectroot/lib/udev/rules.d/ ]; then \
+		$(call install_tree, udev, 0, 0, \
+			$(PTXDIST_WORKSPACE)/configs/$(wildcard *$(PTXCONF_PLATFORM)*)/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:01 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 [this message]
2015-05-07 10:16   ` Jürgen Borleis
2015-05-07 10:58     ` Andreas Geisenhainer
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=554B37F2.1090903@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