diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community-testing/inputattach |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community-testing/inputattach')
-rw-r--r-- | community-testing/inputattach/0001-Add-w8001-flag.patch | 27 | ||||
-rw-r--r-- | community-testing/inputattach/0002-Allow-for-custom-baud-rates.patch | 70 | ||||
-rw-r--r-- | community-testing/inputattach/PKGBUILD | 43 | ||||
-rw-r--r-- | community-testing/inputattach/inputattach.conf.d | 10 | ||||
-rw-r--r-- | community-testing/inputattach/inputattach.install | 18 | ||||
-rw-r--r-- | community-testing/inputattach/inputattach.rc.d | 40 |
6 files changed, 208 insertions, 0 deletions
diff --git a/community-testing/inputattach/0001-Add-w8001-flag.patch b/community-testing/inputattach/0001-Add-w8001-flag.patch new file mode 100644 index 000000000..ba6f9394b --- /dev/null +++ b/community-testing/inputattach/0001-Add-w8001-flag.patch @@ -0,0 +1,27 @@ +From 729257077e328e0b2fa1bba5a5509c09a743d5d0 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue, 13 Jul 2010 11:49:47 +1000 +Subject: [PATCH 2/3] Add w8001 flag for serial Wacom devices. + +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> +--- + inputattach.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/inputattach.c b/inputattach.c +index a7de302..0382954 100644 +--- a/inputattach.c ++++ b/inputattach.c +@@ -495,6 +495,9 @@ static struct input_types input_types[] = { + { "--dump", "-dump", "Just enable device", + B2400, CS8, + 0, 0x00, 0x00, 0, dump_init }, ++{ "--w8001", "-w8001", "Wacom W8001", ++ B38400, CS8, ++ SERIO_W8001, 0x00, 0x00, 0, NULL }, + { NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL } + }; + +-- +1.7.2.3 + diff --git a/community-testing/inputattach/0002-Allow-for-custom-baud-rates.patch b/community-testing/inputattach/0002-Allow-for-custom-baud-rates.patch new file mode 100644 index 000000000..78f5d19c8 --- /dev/null +++ b/community-testing/inputattach/0002-Allow-for-custom-baud-rates.patch @@ -0,0 +1,70 @@ +From 5d9373f24f1b519c030024b2f36277ba9713697c Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Wed, 21 Jul 2010 14:41:04 +1000 +Subject: [PATCH 3/3] Allow for custom baud rates. + +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> +--- + inputattach.c | 25 ++++++++++++++++++++++++- + 1 files changed, 24 insertions(+), 1 deletions(-) + +diff --git a/inputattach.c b/inputattach.c +index 0382954..6806fc8 100644 +--- a/inputattach.c ++++ b/inputattach.c +@@ -506,7 +506,7 @@ static void show_help(void) + struct input_types *type; + + puts(""); +- puts("Usage: inputattach [--daemon] <mode> <device>"); ++ puts("Usage: inputattach [--daemon] [--baud <baud>] <mode> <device>"); + puts(""); + puts("Modes:"); + +@@ -530,6 +530,7 @@ int main(int argc, char **argv) + int i; + char c; + int retval; ++ int baud = -1; + + for (i = 1; i < argc; i++) { + if (!strcasecmp(argv[i], "--help")) { +@@ -540,6 +541,15 @@ int main(int argc, char **argv) + } else if (need_device) { + device = argv[i]; + need_device = 0; ++ } else if (!strcasecmp(argv[i], "--baud")) { ++ if (argc <= i + 1) { ++ show_help(); ++ fprintf(stderr, ++ "inputattach: require baud rate\n"); ++ return EXIT_FAILURE; ++ } ++ ++ baud = atoi(argv[++i]); + } else { + if (type && type->name) { + fprintf(stderr, +@@ -580,6 +590,19 @@ int main(int argc, char **argv) + return 1; + } + ++ switch(baud) { ++ case -1: break; ++ case 2400: type->speed = B2400; break; ++ case 4800: type->speed = B4800; break; ++ case 9600: type->speed = B9600; break; ++ case 19200: type->speed = B19200; break; ++ case 38400: type->speed = B38400; break; ++ default: ++ fprintf(stderr, "inputattach: invalid baud rate '%d'\n", ++ baud); ++ return EXIT_FAILURE; ++ } ++ + setline(fd, type->flags, type->speed); + + if (type->flush) +-- +1.7.2.3 + diff --git a/community-testing/inputattach/PKGBUILD b/community-testing/inputattach/PKGBUILD new file mode 100644 index 000000000..0953d0a3a --- /dev/null +++ b/community-testing/inputattach/PKGBUILD @@ -0,0 +1,43 @@ +# Contributor: Mark Smith <markzzzsmith@yahoo.com.au> + +pkgname=inputattach +pkgver=1.24 +pkgrel=3 +pkgdesc="Attach serial mice, keyboards and other input devices to the kernel input system" +arch=('i686' 'x86_64') +url="http://linuxconsole.sourceforge.net/" +license=('GPL') +depends=('bash') +makedepends=('gcc') +backup=(etc/conf.d/inputattach) +install=inputattach.install +source=('http://kernel.org/pub/linux/kernel/people/dtor/inputattach.c' + 'http://kernel.org/pub/linux/kernel/people/dtor/serio-ids.h' + 'inputattach.conf.d' 'inputattach.rc.d' + '0001-Add-w8001-flag.patch' '0002-Allow-for-custom-baud-rates.patch') +md5sums=('eb595a766ca363edb3b14c25404596ce' '93d34d96cd3ad19ea1aeca7f68a66b4a' + '7ca903e54829764c8241233af5069216' '8d62f8840a2e6457a953f667df39ef99' + 'f1b3ddae308351357f557cbd5c6cda81' '8f76908449cae24a95adbf0bc0a17721') + +build() { + cd "$srcdir" + + # Add support for serial wacom tablets + patch -Np1 -i "$srcdir/0001-Add-w8001-flag.patch" + patch -Np1 -i "$srcdir/0002-Allow-for-custom-baud-rates.patch" + + cc $CFLAGS inputattach.c -o inputattach +} + +package() { + cd "$srcdir" + + install -Dm755 inputattach \ + "$pkgdir/usr/sbin/inputattach" + + install -Dm644 $srcdir/inputattach.conf.d \ + "$pkgdir/etc/conf.d/inputattach" + + install -Dm755 $srcdir/inputattach.rc.d \ + "$pkgdir/etc/rc.d/inputattach" +} diff --git a/community-testing/inputattach/inputattach.conf.d b/community-testing/inputattach/inputattach.conf.d new file mode 100644 index 000000000..ae8d1842a --- /dev/null +++ b/community-testing/inputattach/inputattach.conf.d @@ -0,0 +1,10 @@ +# +# Configuration for inputattach +# +# IAPARAMS is an array of inputattach arguments, see 'inputattach --help'. +# An inputattach instance will be started for each element. + +IAPARAMS=( + "--microsoft /dev/ttyS0" + #"--baud 9600 --w8001 /dev/ttyS1" +) diff --git a/community-testing/inputattach/inputattach.install b/community-testing/inputattach/inputattach.install new file mode 100644 index 000000000..b5381e14a --- /dev/null +++ b/community-testing/inputattach/inputattach.install @@ -0,0 +1,18 @@ +## arg 1: the new package version + +post_upgrade() { + (( $(vercmp 1.24-3 $2) > 0 )) && cat <<MSG +ATTENTION: + /etc/conf.d/inputattach.conf has been replaced by /etc/conf.d/inputattach + Make sure you adjust the new config file, which has a new format. +MSG +} + +post_install() { + cat << EOF + +The correct device mode and /dev device file will need to be set in +/etc/conf.d/inputattach before starting /etc/rc.d/inputattach + +EOF +} diff --git a/community-testing/inputattach/inputattach.rc.d b/community-testing/inputattach/inputattach.rc.d new file mode 100644 index 000000000..6b92827be --- /dev/null +++ b/community-testing/inputattach/inputattach.rc.d @@ -0,0 +1,40 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/inputattach + +case "$1" in + start) + stat_busy "Starting inputattach" + for param in ${IAPARAMS[@]}; do + if ! /usr/sbin/inputattach --daemon $param; then + stat_fail + exit 1 + fi + done + + add_daemon inputattach + stat_done + ;; + stop) + stat_busy "Stopping inputattach" + PID=`pidof -o %PPID /usr/sbin/inputattach` + [ ! -z "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm_daemon inputattach + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |