]> code.ossystems Code Review - openembedded-core.git/commitdiff
busybox/find-touchscreen.sh: Simplify script and recognize USB devices
authormike.looijmans@topic.nl <mike.looijmans@topic.nl>
Thu, 18 Dec 2014 14:17:29 +0000 (15:17 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Dec 2014 18:06:46 +0000 (18:06 +0000)
Simplify the grep expression, use the more common "grep" command instead
of "egrep", avoid forking extra processes, join multiple invokations into
a single combined expression.

Change the touchscreen regex so that it also recognizes various USB
touchscreen controllers and the ad7879 i2c device.

Based on code used in OpenPLi and meta-topic.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/busybox/files/find-touchscreen.sh

index 1582ea891c26fcbbcbb68460ee8b3cff86ba413b..52c5e7a096ddab481a111fdee2639b56a9a14020 100644 (file)
@@ -1,9 +1,6 @@
 #!/bin/sh
 
-if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
-       ln -sf /dev/input/$MDEV /dev/input/touchscreen0
+if grep -q "input:.*-e0.*,3,.*a0,1,\|ads7846" /sys/class/$MDEV/device/modalias ; then
+       ln -sf /dev/$MDEV /dev/input/touchscreen0
 fi
 
-if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
-       ln -sf /dev/input/$MDEV /dev/input/touchscreen0
-fi