summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2015-01-25 16:33:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 15:36:49 +0000
commit0d5ac1a1def4f919b5d9f8cbf949fbaef7a5744d (patch)
tree57b313858d3942b9af588672ce1917ba0dbe00b6 /meta
parent29de3d27c245cec2f37468d38046396290da04c9 (diff)
downloadpoky-0d5ac1a1def4f919b5d9f8cbf949fbaef7a5744d.tar.gz
udev: fix ptest rule syntax check
The ptest which checks for correct udev rules fails. Missing files and paths for the build host caused this. (From OE-Core rev: 2c9773e71ed757f1ff3306eb716d22a71defeb25) Signed-off-by: Max Krummenacher <max.oss.09@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/udev/udev.inc3
-rw-r--r--meta/recipes-core/udev/udev/add-install-ptest.patch17
-rw-r--r--meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch59
3 files changed, 76 insertions, 3 deletions
diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
index 280da10b48..24463b1d71 100644
--- a/meta/recipes-core/udev/udev.inc
+++ b/meta/recipes-core/udev/udev.inc
@@ -27,11 +27,12 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
27 file://udev-cache \ 27 file://udev-cache \
28 file://udev-cache.default \ 28 file://udev-cache.default \
29 file://add-install-ptest.patch \ 29 file://add-install-ptest.patch \
30 file://fix_rule-syntax-regex-ptest.patch \
30 file://run-ptest \ 31 file://run-ptest \
31 file://init" 32 file://init"
32 33
33inherit autotools pkgconfig update-rc.d ptest 34inherit autotools pkgconfig update-rc.d ptest
34RDEPENDS_${PN}-ptest += "make perl" 35RDEPENDS_${PN}-ptest += "make perl python"
35 36
36libexecdir = "${base_libdir}" 37libexecdir = "${base_libdir}"
37EXTRA_OECONF = "--disable-introspection \ 38EXTRA_OECONF = "--disable-introspection \
diff --git a/meta/recipes-core/udev/udev/add-install-ptest.patch b/meta/recipes-core/udev/udev/add-install-ptest.patch
index 0f8e9b6588..755946a4d7 100644
--- a/meta/recipes-core/udev/udev/add-install-ptest.patch
+++ b/meta/recipes-core/udev/udev/add-install-ptest.patch
@@ -8,19 +8,32 @@ Signed-off-by: Björn Stenberg <bjst@enea.com>
8Signed-off-by: Alexandra Safta <alst@enea.com> 8Signed-off-by: Alexandra Safta <alst@enea.com>
9Upstream-Status: Pending 9Upstream-Status: Pending
10 10
11Add missing files for rule-syntax-check
12- Add rule-syntax-check.py
13- Add the deployed udev rules to the testdata
14
15Signed-off-by: Max Krummenacher <max.oss.09@gmail.com>
16Upstream-Status: Pending
11--- a/Makefile.am 2012-03-18 16:28:14.000000000 +0100 17--- a/Makefile.am 2012-03-18 16:28:14.000000000 +0100
12+++ b/Makefile.am 2013-02-18 10:03:36.531101244 +0100 18+++ b/Makefile.am 2013-02-18 10:03:36.531101244 +0100
13@@ -708,3 +708,11 @@ 19@@ -708,3 +708,18 @@
14 for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done 20 for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done
15 for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done 21 for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
16 for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done 22 for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done
17+ 23+
24+RULES = rules/* src/accelerometer/61-accelerometer.rules \
25+ src/cdrom_id/60-cdrom_id.rules \
26+ src/keymap/95-keyboard-force-release.rules src/keymap/95-keymap.rules \
27+ src/mtd_probe/75-probe_mtd.rules src/v4l_id/60-persistent-v4l.rules
28+
18+install-ptest: 29+install-ptest:
19+ install test-udev $(DESTDIR) 30+ install test-udev $(DESTDIR)
20+ cp Makefile $(DESTDIR) 31+ cp Makefile $(DESTDIR)
21+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile 32+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
22+ $(MKDIR_P) $(DESTDIR)/test 33+ install -d $(DESTDIR)/test $(DESTDIR)/rules
23+ (cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test) 34+ (cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test)
35+ (cd $(top_srcdir) && install test/rule-syntax-check.py $(DESTDIR)/test)
36+ (cd $(top_srcdir) && install $(RULES) $(DESTDIR)/rules)
24+ tar -C $(DESTDIR)/test/ -xJf $(top_srcdir)/test/sys.tar.xz 37+ tar -C $(DESTDIR)/test/ -xJf $(top_srcdir)/test/sys.tar.xz
25--- a/test/udev-test.pl 2012-03-18 16:43:36.000000000 +0100 38--- a/test/udev-test.pl 2012-03-18 16:43:36.000000000 +0100
26+++ b/test/udev-test.pl 2013-02-18 10:31:29.706357321 +0100 39+++ b/test/udev-test.pl 2013-02-18 10:31:29.706357321 +0100
diff --git a/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch b/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch
new file mode 100644
index 0000000000..548a241d8a
--- /dev/null
+++ b/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch
@@ -0,0 +1,59 @@
1The rule-syntax-check script fails with errors like this:
2
3Invalid line /lib/udev/rules.d/95-keymap.rules:49: ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", ATTR{[dmi/id]product_name}=="W3J", RUN+="keymap $name module-asus-w3j"
4(' clause:', 'ATTR{[dmi/id]product_name}=="W3J"')
5()
6
7
8Move line comment from end of rules file to its own line, the regex used to
9test correct syntax choke on it.
10
11The rule-syntax-check.py uses regex which errournessly complains on ATTR rules
12of the form ATTR{[dmi/id]board_name}=="30B7"
13Use the regex from systemd's script which allow [] characters and additional
14compare operators
15
16The Makefile passes rules-test.sh script a build host path to the testdata.
17Ignore the argument and use a relative path instead.
18
19
20Signed-off-by: Max Krummenacher <max.oss.09@gmail.com>
21Upstream status pending
22Upstream status Inappropriate (cross environment path)
23
24diff -Naur udev-182.orig/src/keymap/95-keymap.rules udev-182/src/keymap/95-keymap.rules
25--- udev-182.orig/src/keymap/95-keymap.rules 2012-02-07 00:01:55.154640792 +0100
26+++ udev-182/src/keymap/95-keymap.rules 2015-01-24 20:58:40.156930520 +0100
27@@ -94,7 +94,8 @@
28 ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP G62 Notebook PC", RUN+="keymap $name 0xB2 www"
29 ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP ProBook*", RUN+="keymap $name 0xF8 rfkill"
30 # HP Pavillion dv6315ea has empty DMI_VENDOR
31-ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play
32+# "quick play"
33+ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media"
34
35 # Gateway clone of Acer Aspire One AOA110/AOA150
36 ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer"
37diff -Naur udev-182.orig/test/rule-syntax-check.py udev-182/test/rule-syntax-check.py
38--- udev-182.orig/test/rule-syntax-check.py 2012-02-15 20:10:12.872333342 +0100
39+++ udev-182/test/rule-syntax-check.py 2015-01-24 21:08:00.496049600 +0100
40@@ -28,7 +28,7 @@
41 no_args_tests = re.compile('(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$')
42 args_tests = re.compile('(ATTRS?|ENV|TEST){([a-zA-Z0-9/_.*%-]+)}\s*(?:=|!)=\s*"([^"]*)"$')
43 no_args_assign = re.compile('(NAME|SYMLINK|OWNER|GROUP|MODE|TAG|PROGRAM|RUN|LABEL|GOTO|WAIT_FOR|OPTIONS|IMPORT)\s*(?:\+=|:=|=)\s*"([^"]*)"$')
44-args_assign = re.compile('(ATTR|ENV|IMPORT){([a-zA-Z0-9/_.*%-]+)}\s*=\s*"([^"]*)"$')
45+args_assign = re.compile('(ATTR|ENV|IMPORT|RUN){([][a-zA-Z0-9/_.*%-]+)}\s*(=|==|\+=)\s*"([^"]*)"$')
46
47 result = 0
48 buffer = ''
49--- udev-182.orig/test/rules-test.sh 2012-01-29 01:15:46.000000000 +0100
50+++ udev-182/test/rules-test.sh 2015-01-24 17:53:51.201858658 +0100
51@@ -4,7 +4,7 @@
52 # (C) 2010 Canonical Ltd.
53 # Author: Martin Pitt <martin.pitt@ubuntu.com>
54
55-[ -n "$srcdir" ] || srcdir=`dirname $0`/..
56+srcdir=`dirname $0`/..
57
58 # skip if we don't have python
59 type python >/dev/null 2>&1 || {