diff options
author | Jan F. Chadima <jfch@jagda.eu> | 2018-07-28 00:02:20 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-07-28 08:51:48 +0700 |
commit | e94ee23d320f1b337481b4742b80da97a917a3d8 (patch) | |
tree | cb53d169445545cf94595e8f1015747f0d281288 /system | |
parent | 5257366819a23081dc3a7919d50e29348a816240 (diff) | |
download | slackbuilds-e94ee23d320f1b337481b4742b80da97a917a3d8.tar.gz |
system/elo-mt-usb: Added (elo USB multitouch controller driver).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/elo-mt-usb/README | 4 | ||||
-rw-r--r-- | system/elo-mt-usb/doinst.sh | 29 | ||||
-rw-r--r-- | system/elo-mt-usb/elo-mt-usb.SlackBuild | 168 | ||||
-rw-r--r-- | system/elo-mt-usb/elo-mt-usb.info | 12 | ||||
-rw-r--r-- | system/elo-mt-usb/rc.elo-mt-usb.new | 46 | ||||
-rw-r--r-- | system/elo-mt-usb/slack-desc | 19 |
6 files changed, 278 insertions, 0 deletions
diff --git a/system/elo-mt-usb/README b/system/elo-mt-usb/README new file mode 100644 index 0000000000..60bfd1d678 --- /dev/null +++ b/system/elo-mt-usb/README @@ -0,0 +1,4 @@ +Driver for ELO multitouch USB conected touch screen. +This is the proprietary driver; wget cannot be used for downloading +the 'source' package. You have to use a browser and accept +the license. diff --git a/system/elo-mt-usb/doinst.sh b/system/elo-mt-usb/doinst.sh new file mode 100644 index 0000000000..9ea0e9e46d --- /dev/null +++ b/system/elo-mt-usb/doinst.sh @@ -0,0 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.elo-mt-usb.new +config etc/elo/eloconfig.new +rm -f etc/elo/eloconfig.new + +chroot . /sbin/modprobe diff --git a/system/elo-mt-usb/elo-mt-usb.SlackBuild b/system/elo-mt-usb/elo-mt-usb.SlackBuild new file mode 100644 index 0000000000..ed72f1d25b --- /dev/null +++ b/system/elo-mt-usb/elo-mt-usb.SlackBuild @@ -0,0 +1,168 @@ +#!/bin/sh + +# Slackware build script for elo-mt-usb + +# Copyright 2018 Jan F. Chadima <jfch@jagda.eu> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=elo-mt-usb +VERSION=${VERSION:-2.5.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +KERN=${KERN:-"$(uname -r)"} +PKGVER="$(printf %s "${VERSION}_${KERN}" | tr - _)" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf elo-mt-usb +case "$ARCH" in + i?86) + tar xvf $CWD/SW602616_Elo_Linux_MT_USB_Driver_v${VERSION}_i686.tgz + ;; + x86_64) + tar xvf $CWD/SW602617_Elo_Linux_MT_USB_Driver_v${VERSION}_x86_64.tgz + ;; +# arm*) +# tar xvf $CWD/SW602618_Elo_Linux_MT_USB_Driver_v${VERSION}_armv7l.tgz +# ;; + *) + echo "Unsupported architecture" >&2 + exit 1 +esac +cd bin-mt-usb +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +cd elo_mt_input_mod_src + + # Add source of the module + mkdir -p $PKG/usr/src/elo-mt-usb + install -m 644 Makefile $PKG/usr/src/elo-mt-usb + install -m 644 elo_mt_input.c $PKG/usr/src/elo-mt-usb + + # Make module and install it + make CFLAGS="$SLKCFLAGS" KDIR=/lib/modules/$KERN/build + mkdir -p $PKG/lib/modules/$KERN/elo-mt-usb + install -m 644 elo_mt_input_mod.ko $PKG/lib/modules/$KERN/elo-mt-usb/ + +cd - + +# Install udev rules +mkdir -p $PKG/lib/udev/rules.d +install -m 644 99-elotouch.rules $PKG/lib/udev/rules.d/ + +# Prepare "directory" for drivers and eloconfig +mkdir -p $PKG/etc/opt +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb +ln -s ../../usr/lib$LIBDIRSUFFIX/elo-mt-usb $PKG/etc/opt + +mkdir -p $PKG/etc/elo +touch $PKG/etc/elo/eloconfig.new +ln -s ../../etc/elo $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb/ + +# Patch cpl program +hexdump -ve '1/1 "%.2X"' cpl | sed "s/6C6962586D2E736F2E33/6C6962586D2E736F2E34/g" | xxd -r -p > cpl.patched + +# Install content to a separate directory +install -s -m 755 cpl.patched $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb/cpl +install -s -m 755 cplcmd $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb/ +install -s -m 755 elomtusbd $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb/ +install -s -m 755 elova $PKG/usr/lib$LIBDIRSUFFIX/elo-mt-usb/ + +# Install rc.script +mkdir -p $PKG/etc/rc.d +install -m 755 $CWD/rc.elo-mt-usb.new $PKG/etc/rc.d + +# Create /usr/bin programs +mkdir -p $PKG/usr/bin + +cat > $PKG/usr/bin/cpl << EOF +#!/bin/sh + +exec /etc/opt/elo-mt-usb/cpl +EOF +chmod +x $PKG/usr/bin/cpl +ln -s cpl $PKG/usr/bin/touchscreen_setup +ln -s cpl $PKG/usr/bin/touchscreen_setup.elo-mt-usb + +cat > $PKG/usr/bin/cplcmd << EOF +#!/bin/sh + +exec /etc/opt/elo-mt-usb/cplcmd +EOF +chmod +x $PKG/usr/bin/cplcmd + +cat > $PKG/usr/bin/elova << EOF +#!/bin/sh + +exec /etc/opt/elo-mt-usb/elova +EOF +chmod +x $PKG/usr/bin/elova +ln -s elova $PKG/usr/bin/touchscreen_calibrate +ln -s elova $PKG/usr/bin/touchscreen_calibrate.elo-mt-usb + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + readme.txt Elo_OEM_\&_EU_LA.txt Elo-Linux-MT-USB-Driver_List-of-New-Features.txt \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +chmod 644 $PKG/usr/doc/$PRGNAM-$VERSION/* + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/elo-mt-usb/elo-mt-usb.info b/system/elo-mt-usb/elo-mt-usb.info new file mode 100644 index 0000000000..e8b959ab35 --- /dev/null +++ b/system/elo-mt-usb/elo-mt-usb.info @@ -0,0 +1,12 @@ +PRGNAM="elo-mt-usb" +VERSION="2.5.0" +HOMEPAGE="https://support.elotouch.com/TechnicalSupport/Drivers/Linux/" +DOWNLOAD="http://support.elotouch.com/download/Drivers/DriverDownload/SW602616_Elo_Linux_MT_USB_Driver_v2.5.0_i686.tgz" +MD5SUM="f77eb5e3ce75acb6ed6ceb9ef1132ed6" +DOWNLOAD_x86_64="http://support.elotouch.com/download/Drivers/DriverDownload/SW602617_Elo_Linux_MT_USB_Driver_v2.5.0_x86_64.tgz" +MD5SUM_x86_64="47d55760f200b66b1b930d28c411fb25" +#DOWNLOAD_arm="http://support.elotouch.com/download/Drivers/DriverDownload/SW602618_Elo_Linux_MT_USB_Driver_v2.5.0_armv7l.tgz" +#MD5SUM_arm="7c18836f2f5698463fc6159a6994bef2" +REQUIRES="" +MAINTAINER="Jan F. Chadima" +EMAIL="jfch@jagda.eu" diff --git a/system/elo-mt-usb/rc.elo-mt-usb.new b/system/elo-mt-usb/rc.elo-mt-usb.new new file mode 100644 index 0000000000..14b884617b --- /dev/null +++ b/system/elo-mt-usb/rc.elo-mt-usb.new @@ -0,0 +1,46 @@ +#!/bin/sh +# +# rc script for elo-mt-usb touch screen driver +# +# Avoid being interrupted by child or keyboard +# +trap "echo" SIGINT SIGSEGV SIGQUIT SIGTERM +set +e + +case "$1" in + start) + # Create Elo Devices for communication + + mode="776" # Why is it group writtable ? + elo_usb_device_path="/dev/elo-mt-usb/" + elo_usb_rspfifo="rsp_fifo" + elo_usb_cmdfifo="cmd_fifo" + + rm -f $elo_usb_device_path$elo_usb_cmdfifo + rm -f $elo_usb_device_path$elo_usb_rspfifo + + mkdir -p $elo_usb_device_path + + mkfifo $elo_usb_device_path$elo_usb_rspfifo + mkfifo $elo_usb_device_path$elo_usb_cmdfifo + + chmod $mode $elo_usb_device_path$elo_usb_cmdfifo + chmod $mode $elo_usb_device_path$elo_usb_rspfifo + + # Load the Elo kernel module [input device driver] + modprobe elo_mt_input_mod + + # Load the PC speaker kernel module into memory for Beep-On-Touch + #modprobe pcspkr + + sleep 1 # Why? + + # Load the Elo USB Touchscreen Daemon into memory + /etc/opt/elo-mt-usb/elomtusbd + ;; + stop) + ;; + *) + echo "Usage: $0 {start}" >&2 + exit 1 +esac diff --git a/system/elo-mt-usb/slack-desc b/system/elo-mt-usb/slack-desc new file mode 100644 index 0000000000..20f69ef64d --- /dev/null +++ b/system/elo-mt-usb/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +elo-mt-usb: elo-mt-usb (driver for elo multitouch screen controllers over USB) +elo-mt-usb: +elo-mt-usb: Proprietary driver for the Elo multitouch touch screen. +elo-mt-usb: Version for USB connected devices. +elo-mt-usb: +elo-mt-usb: +elo-mt-usb: +elo-mt-usb: +elo-mt-usb: +elo-mt-usb: +elo-mt-usb: |