From: Denys Dmytriyenko <denys@ti.com>
To: Chase Maupin <Chase.Maupin@ti.com>
Cc: meta-arago@arago-project.org
Subject: Re: [PATCH 1/3] ts-calibrate-init: Add init package to run ts_calibrate
Date: Tue, 21 Jan 2014 10:58:30 -0500 [thread overview]
Message-ID: <20140121155828.GB30525@edge> (raw)
In-Reply-To: <1390324458-29919-1-git-send-email-Chase.Maupin@ti.com>
On Tue, Jan 21, 2014 at 11:14:16AM -0600, Chase Maupin wrote:
> * Add a package that will run ts_calibrate if needed. This
> will allow separating this logic from the matrix init script
> since it is not always needed and allow others to use it for
> their own systems without requiring matrix.
>
> Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
> ---
> .../recipes-graphics/tslib/ts-calibrate-init/init | 50 ++++++++++++++++++++
> .../tslib/ts-calibrate-init_1.0.bb | 29 +++++++++++
> 2 files changed, 79 insertions(+), 0 deletions(-)
> create mode 100644 meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init/init
> create mode 100644 meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init_1.0.bb
>
> diff --git a/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init/init b/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init/init
> new file mode 100644
> index 0000000..26ea581
> --- /dev/null
> +++ b/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init/init
> @@ -0,0 +1,50 @@
> +#!/bin/sh
> +# Copyright (C) {2013} Texas Instruments Incorporated - http://www.ti.com/
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation version 2.
> +#
> +# This program is distributed "as is" WITHOUT ANY WARRANTY of any
> +# kind, whether express or implied; without even the implied warranty
> +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +
> +tsfile=/etc/pointercal
> +
> +# First let's check if we even see a touchscreen device node. If not
> +# then bail out.
> +if [ ! -e /dev/input/touchscreen0 ]
> +then
> + exit
> +fi
> +
> +# Check if the SD card is mounted and the first partition is
> +# vfat. If so let's write the pointercal file there so that if
> +# someone messes up calibration they can just delete the file from
> +# any system and reboot the board.
> +
> +#TODO how can we find the SD card and not eMMC? can we look for a "boot"
> +# LABEL?
> +mount | grep /media/mmcblk0p1 | grep vfat > /dev/null 2>&1
> +if [ "$?" = "0" ]
> +then
> + tsfile=/media/mmcblk0p1/pointercal
> + export TSLIB_CALIBFILE=$tsfile
> +fi
> +
> +if [ ! -f $tsfile ] ; then
> + echo -n "Calibrating touchscreen (first time only)"
> + ts_calibrate
> + echo "."
> +
> + # If we create a pointercal file and it was not in /etc/pointercal
> + # let's copy it there as well if it does not already exist. This is so
> + # that running other applications that look for /etc/pointercal and
> + # without TSLIB_CALIBFILE set will still get the right calibration.
> + # TODO: can we just globally export TSLIB_CALIBFILE?
> + if [ ! -f /etc/pointercal -a -f $tsfile ]
> + then
> + cp $tsfile /etc/pointercal
> + fi
> +fi
> diff --git a/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init_1.0.bb b/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init_1.0.bb
> new file mode 100644
> index 0000000..7fdbc26
> --- /dev/null
> +++ b/meta-arago-extras/recipes-graphics/tslib/ts-calibrate-init_1.0.bb
> @@ -0,0 +1,29 @@
> +# This recipe installs an init script that can be used to invoke ts_calibrate
> +# on systems that need this done during the boot sequence.
Should it RDEPENDS on tslib/ts_calibrate binary that is used in the initscript?
> +DESCRIPTION = "TS calibration init script"
> +
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://init;beginline=2;endline=11;md5=4b2e3b15f01cf63d2cb7988afdcc6c60"
> +
> +PR = "r0"
> +
> +S = "${WORKDIR}"
> +
> +INITSCRIPT_NAME = "ts-calibrate"
> +
> +# Start this init script early enough for other processes to be started later
> +# in the init sequence
> +INITSCRIPT_PARAMS = "start 96 2 3 4 5 ."
> +
> +PACKAGE_ARCH = "${MACHINE_ARCH}"
> +
> +inherit update-rc.d
> +
> +SRC_URI = "file://init"
> +
> +do_install(){
> + # Install the init script
> + # TODO: replace init script with systemd files
> + install -d ${D}${sysconfdir}/init.d
> + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/ts-calibrate
> +}
> --
> 1.7.0.4
>
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
next prev parent reply other threads:[~2014-01-21 15:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 17:14 [PATCH 1/3] ts-calibrate-init: Add init package to run ts_calibrate Chase Maupin
2014-01-21 15:58 ` Denys Dmytriyenko [this message]
2014-01-21 17:11 ` Maupin, Chase
2014-01-21 17:14 ` [PATCH 2/3] package-group-tisdk-matrix: add ts-calibrate-init Chase Maupin
2014-01-21 15:55 ` Denys Dmytriyenko
2014-01-21 17:11 ` Maupin, Chase
2014-01-21 17:14 ` [PATCH 3/3] matrix-gui: remove ts_calibrate from init Chase Maupin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140121155828.GB30525@edge \
--to=denys@ti.com \
--cc=Chase.Maupin@ti.com \
--cc=meta-arago@arago-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.