diff mbox

[1/1] touch: New recipe. Input based on kernel events.

Message ID 7318e25e94ba45e546753bd27f442d2670801dcf.1395742435.git.kibo@prevas.dk
State Changes Requested
Delegated to: Esben Haabendal
Headers show

Commit Message

Kim Bøndergaard March 25, 2014, 10:16 a.m. UTC
Notice: Is known to match mdev environment from busybox version 1.21.0.
Version 1.19.4 will not work
---
 recipes/touch/files/mdev-event-helper.sh |  9 +++++++++
 recipes/touch/files/mdev.conf            |  1 +
 recipes/touch/touch.oe                   | 29 +++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 recipes/touch/files/mdev-event-helper.sh
 create mode 100644 recipes/touch/files/mdev.conf
 create mode 100644 recipes/touch/touch.oe

Comments

Esben Haabendal April 14, 2014, 12:18 p.m. UTC | #1
Kim Bøndergaard <kibo@prevas.dk> writes:

> Notice: Is known to match mdev environment from busybox version 1.21.0.
> Version 1.19.4 will not work

For OE-lite/base 3, which has busybox 1.19.4 as default, we really need
a version that works with both 1.19.4 and newer.  Is it just the
mdev-event-helper.sh that needs to be different? 

> ---
>  recipes/touch/files/mdev-event-helper.sh |  9 +++++++++
>  recipes/touch/files/mdev.conf            |  1 +
>  recipes/touch/touch.oe                   | 29 +++++++++++++++++++++++++++++
>  3 files changed, 39 insertions(+)
>  create mode 100644 recipes/touch/files/mdev-event-helper.sh
>  create mode 100644 recipes/touch/files/mdev.conf
>  create mode 100644 recipes/touch/touch.oe
>
> diff --git a/recipes/touch/files/mdev-event-helper.sh b/recipes/touch/files/mdev-event-helper.sh
> new file mode 100644
> index 0000000..8929589
> --- /dev/null
> +++ b/recipes/touch/files/mdev-event-helper.sh
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +[ -d /dev/input ] || mkdir /dev/input
> +
> +NAME=`cat /sys/class/$MDEV/device/name`
> +
> +
> +[ "$NAME" = "PLACEHOLDER_TOUCH_NAME" ] \
> +        && ln -sf /dev/$DEVNAME /dev/input/touch0
> +
> diff --git a/recipes/touch/files/mdev.conf b/recipes/touch/files/mdev.conf
> new file mode 100644
> index 0000000..7ba1718
> --- /dev/null
> +++ b/recipes/touch/files/mdev.conf
> @@ -0,0 +1 @@
> +event[0-9]	root:root	660	@/usr/bin/mdev-event-helper.sh
> diff --git a/recipes/touch/touch.oe b/recipes/touch/touch.oe
> new file mode 100644
> index 0000000..81257bc
> --- /dev/null
> +++ b/recipes/touch/touch.oe
> @@ -0,0 +1,29 @@
> +DESCRIPTION = """
> +Purpose of the touch recipe is to ensure a touch device being
> +deployed as /dev/eventX can always be reached using the name /dev/touch0
> +"""
> +LICENSE = "MIT"
> +
> +inherit mdev
> +
> +SRC_URI = """
> +	file://mdev.conf
> +	file://mdev-event-helper.sh
> +"""
> +
> +RECIPE_FLAGS += "touch-name"

As said in http://patchwork.ozlabs.org/patch/280609/ you should rename
the flag to use under-score instead of dash.

And the recipe should probably be renamed to something less generic than
"touch".  Perhaps something like "touch-mdev-helper".

> +
> +DEFAULT_USE_touch-name = "name of touch device"
> +
> +do_install () {
> +	install -d ${D}${bindir}
> +	install -m 0755 ${SRCDIR}/mdev-event-helper.sh ${D}${bindir}/
> +}
> +
> +do_install[postfuncs] += "do_install_touch_name_fixup"
> +do_install_touch_name_fixup() {
> +	sed -i -e 's/PLACEHOLDER_TOUCH_NAME/${USE_touch-name}/g' \
> +		${D}${bindir}/mdev-event-helper.sh
> +}
> +
> +

Please avoid trailing blank lines.

/Esben
diff mbox

Patch

diff --git a/recipes/touch/files/mdev-event-helper.sh b/recipes/touch/files/mdev-event-helper.sh
new file mode 100644
index 0000000..8929589
--- /dev/null
+++ b/recipes/touch/files/mdev-event-helper.sh
@@ -0,0 +1,9 @@ 
+#!/bin/sh
+[ -d /dev/input ] || mkdir /dev/input
+
+NAME=`cat /sys/class/$MDEV/device/name`
+
+
+[ "$NAME" = "PLACEHOLDER_TOUCH_NAME" ] \
+        && ln -sf /dev/$DEVNAME /dev/input/touch0
+
diff --git a/recipes/touch/files/mdev.conf b/recipes/touch/files/mdev.conf
new file mode 100644
index 0000000..7ba1718
--- /dev/null
+++ b/recipes/touch/files/mdev.conf
@@ -0,0 +1 @@ 
+event[0-9]	root:root	660	@/usr/bin/mdev-event-helper.sh
diff --git a/recipes/touch/touch.oe b/recipes/touch/touch.oe
new file mode 100644
index 0000000..81257bc
--- /dev/null
+++ b/recipes/touch/touch.oe
@@ -0,0 +1,29 @@ 
+DESCRIPTION = """
+Purpose of the touch recipe is to ensure a touch device being
+deployed as /dev/eventX can always be reached using the name /dev/touch0
+"""
+LICENSE = "MIT"
+
+inherit mdev
+
+SRC_URI = """
+	file://mdev.conf
+	file://mdev-event-helper.sh
+"""
+
+RECIPE_FLAGS += "touch-name"
+
+DEFAULT_USE_touch-name = "name of touch device"
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 ${SRCDIR}/mdev-event-helper.sh ${D}${bindir}/
+}
+
+do_install[postfuncs] += "do_install_touch_name_fixup"
+do_install_touch_name_fixup() {
+	sed -i -e 's/PLACEHOLDER_TOUCH_NAME/${USE_touch-name}/g' \
+		${D}${bindir}/mdev-event-helper.sh
+}
+
+