Return-Path: Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 42F50E00867 for ; Fri, 17 Jan 2014 06:02:58 -0800 (PST) Received: by mail-yk0-f170.google.com with SMTP id 9so2082274ykp.1 for ; Fri, 17 Jan 2014 06:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=HhqUn3xguK7/gL9nGDmpQIRINuzZ9tXyKdEeTCQHMeA=; b=oCd/wsOkMsPDELAJaKZqN2vk0l8UhSvniPPFa2WcYccNeD5TMLRxY7a5NxZStYHEbQ QL+8utcG9NIlg3h0iHxt2STpI9J2BUFHVJ2VB1aENZaMaxgnozESHmYmeey9Uaj355xe kdpa0rqGQ7zf93ZoYU3IrhK78dAKp9lQFOiw7kCpueZmLp4bl2AOC4GDH4sTeJckTKQK 9TKnGkdthnIdPKCE0y6h1hNjIuyO7xDVjUabVKUF1aebVRO+TZUBk63rG3dioi+MbE3b 46I1/i7iFEP/txhxGKbMpC3d+PJfZwNTjYy+MN2UmLqeRJfG5ai3xGyDROXZRlO0YCZs Ahbw== X-Received: by 10.236.171.195 with SMTP id r43mr1901981yhl.56.1389967377495; Fri, 17 Jan 2014 06:02:57 -0800 (PST) Received: from monster.lab.ossystems.com.br ([177.194.208.225]) by mx.google.com with ESMTPSA id k3sm18449445yhc.13.2014.01.17.06.02.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Jan 2014 06:02:56 -0800 (PST) Sender: Mario Domenech Goulart From: Mario Domenech Goulart To: meta-freescale@yoctoproject.org Date: Fri, 17 Jan 2014 12:02:45 -0200 Message-Id: <1389967366-2718-1-git-send-email-mario@ossystems.com.br> X-Mailer: git-send-email 1.7.10.4 Subject: [meta-fsl-demos][PATCH 1/2] qt-in-industrial-embedded-common: add init script for the smarthome demo X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2014 14:03:05 -0000 Currently, qt-in-industrial-embedded starts no demo automatically when installed. This patch adds an init script so that the smarthome demo can be automatically started on boot. Signed-off-by: Mario Domenech Goulart --- recipes-qt/qt-in-use/files/smarthome | 37 ++++++++++++++++++++ .../qt-in-use/qt-in-industrial-embedded-common.inc | 13 +++++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 recipes-qt/qt-in-use/files/smarthome diff --git a/recipes-qt/qt-in-use/files/smarthome b/recipes-qt/qt-in-use/files/smarthome new file mode 100644 index 0000000..c0aa575 --- /dev/null +++ b/recipes-qt/qt-in-use/files/smarthome @@ -0,0 +1,37 @@ +#!/bin/sh + +set -e + +SMARTHOME="smarthome" +SMARTHOME_ARGS="`[ -x '__BINDIR__/X' ] && echo '' || echo '-qws'`" + +case "$1" in + start) + echo "Starting $SMARTHOME" + if [ -f __SYSCONFDIR__/profile.d/tslib.sh ]; then + . __SYSCONFDIR__/profile.d/tslib.sh + fi + if [ -e "$TSLIB_TSDEVICE" ]; then + if [ ! -f __SYSCONFDIR__/pointercal ]; then + __BINDIR__/ts_calibrate + fi + QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $SMARTHOME $SMARTHOME_ARGS & + else + $SMARTHOME $SMARTHOME_ARGS & + fi + ;; + stop) + echo "Stopping $SMARTHOME" + killall $SMARTHOME + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 { start | stop | restart }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/recipes-qt/qt-in-use/qt-in-industrial-embedded-common.inc b/recipes-qt/qt-in-use/qt-in-industrial-embedded-common.inc index ea4feef..ad879c5 100644 --- a/recipes-qt/qt-in-use/qt-in-industrial-embedded-common.inc +++ b/recipes-qt/qt-in-use/qt-in-industrial-embedded-common.inc @@ -1,10 +1,12 @@ DESCRIPTION = "Demos from the industrial embedded segment" -inherit autotools +inherit autotools update-rc.d PV = "0.0+gitr${SRCPV}" SRCREV = "4b10cbfd32391c83251bbc61520eeab03461db0a" -SRC_URI = "git://gitorious.org/qt-in-use/qt-in-industrial-embedded.git" +SRC_URI = "git://gitorious.org/qt-in-use/qt-in-industrial-embedded.git \ + file://smarthome \ + " PR = "r3" @@ -18,6 +20,10 @@ do_configure_prepend() { do_install_append () { # Set the correct smarthome binary path sed -i -e 's:Exec=.*:Exec=${bindir}/smarthome:g' ${D}${datadir}/applications/smarthome.desktop + + install -d ${D}${sysconfdir}/init.d + install -m 755 ${WORKDIR}/smarthome ${D}${sysconfdir}/init.d/ + sed -i -e 's:__BINDIR__:${bindir}:g; s:__SYSCONFDIR__:${sysconfdir}:g' ${D}${sysconfdir}/init.d/smarthome } FILES_${PN} += "${datadir}/${DEMO} ${datadir}/icons" @@ -25,3 +31,6 @@ RDEPENDS_${PN} += " \ ${QT_BASE_NAME}-qml-plugins \ ${QT_BASE_NAME}-plugin-imageformat-svg \ " + +INITSCRIPT_NAME = "smarthome" +INITSCRIPT_PARAMS = "defaults" -- 1.7.10.4