* [ptxdist] custom udev rules and platform dependent projectroot
[not found] <554B3561.3030404@atsonline.de>
@ 2015-05-07 10:01 ` Andreas Geisenhainer
2015-05-07 10:16 ` Jürgen Borleis
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Geisenhainer @ 2015-05-07 10:01 UTC (permalink / raw)
To: ptxdist
[-- 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] custom udev rules and platform dependent projectroot
2015-05-07 10:01 ` [ptxdist] custom udev rules and platform dependent projectroot Andreas Geisenhainer
@ 2015-05-07 10:16 ` Jürgen Borleis
2015-05-07 10:58 ` Andreas Geisenhainer
0 siblings, 1 reply; 4+ messages in thread
From: Jürgen Borleis @ 2015-05-07 10:16 UTC (permalink / raw)
To: ptxdist; +Cc: Andreas Geisenhainer
Hi Andreas,
On Thursday 07 May 2015 12:01:22 Andreas Geisenhainer wrote:
> 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.
Why not "PTXDIST_PLATFORMCONFIGDIR" which always points to the currently used
platform directory?
-> $PTXDIST_PLATFORMCONFIGDIR/projectroot/lib/udev/rules.d/
You shouldn't guess this directory via wildcards.
Regards,
Juergen
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] custom udev rules and platform dependent projectroot
2015-05-07 10:16 ` Jürgen Borleis
@ 2015-05-07 10:58 ` Andreas Geisenhainer
2015-05-07 13:24 ` Jürgen Borleis
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Geisenhainer @ 2015-05-07 10:58 UTC (permalink / raw)
To: ptxdist
[-- 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] custom udev rules and platform dependent projectroot
2015-05-07 10:58 ` Andreas Geisenhainer
@ 2015-05-07 13:24 ` Jürgen Borleis
0 siblings, 0 replies; 4+ messages in thread
From: Jürgen Borleis @ 2015-05-07 13:24 UTC (permalink / raw)
To: ptxdist; +Cc: Andreas Geisenhainer
Hi Andreas,
On Thursday 07 May 2015 12:58:38 Andreas Geisenhainer wrote:
> 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.
Section 5.1.11 in [1].
Regards,
Juergen
[1] http://www.pengutronix.de/software/ptxdist/appnotes/OSELAS.BSP-Pengutronix-Generic-arm-Quickstart.pdf
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-07 13:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <554B3561.3030404@atsonline.de>
2015-05-07 10:01 ` [ptxdist] custom udev rules and platform dependent projectroot Andreas Geisenhainer
2015-05-07 10:16 ` Jürgen Borleis
2015-05-07 10:58 ` Andreas Geisenhainer
2015-05-07 13:24 ` Jürgen Borleis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox