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

>From 77330ea436c87c79279bb2878ac13a0575a8ab68 Mon Sep 17 00:00:00 2001
From: Andreas Geisenhainer <[email protected]>
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 <[email protected]>
---
 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

-- 
ptxdist mailing list
[email protected]

Reply via email to