Date: Fri, 12 Jan 2001 21:37:37 -0600 (CST) From: Stephen Montgomery-Smith <stephen@cauchy.math.missouri.edu> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/24299: Configure the synaptics touchpad. Message-ID: <200101130337.f0D3bbE40459@cauchy.math.missouri.edu>
next in thread | raw e-mail | index | archive | help
>Number: 24299 >Category: ports >Synopsis: Configure the synaptics touchpad. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jan 12 19:40:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Stephen Montgomery-Smith >Release: FreeBSD 4.2-STABLE i386 >Organization: University of Missouri >Environment: Using a synaptics touchpad on a laptop >Description: You may like to make various configurations to the touchpad, for example, to disable the feature that tapping the touchpad is like a mouse click. >How-To-Repeat: >Fix: This port will not compile or work unless changes are made to the kernel - this is described at http://www.freebsd.org/cgi/query-pr.cgi?pr=20352 This replaces the PR http://www.freebsd.org/cgi/query-pr.cgi?pr=21520 which is now out of date (and which was never committed). I really hope that one of you guys commits this soon, because I have contact with several people who want something like this. # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # tpconfig # tpconfig/Makefile # tpconfig/pkg-comment # tpconfig/distinfo # tpconfig/pkg-descr # tpconfig/pkg-plist # tpconfig/files # tpconfig/files/patch-00 # tpconfig/files/patch-01 # tpconfig/files/remouse.sh-sample # tpconfig/files/remouse # tpconfig/files/patch-10 # echo c - tpconfig mkdir -p tpconfig > /dev/null 2>&1 echo x - tpconfig/Makefile sed 's/^X//' >tpconfig/Makefile << 'END-of-tpconfig/Makefile' X# New ports collection makefile for: tpconfig X# Date created: 12 January 2001 X# Whom: Stephen Montgomery-Smith <stephen@math.missouri.edu> X# X# $FreeBSD$ X# X XPORTNAME= tpconfig XPORTVERSION= 3.1 XCATEGORIES= sysutils XMASTER_SITES= http://www.compass.com/tpconfig/ X XMAINTAINER= stephen@math.missouri.edu X XLIB_DEPENDS= gnugetopt:${PORTSDIR}/devel/libgnugetopt:install X XGNU_CONFIGURE= yes XCONFIGURE_ENV+= CFLAGS="${CFLAGS} -I${PREFIX}/include" \ X LDFLAGS=-L${PREFIX}/lib \ X LIBS=-lgnugetopt X Xpre-patch: X ${CHMOD} +w ${WRKSRC}/* X Xpost-install: X strip ${PREFIX}/bin/tpconfig X ${INSTALL_SCRIPT} ${FILESDIR}/remouse.sh-sample ${PREFIX}/etc/rc.d X ${INSTALL_SCRIPT} ${FILESDIR}/remouse ${PREFIX}/bin X X.include <bsd.port.mk> END-of-tpconfig/Makefile echo x - tpconfig/pkg-comment sed 's/^X//' >tpconfig/pkg-comment << 'END-of-tpconfig/pkg-comment' XConfigure the synaptics touchpad END-of-tpconfig/pkg-comment echo x - tpconfig/distinfo sed 's/^X//' >tpconfig/distinfo << 'END-of-tpconfig/distinfo' XMD5 (tpconfig-3.1.tar.gz) = 99b177d2aecc6d9370804c59a2cb2d45 END-of-tpconfig/distinfo echo x - tpconfig/pkg-descr sed 's/^X//' >tpconfig/pkg-descr << 'END-of-tpconfig/pkg-descr' XThis program allows the user to configure a synaptics touchpad - Xa pointing device used on many laptops. X XThe basic program is called tpconfig. Type tpconfig to see Xall of its options. It will not work if any other program Xis using the mouse (for example moused or X windows). Also, Xyou should not touch the touchpad while this program is running. X XI have also included a program remouse. This first kills the Xmoused daemon, then runs tpconfig with whatever options you have Xset, and then restarts the moused daemon. X XAlso included is a file /usr/local/etc/rc.d/remouse.sh-sample. You Xcan make whatever changes you like, and then rename it to Xremouse.sh, and then remouse will be called upon boot up. X XIMPORTANT: this port will not compile or work unless some changes Xare made to the kernel. You can find the required changes at Xhttp://www.freebsd.org/cgi/query-pr.cgi?pr=20352 X XWWW: http://www.compass.com/synaptics/ X XStephen Montgomery-Smith Xstephen@math.missouri.edu END-of-tpconfig/pkg-descr echo x - tpconfig/pkg-plist sed 's/^X//' >tpconfig/pkg-plist << 'END-of-tpconfig/pkg-plist' Xbin/tpconfig Xbin/remouse Xetc/rc.d/remouse.sh-sample END-of-tpconfig/pkg-plist echo c - tpconfig/files mkdir -p tpconfig/files > /dev/null 2>&1 echo x - tpconfig/files/patch-00 sed 's/^X//' >tpconfig/files/patch-00 << 'END-of-tpconfig/files/patch-00' X--- ../tpconfig-3.1-orig/tpconfig.c Wed Nov 15 09:37:59 2000 X+++ tpconfig.c Fri Jan 12 20:06:20 2001 X@@ -123,9 +123,15 @@ X int status; X if (*fd<0) X { X+#ifdef __FreeBSD__ X+ *fd = open("/dev/psm0", O_RDWR|O_NDELAY); X+ if (*fd<0) X+ fatal("Could not open PS/2 Port [/dev/psm0]"); X+#else X *fd = open("/dev/psaux", O_RDWR|O_NDELAY); X if (*fd < 0) X fatal("Could not open PS/2 Port [/dev/psaux]"); X+#endif X #ifdef __linux X /* If AUX_GRAB kernel patch present, use it. */ X while (ioctl (*fd, AUX_GRAB, 0) < 0) END-of-tpconfig/files/patch-00 echo x - tpconfig/files/patch-01 sed 's/^X//' >tpconfig/files/patch-01 << 'END-of-tpconfig/files/patch-01' X--- ../tpconfig-3.1-orig/utils.c Wed Nov 15 09:41:49 2000 X+++ utils.c Fri Jan 12 21:32:21 2001 X@@ -73,6 +73,61 @@ X #define TIMEOUT 3.0 /* wait for up to 3 seconds for a reply*/ X X /* General Rourines for PS2 port */ X+ X+#ifdef __FreeBSD__ X+ X+#include <sys/ioctl.h> X+#include <machine/mouse.h> X+#include <string.h> X+ X+#define INBUFLEN 100 X+static char inbuffer[INBUFLEN]; X+int inbuflen = 0; X+ X+print_buf(char s[], struct mousedata data) { X+ int i; X+ printf("%s %d:",s,data.len); X+ for (i=0;i<data.len;i++) printf(" %x",data.buf[i]); X+ printf("\n"); X+ fflush(stdout); X+} X+ X+int ps2_write(int fd,unsigned char *buffer,int num_bytes) { X+ struct mousedata data; X+ int i; X+ X+ assert(num_bytes<=sizeof(data.buf)/sizeof(int)); X+ for (i=0;i<num_bytes;i++) data.buf[i] = (unsigned int) buffer[i]; X+ data.len = num_bytes; X+ if (ioctl(fd,MOUSE_SENDREADCMD,&data)==-1) { X+ printf("Failed to read mouse properly\n"); X+ exit(1); X+ } X+ assert(inbuflen+1+data.len<=INBUFLEN); X+ inbuffer[inbuflen] = AUX_ACK; X+ for (i=0;i<data.len;i++) inbuffer[inbuflen+1+i] = data.buf[i]; X+ inbuflen += 1+data.len; X+ return num_bytes; X+} X+ X+int ps2_read(int fd,unsigned char *buffer,int num_bytes) { X+ int temp; X+ X+ if (num_bytes <= inbuflen) { X+ memcpy(buffer,inbuffer,num_bytes); X+ inbuflen -= num_bytes; X+ memcpy(inbuffer,inbuffer+num_bytes,inbuflen); X+ return num_bytes; X+ } else { X+ memcpy(buffer,inbuffer,inbuflen); X+ temp = inbuflen; X+ inbuflen = 0; X+ return temp; X+ } X+} X+ X+#else X+ X int ps2_write(int fd,unsigned char *buffer,int num_bytes) X { /* ps2_write */ X int bytes_written; X@@ -167,7 +222,7 @@ X return(at); X } /* ps2_read */ X X- X+#endif X X void version_info(void) X { /* version_info */ END-of-tpconfig/files/patch-01 echo x - tpconfig/files/remouse.sh-sample sed 's/^X//' >tpconfig/files/remouse.sh-sample << 'END-of-tpconfig/files/remouse.sh-sample' X#!/bin/sh Xcase "$1" in X start) X /usr/local/bin/remouse -t0 X echo -n ' remouse' X ;; X stop) X ;; X restart) X /usr/local/bin/remouse -t0 X echo -n ' remouse' X ;; X -h) X echo "Usage: `basename $0` { start | stop | restart }" X ;; X *) X /usr/local/bin/remouse -t0 X echo -n ' remouse' X ;; Xesac END-of-tpconfig/files/remouse.sh-sample echo x - tpconfig/files/remouse sed 's/^X//' >tpconfig/files/remouse << 'END-of-tpconfig/files/remouse' X#!/bin/sh X X# Suck in the configuration variables. Xif [ -r /etc/defaults/rc.conf ]; then X . /etc/defaults/rc.conf X source_rc_confs Xelif [ -r /etc/rc.conf ]; then X . /etc/rc.conf Xfi X Xif [ -f /var/run/moused.pid ]; then X kill `cat /var/run/moused.pid` X rm -f /var/run/moused.pid Xfi X X/usr/local/bin/tpconfig $@ X Xcase ${moused_enable} in X[Yy][Ee][Ss]) X /usr/sbin/moused -p ${moused_port} -t ${moused_type} ${moused_flags} X ;; Xesac END-of-tpconfig/files/remouse echo x - tpconfig/files/patch-10 sed 's/^X//' >tpconfig/files/patch-10 << 'END-of-tpconfig/files/patch-10' X--- ALPS.c-orig Fri Jan 12 21:16:27 2001 X+++ ALPS.c Fri Jan 12 21:27:31 2001 X@@ -52,7 +52,7 @@ X #include <fcntl.h> X #include <stdio.h> X #include <unistd.h> X-#include <assert.h> X+#define assert(e) if (!(e)){printf("assertion \"%s\" failed: file \"%s\", line %d\n",#e,__FILE__,__LINE__);exit(1);} /* assert without creating core on error */ X #include <sys/ioctl.h> X #include <sys/time.h> X #include <sys/timeb.h> X--- synaptics.c-orig Fri Jan 12 21:16:27 2001 X+++ synaptics.c Fri Jan 12 21:27:29 2001 X@@ -72,7 +72,7 @@ X #include <fcntl.h> X #include <stdio.h> X #include <unistd.h> X-#include <assert.h> X+#define assert(e) if (!(e)){printf("assertion \"%s\" failed: file \"%s\", line %d\n",#e,__FILE__,__LINE__);exit(1);} /* assert without creating core on error */ X #include <sys/ioctl.h> X #include <sys/time.h> X #include <sys/timeb.h> X--- tpconfig.c-orig Fri Jan 12 21:16:27 2001 X+++ tpconfig.c Fri Jan 12 21:27:30 2001 X@@ -88,7 +88,7 @@ X #include <fcntl.h> X #include <stdio.h> X #include <unistd.h> X-#include <assert.h> X+#define assert(e) if (!(e)){printf("assertion \"%s\" failed: file \"%s\", line %d\n",#e,__FILE__,__LINE__);exit(1);} /* assert without creating core on error */ X #include <sys/ioctl.h> X #include <sys/time.h> X #include <sys/timeb.h> X--- utils.c-orig Fri Jan 12 21:16:27 2001 X+++ utils.c Fri Jan 12 21:33:20 2001 X@@ -60,7 +60,7 @@ X #include <fcntl.h> X #include <stdio.h> X #include <unistd.h> X-#include <assert.h> X+#define assert(e) if (!(e)){printf("assertion \"%s\" failed: file \"%s\", line %d\n",#e,__FILE__,__LINE__);exit(1);} /* assert without creating core on error */ X #include <sys/ioctl.h> X #include <sys/time.h> X #include <sys/timeb.h> END-of-tpconfig/files/patch-10 exit >Release-Note: >Audit-Trail: >Unformatted: Stephen Montgomery-Smith To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101130337.f0D3bbE40459>