summaryrefslogtreecommitdiff
path: root/recipes-qt
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2013-11-20 15:26:36 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2013-11-21 18:52:24 +0100
commit3f529887c69f24920c91e4c5ab7b3cac680af6ba (patch)
treecd60996d64747ba87d8e51632810d8faaf2929f3 /recipes-qt
parentac73d92c9000668cc95b12615142948481ef248a (diff)
qtdemo-init: Add start script for qtdemoE
Diffstat (limited to 'recipes-qt')
-rw-r--r--recipes-qt/qt-demo/qt-demo-init/keyboard.rules48
-rw-r--r--recipes-qt/qt-demo/qt-demo-init/mouse.rules48
-rw-r--r--recipes-qt/qt-demo/qt-demo-init/qtdemo-init59
-rw-r--r--recipes-qt/qt-demo/qt-demo-init_0.1.bb23
4 files changed, 178 insertions, 0 deletions
diff --git a/recipes-qt/qt-demo/qt-demo-init/keyboard.rules b/recipes-qt/qt-demo/qt-demo-init/keyboard.rules
new file mode 100644
index 0000000..9ff3fa0
--- /dev/null
+++ b/recipes-qt/qt-demo/qt-demo-init/keyboard.rules
@@ -0,0 +1,48 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# make sysmlink for mouse and keyboard input event devicesudevadm info --name /dev/input/event2
+#P: /devices/platform/fsl-ehci.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.1/1-1.3.4.1:1.1/input/input2/event2
+#N: input/event2
+#S: input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse
+#S: input/by-path/platform-fsl-ehci.0-usb-0:1.3.4.1:1.1-event-mouse
+#E: DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse /dev/input/by-path/platform-fsl-ehci.0-usb-0:1.3.4.1:1.1-event-mouse
+#E: DEVNAME=/dev/input/event2
+#E: DEVPATH=/devices/platform/fsl-ehci.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.1/1-1.3.4.1:1.1/input/input2/event2
+#E: ID_BUS=usb
+#E: ID_INPUT=1
+#E: ID_INPUT_KEY=1
+#E: ID_INPUT_MOUSE=1
+#E: ID_MODEL=USB_Receiver
+#E: ID_MODEL_ENC=USB\x20Receiver
+#E: ID_MODEL_ID=c52b
+#E: ID_PATH=platform-fsl-ehci.0-usb-0:1.3.4.1:1.1
+#E: ID_PATH_TAG=platform-fsl-ehci_0-usb-0_1_3_4_1_1_1
+#E: ID_REVISION=1201
+#E: ID_SERIAL=Logitech_USB_Receiver
+#E: ID_TYPE=hid
+#E: ID_USB_DRIVER=usbhid
+#E: ID_USB_INTERFACES=:030101:030102:030000:
+#E: ID_USB_INTERFACE_NUM=01
+#E: ID_VENDOR=Logitech
+#E: ID_VENDOR_ENC=Logitech
+#E: ID_VENDOR_ID=046d
+#E: MAJOR=13
+#E: MINOR=66
+#E: SUBSYSTEM=input
+#E: USEC_INITIALIZED=4737491
+
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_KEYBOARD}=="1", SYMLINK+="input/event-keyboard"
+
diff --git a/recipes-qt/qt-demo/qt-demo-init/mouse.rules b/recipes-qt/qt-demo/qt-demo-init/mouse.rules
new file mode 100644
index 0000000..d1d33d7
--- /dev/null
+++ b/recipes-qt/qt-demo/qt-demo-init/mouse.rules
@@ -0,0 +1,48 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# make sysmlink for mouse and keyboard input event devicesudevadm info --name /dev/input/event2
+#P: /devices/platform/fsl-ehci.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.1/1-1.3.4.1:1.1/input/input2/event2
+#N: input/event2
+#S: input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse
+#S: input/by-path/platform-fsl-ehci.0-usb-0:1.3.4.1:1.1-event-mouse
+#E: DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-if01-event-mouse /dev/input/by-path/platform-fsl-ehci.0-usb-0:1.3.4.1:1.1-event-mouse
+#E: DEVNAME=/dev/input/event2
+#E: DEVPATH=/devices/platform/fsl-ehci.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.1/1-1.3.4.1:1.1/input/input2/event2
+#E: ID_BUS=usb
+#E: ID_INPUT=1
+#E: ID_INPUT_KEY=1
+#E: ID_INPUT_MOUSE=1
+#E: ID_MODEL=USB_Receiver
+#E: ID_MODEL_ENC=USB\x20Receiver
+#E: ID_MODEL_ID=c52b
+#E: ID_PATH=platform-fsl-ehci.0-usb-0:1.3.4.1:1.1
+#E: ID_PATH_TAG=platform-fsl-ehci_0-usb-0_1_3_4_1_1_1
+#E: ID_REVISION=1201
+#E: ID_SERIAL=Logitech_USB_Receiver
+#E: ID_TYPE=hid
+#E: ID_USB_DRIVER=usbhid
+#E: ID_USB_INTERFACES=:030101:030102:030000:
+#E: ID_USB_INTERFACE_NUM=01
+#E: ID_VENDOR=Logitech
+#E: ID_VENDOR_ENC=Logitech
+#E: ID_VENDOR_ID=046d
+#E: MAJOR=13
+#E: MINOR=66
+#E: SUBSYSTEM=input
+#E: USEC_INITIALIZED=4737491
+
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_MOUSE}=="1", SYMLINK+="input/event-mouse"
+
diff --git a/recipes-qt/qt-demo/qt-demo-init/qtdemo-init b/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
new file mode 100644
index 0000000..b71cbc8
--- /dev/null
+++ b/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+set -e
+
+if [ -f /usr/bin/qtdemo ]; then
+ QTDEMO="qtdemo > /var/log/Xsession.log 2> &1"
+else
+ QTDEMO="qtdemoE -qws"
+ export QWS_DISPLAY="LinuxFb:/dev/fb:genericcolors"
+ export QWS_KEYBOARD="USB:/dev/input/event-keyboard"
+ export QWS_MOUSE_PROTO="LinuxInput:/dev/input/event-mouse"
+fi
+
+case "$1" in
+ start)
+ echo "Starting qtdemo"
+# if [ -f /etc/profile.d/tslib.sh ]; then
+# source /etc/profile.d/tslib.sh
+# :
+# fi
+# if [ -e "$TSLIB_TSDEVICE" ]; then
+# if [ ! -f /etc/pointercal ]; then
+# /usr/bin/ts_calibrate
+# fi
+# if [ "$QTDEMO" == qtdemo ]; then
+# Xorg &
+# export DISPLAY=:0
+# $QTDEMO &
+# else
+# QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO &
+# fi
+# else
+ if [ "$QTDEMO" == qtdemo ]; then
+ Xorg &
+ export DISPLAY=:0
+ fi
+ $QTDEMO &
+# fi
+ ;;
+ stop)
+ echo "Stopping qtdemo"
+ if [ "$QTDEMO" == qtdemo ]; then
+ killall Xorg
+ killall qtdemo
+ else
+ killall qtdemoE
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes-qt/qt-demo/qt-demo-init_0.1.bb b/recipes-qt/qt-demo/qt-demo-init_0.1.bb
new file mode 100644
index 0000000..98d4e8c
--- /dev/null
+++ b/recipes-qt/qt-demo/qt-demo-init_0.1.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Init script for qtdemo"
+LICENSE = "MIT"
+SRC_URI = " \
+ file://qtdemo-init \
+ file://mouse.rules \
+ file://keyboard.rules \
+"
+PR = "r4"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+do_install() {
+ install -d ${D}${sysconfdir}/init.d/ ${D}${sysconfdir}/udev/rules.d/
+ install -m 0755 ${WORKDIR}/qtdemo-init ${D}${sysconfdir}/init.d/qtdemo
+ install -m 0644 ${WORKDIR}/mouse.rules ${D}${sysconfdir}/udev/rules.d/
+ install -m 0644 ${WORKDIR}/keyboard.rules ${D}${sysconfdir}/udev/rules.d/
+}
+
+inherit update-rc.d allarch
+
+INITSCRIPT_NAME = "qtdemo"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 19 0 1 6 ."