From patchwork Tue Mar 25 10:16:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kim_B=C3=B8ndergaard?= X-Patchwork-Id: 333362 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id B6E45140097 for ; Tue, 25 Mar 2014 21:16:35 +1100 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id D9EBA3F84D for ; Tue, 25 Mar 2014 11:16:31 +0100 (CET) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail01.prevas.se (mail01.prevas.se [62.95.78.3]) by hugin.dotsrc.org (Postfix) with ESMTPS id 76E4A3F84D for ; Tue, 25 Mar 2014 11:16:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=2031; q=dns/txt; s=ironport1; t=1395742591; x=1427278591; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=1IgfdUEBqLymhu+0EOgWucLoFUhWsUbALWl1OA6LZJQ=; b=vw8pVJ6nOvLk7D9ZyDygy7YrR6McmJ4g2kY9dPtzAcLHxpwlFgy3qusA F+/hdZU3IaaBmjmQplRUGZ6ixKzJ1hIwg7ZSmdDMVqs23JmOjPbtyA6/D 4kv+AhN0dYS79DzncHm8XHlnAlqMXB/DSyWEg2iJvtamwK46NhTYV5Kt7 U=; X-IronPort-AV: E=Sophos;i="4.97,728,1389740400"; d="scan'208";a="4531664" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport1.prevas.se with ESMTP/TLS/AES128-SHA; 25 Mar 2014 11:16:30 +0100 Received: from localhost (172.16.10.102) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server id 14.2.347.0; Tue, 25 Mar 2014 11:16:29 +0100 Received: by localhost (Postfix, from userid 30019) id 6C3D36816AE; Tue, 25 Mar 2014 10:16:29 +0000 (UTC) From: =?UTF-8?q?Kim=20B=C3=B8ndergaard?= To: Subject: [PATCH 1/1] touch: New recipe. Input based on kernel events. Date: Tue, 25 Mar 2014 10:16:27 +0000 Message-ID: <7318e25e94ba45e546753bd27f442d2670801dcf.1395742435.git.kibo@prevas.dk> X-Mailer: git-send-email 1.8.4 In-Reply-To: References: MIME-Version: 1.0 Cc: =?UTF-8?q?Kim=20B=C3=B8ndergaard?= X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org 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 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 +} + +