commit 947d165a432752f7ed1e69df0aac836a5044fc51d351a69adb410c208df46a47 Author: OBS User unknown Date: Mon Dec 18 23:16:41 2006 +0000 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gpm?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.SuSE b/README.SuSE new file mode 100644 index 0000000..548af6f --- /dev/null +++ b/README.SuSE @@ -0,0 +1,14 @@ +Dear customer, + +gpm is using more and more config files in /etc. Therefore we moved +all config files into /etc/gpm and removed "gpm-" from config file +names. + +For example: +/etc/gpm-root.conf -> /etc/gpm/root.conf +/etc/gpm-syn.conf -> /etc/gpm/syn.conf +... + + +Have a lot of fun, + Your SuSE team diff --git a/gpm-1.20.1-Gpm_Open.patch b/gpm-1.20.1-Gpm_Open.patch new file mode 100644 index 0000000..9449139 --- /dev/null +++ b/gpm-1.20.1-Gpm_Open.patch @@ -0,0 +1,22 @@ +--- src/lib/liblow.c ++++ src/lib/liblow.c +@@ -199,7 +199,7 @@ + Gpm_Stst *new = NULL; + char* sock_name = 0; + +- option.consolename = NULL; ++ if (checked_con == 0) option.consolename = NULL; + + gpm_report(GPM_PR_DEBUG,"VC: %d",flag); + +@@ -259,6 +257,10 @@ int Gpm_Open(Gpm_Connect *conn, int flag + gpm_report(GPM_PR_ERR,"checking tty name failed"); + goto err; + } ++ if (option.consolename == NULL) { ++ gpm_report(GPM_PR_ERR,"option.consolename not set"); ++ goto err; ++ } + /* do we really need this check ? */ + if(strncmp(tty,option.consolename,strlen(option.consolename)-1) + || !isdigit(tty[strlen(option.consolename)-1])) { diff --git a/gpm-1.20.1-ceil.patch b/gpm-1.20.1-ceil.patch new file mode 100644 index 0000000..8719cd0 --- /dev/null +++ b/gpm-1.20.1-ceil.patch @@ -0,0 +1,59 @@ +Note that GCC 4.0 will optimize ceil (constant), we therefore +have to make the argument non-constant. + +--- configure.in ++++ configure.in +@@ -91,6 +91,25 @@ + AC_CHECK_FUNCS(vsyslog syslog) + AC_FUNC_ALLOCA + ++AC_MSG_CHECKING(for ceil) ++AC_TRY_LINK([#define __NO_MATH_INLINES 1 +#include ++ double d;], ++ [d = ceil(1.0*d);], ++ SYNLDFLAGS="" ++ AC_MSG_RESULT(yes), ++ SYNLDFLAGS=-lm ++ AC_MSG_RESULT(no)) ++ ++if test "$SYNLDFLAGS" = "-lm" ; then ++ SAVE_LIBS="$LIBS" ++ AC_CHECK_LIB(m, ++ ceil, ++ , ++ echo "libmath.so is needed due the ceil function" ++ exit 1) ++ LIBS="$SAVE_LIBS" ++fi ++ + case $with_curses in + No|no|N|n) SHARED_LIBS=-lc ;; + *) +@@ -123,6 +142,7 @@ + AC_SUBST(SHLIB) + AC_SUBST(PICFLAGS) + AC_SUBST(SOLDFLAGS) ++AC_SUBST(SYNLDFLAGS) + AC_SUBST(CURSES_OBJS) + AC_SUBST(SHARED_LIBS) + AC_SUBST(lispdir) +--- src/Makefile.in ++++ src/Makefile.in +@@ -70,6 +70,7 @@ + all: gpm lib/@SHLIB@ lib/libgpm.a $(PROG) + + gpm: $(GOBJ) ++ $(CC) @LDFLAGS@ @SYNLDFLAGS@ $(GOBJ) -o gpm + + # construct dependings of sourcefiles and link sourcefiles + $(DEPFILE) dep: prog/gpm-root.c +@@ -154,7 +155,7 @@ + + lib/libgpm.so.@abi_full@: $(PICS) + $(CC) @SOLDFLAGS@libgpm.so.@abi_lev@ \ +- @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS) ++ @LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ @SYNLDFLAGS@ $(LIBS) + lib/libgpm.so: lib/libgpm.so.@abi_full@ + $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so + diff --git a/gpm-1.20.1-conf.patch b/gpm-1.20.1-conf.patch new file mode 100644 index 0000000..15d093c --- /dev/null +++ b/gpm-1.20.1-conf.patch @@ -0,0 +1,175 @@ +--- README ++++ README +@@ -102,7 +102,7 @@ + (string-match "con.*" (getenv "TERM")))) + (load-library "t-mouse")) + +-* If you want to use gpm-root, copy gpm-root.conf to your /usr/etc ++* If you want to use gpm-root, copy gpm-root.conf to your /etc/gpm/root.conf + directory, test it out and then edit it to suit your feels. + + * You'd like to name the gpm info file inside /usr/info/dir. Just insert +--- doc/README.silitek ++++ doc/README.silitek +@@ -14,11 +14,11 @@ + + Both types of mouse driver uses the system wide configuration file + +- /etc/gpm-silitek.conf ++ /etc/gpm/silitek.conf + + which defines the return values of any key not being mouse button + or mouse stick. For this keys the drag mouse button works as a +-modifier: pressed once, the last column in /etc/gpm-silitek.conf ++modifier: pressed once, the last column in /etc/gpm/silitek.conf + is used. To switch back to the normal return values, the drag mouse + button has to be pressed again. It is allowed to use escaped + sequences as return values. Characters other than printable can +@@ -169,7 +169,7 @@ + -------------------------------------------------------------------- + + the Multimedia keys on IR Keyboard SK-7100 are usable (for ncurses +-based programs see below). After editing /etc/gpm-silitek.conf ++based programs see below). After editing /etc/gpm/silitek.conf + to get the similar named keys to work similar, both the IR Keyboard + SK-7100 and the IR commander SM-1000 are usable in parallel. + +--- doc/README.synaptics ++++ doc/README.synaptics +@@ -25,8 +25,8 @@ + + These features can be enabled/disabled and many of them have time and speed + parameters which can be adjusted to the taste of the user. These parameters +-can be provided in the "/usr/etc/gpm-syn.conf" file (or +-/usr/local/etc/gpm-syn.conf, or /etc/gpm-syn.conf, according to how you ran ++can be provided in the "/etc/gpm/syn.conf" file (or /usr/etc/syn.conf ++/usr/local/etc/syn.conf, or /etc/syn.conf, according to how you ran + configure). Each line in this file has the following syntax: [param-name] + + +--- doc/README.twiddler ++++ doc/README.twiddler +@@ -101,23 +101,23 @@ + file, and provide documentation as well. Using a compulsory + configuration file reliefs my workload :-) + +-The file "gpm-twiddler.conf" that appears in the gpm configuration ++The file "twiddler.conf" that appears in the gpm configuration + includes the default keyboard map, and can be used right away. If the + file is not in place, gpm will complain about its absence. By default +-the file must live in /usr/etc (or /usr/local/etc, or whatever you ++the file must live in /etc/gpm (or /usr/local/etc, or whatever you + gave as a prefix to ./configure). The behaviour is similar for + different installation prefixes. The file is not installed by "make + install". If the file is missing, gpm will exit producing a message + like this: + +- ./gpm: /usr/etc/gpm-twiddler.conf: No such file or directory ++ ./gpm: /etc/gpm/twiddler.conf: No such file or directory + + The distributed configuration file includes its own documentation. + + If you want to add keys to the default file, you can avoid editing it +-by writing a "gpm-twiddler.user" file and putting it in the same +-directory as gpm-twiddler.conf. Gpm will read both files, in sequence, +-but won't complain if gpm-twiddler.user doesn't exist. ++by writing a "twiddler.user" file and putting it in the same ++directory as twiddler.conf. Gpm will read both files, in sequence, ++but won't complain if twiddler.user doesn't exist. + + Gpm will print an error message for any incorrect line in any of the + configuration files: error messages include the file name and the +--- doc/doc.gpm.in ++++ doc/doc.gpm.in +@@ -1981,7 +1981,7 @@ + + @item -u + Deny using user-specific configuration files. With this +- option on, only @file{/etc/gpm-root.conf} will be used as a source ++ option on, only @file{/etc/gpm/root.conf} will be used as a source + of configuration information. This option + is intended for those system administrators who fear security could + be broken by this daemon. Things should be sufficiently secure, but +@@ -2009,7 +2009,7 @@ + the daemon. + + %M The actual configuration file is better introduced by looking at your +-%M @file{/etc/gpm-root.conf}. ++%M @file{/etc/gpm/root.conf}. + %M + %MSKIP + +@@ -2196,7 +2196,7 @@ + .SH FILES + .nf + /dev/gpmctl The socket used to connect to gpm. +-/etc/gpm-root.conf The default configuration file. ++/etc/gpm/root.conf The default configuration file. + $(HOME)/.gpm-root The user configuration file. + /dev/vcs* Virtual Console Screens + .fi +--- doc/gpm.info ++++ doc/gpm.info +@@ -1604,7 +1604,7 @@ + + `-u' + Deny using user-specific configuration files. With this option on, +- only `/etc/gpm-root.conf' will be used as a source of ++ only `/etc/gpm/root.conf' will be used as a source of + configuration information. This option is intended for those + system administrators who fear security could be broken by this + daemon. Things should be sufficiently secure, but if you find a +--- src/headers/silitek.h ++++ src/headers/silitek.h +@@ -27,7 +27,7 @@ + extern void silitek_keys_ps2(unsigned char *data, int *drag); + extern int silitek_ghost_ps2(unsigned char *data); + extern int fd_silitek; +-#define SILI_SYSTEM_FILE SYSCONFDIR "/gpm-silitek.conf" ++#define SILI_SYSTEM_FILE SYSCONFDIR "/silitek.conf" + #define SILISTRLEN 32 + #define SILISTRSCN "key %32s %32s %32s" + extern void silitek_mapping(void); +--- src/headers/twiddler.h ++++ src/headers/twiddler.h +@@ -46,7 +46,7 @@ + #define TW_M_MASK 0x1FF /* mask of movement bits, after shifting */ + #define TW_M_BIT 0x100 + +-#define TW_SYSTEM_FILE SYSCONFDIR "/gpm-twiddler.conf" +-#define TW_CUSTOM_FILE SYSCONFDIR "/gpm-twiddler.user" ++#define TW_SYSTEM_FILE SYSCONFDIR "/twiddler.conf" ++#define TW_CUSTOM_FILE SYSCONFDIR "/twiddler.user" + + +--- src/prog/gpm-root.y ++++ src/prog/gpm-root.y +@@ -78,7 +78,7 @@ + #endif + + #define USER_CFG ".gpm-root" +-#define SYSTEM_CFG SYSCONFDIR "/gpm-root.conf" ++#define SYSTEM_CFG SYSCONFDIR "/root.conf" + + #define DEFAULT_FORE 7 + #define DEFAULT_BACK 0 +--- src/synaptics.c ++++ src/synaptics.c +@@ -2047,7 +2047,7 @@ + ** syn_read_config_file + ** + ** Read the configuration data from the global config file +-** SYSCONFDIR "/gpm-syn.conf". ++** SYSCONFDIR "/syn.conf". + */ + void tp_read_config_file (char* config_filename) + { +@@ -2171,7 +2171,7 @@ + gpm_report (GPM_PR_INFO, " Firmware version %d.%d\n", + ident.info_major, ident.info_minor); + +- tp_read_config_file ("gpm-syn.conf"); ++ tp_read_config_file ("syn.conf"); + + + /* Limit the options depending on the touchpad capabilities. This should be diff --git a/gpm-1.20.1-daemon_mode.patch b/gpm-1.20.1-daemon_mode.patch new file mode 100644 index 0000000..0d77b3e --- /dev/null +++ b/gpm-1.20.1-daemon_mode.patch @@ -0,0 +1,28 @@ +--- src/headers/message.h ++++ src/headers/message.h +@@ -145,6 +145,7 @@ + #define GPM_MESS_SETSID_FAILED "Setsid failed" + #define GPM_MESS_CHDIR_FAILED "change directory failed" + #define GPM_MESS_FORK_FAILED "Fork failed." ++#define GPM_MESS_DAEMON_FAILED "Change to run in background failed." + #define GPM_MESS_VCCHECK "Failed on virtual console check." + #define GPM_MESS_PROT_ERR "Error in protocol" + #define GPM_MESS_ROOT "You should be root to run gpm!" +--- src/startup.c ++++ src/startup.c +@@ -136,13 +136,8 @@ + + if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */ + /* goto background and become a session leader (Stefan Giessler) */ +- switch(fork()) { +- case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED); /* error */ +- case 0: option.run_status = GPM_RUN_DAEMON; break; /* child */ +- default: _exit(0); /* parent */ +- } +- +- if (setsid() < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_SETSID_FAILED); ++ if (daemon(0,0)) gpm_report(GPM_PR_OOPS,GPM_MESS_DAEMON_FAILED); /* error */ ++ option.run_status = GPM_RUN_DAEMON; + } + + /* damon init: check whether we run or not, display message */ diff --git a/gpm-1.20.1-gunze-overflow.patch b/gpm-1.20.1-gunze-overflow.patch new file mode 100644 index 0000000..9389108 --- /dev/null +++ b/gpm-1.20.1-gunze-overflow.patch @@ -0,0 +1,11 @@ +--- src/mice.c ++++ src/mice.c +@@ -2275,7 +2275,7 @@ + for (i=0; i<4; i++) + if (gunze_calib[i] & ~1023) calibok = 0; + if (gunze_calib[0] == gunze_calib[2]) calibok = 0; +- if (gunze_calib[1] == gunze_calib[4]) calibok = 0; ++ if (gunze_calib[1] == gunze_calib[3]) calibok = 0; + fclose(f); + } + if (!calibok) { diff --git a/gpm-1.20.1-no_templates_for_new_multiple_mode.patch b/gpm-1.20.1-no_templates_for_new_multiple_mode.patch new file mode 100644 index 0000000..843daa4 --- /dev/null +++ b/gpm-1.20.1-no_templates_for_new_multiple_mode.patch @@ -0,0 +1,51 @@ +--- src/Makefile.in ++++ src/Makefile.in +@@ -14,7 +14,7 @@ + # Main portion: regular build rules + + GSRC = main.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c silitek.c \ +- startup.c server_tools.c ++ startup.c + + GOBJ = $(GSRC:.c=.o) report.o tools.o + +--- src/gpn.c ++++ src/gpn.c +@@ -254,15 +254,12 @@ + case 'i': opt_time=atoi(optarg); break; + case 'k': check_kill(); break; + case 'l': opt_lut = optarg; break; +- case 'm': add_mouse(GPM_ADD_DEVICE,optarg); +- opt_dev = optarg; break; /* GO AWAY!*/ ++ case 'm': opt_dev = optarg; break; /* GO AWAY!*/ + case 'M': opt_double++; option.repeater++; + if (option.repeater_type == 0) + option.repeater_type = "msc"; + which_mouse=mouse_table+2; break; +- case 'o': add_mouse(GPM_ADD_OPTIONS,optarg); +- gpm_report(GPM_PR_DEBUG,"options: %s",optarg); +- opt_options = optarg; break; /* GO AWAY */ ++ case 'o': opt_options = optarg; break; /* GO AWAY */ + case 'p': opt_ptrdrag = 0; break; + case 'r': + /* being called responsiveness, I must take the inverse */ +@@ -276,8 +273,7 @@ + case 's': opt_sample = atoi(optarg); break; + case 'S': if (optarg) opt_special = optarg; + else opt_special=""; break; +- case 't': add_mouse(GPM_ADD_TYPE,optarg); +- opt_type = optarg; break; /* GO AWAY */ ++ case 't': opt_type = optarg; break; /* GO AWAY */ + case 'u': option.autodetect = 1; break; + case 'T': opt_test++; break; + case 'v': printf(GPM_MESS_VERSION "\n"); exit(0); +--- src/startup.c ++++ src/startup.c +@@ -158,7 +158,6 @@ + + /****************** OLD CODE from gpn.c END ***********************/ + +- init_mice(option.micelist); /* reads option.micelist */ + atexit(gpm_exited); /* call gpm_exited at the end */ + + } diff --git a/gpm-1.20.1-ps2_command_bytes.patch b/gpm-1.20.1-ps2_command_bytes.patch new file mode 100644 index 0000000..57b3502 --- /dev/null +++ b/gpm-1.20.1-ps2_command_bytes.patch @@ -0,0 +1,33 @@ +--- src/headers/gpmInt.h ++++ src/headers/gpmInt.h +@@ -91,21 +91,27 @@ + + /*** mouse commands ***/ + +-#define GPM_AUX_SEND_ID 0xF2 ++#define GPM_AUX_SEND_ID 0xF2 /* Get ID: ACK + 1 byte ID */ + #define GPM_AUX_ID_ERROR -1 + #define GPM_AUX_ID_PS2 0 + #define GPM_AUX_ID_IMPS2 3 + + /* these are shameless stolen from /usr/src/linux/include/linux/pc_keyb.h */ + +-#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ + #define GPM_AUX_SET_SCALE11 0xE6 /* Set 1:1 scaling */ + #define GPM_AUX_SET_SCALE21 0xE7 /* Set 2:1 scaling */ +-#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor */ ++#define GPM_AUX_SET_RES 0xE8 /* Set resolution */ ++#define GPM_AUX_GET_SCALE 0xE9 /* Get scaling factor: ACK + 3 byte status pack */ + #define GPM_AUX_SET_STREAM 0xEA /* Set stream mode */ ++#define GPM_AUX_GET_DATA 0xEB /* Read data: ACK + 3 byte movement pack */ ++#define GPM_AUX_RESET_WRAP 0xEC /* From wrap mode to previous */ ++#define GPM_AUX_SET_WRAP 0xEE /* Set wrap mode */ ++#define GPM_AUX_SET_REMOTE 0xF0 /* Set remote mode */ + #define GPM_AUX_SET_SAMPLE 0xF3 /* Set sample rate */ + #define GPM_AUX_ENABLE_DEV 0xF4 /* Enable aux device */ + #define GPM_AUX_DISABLE_DEV 0xF5 /* Disable aux device */ ++#define GPM_AUX_DEFAULTS 0xF6 /* Reset to defaults */ ++#define GPM_AUX_RESEND 0xFE /* Resend last pack */ + #define GPM_AUX_RESET 0xFF /* Reset aux device */ + #define GPM_AUX_ACK 0xFA /* Command byte ACK. */ + diff --git a/gpm-1.20.1-ps2_read.patch b/gpm-1.20.1-ps2_read.patch new file mode 100644 index 0000000..be53801 --- /dev/null +++ b/gpm-1.20.1-ps2_read.patch @@ -0,0 +1,11 @@ +--- src/gpm.c ++++ src/gpm.c +@@ -366,7 +366,7 @@ + + if((i=m_type->packetlen-howmany)) /* still to get */ + do { +- j = read(fd,edata-i,i); /* edata is pointer just after data */ ++ j = read(fd,edata-i,howmany); /* edata is pointer just after data */ + if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) + write(fifofd, edata-i, j); + i -= j; diff --git a/gpm-1.20.1-ps2_reconnection.patch b/gpm-1.20.1-ps2_reconnection.patch new file mode 100644 index 0000000..8596bd4 --- /dev/null +++ b/gpm-1.20.1-ps2_reconnection.patch @@ -0,0 +1,415 @@ +--- src/gpm.c ++++ src/gpm.c +@@ -71,7 +71,8 @@ + DEF_TIME, DEF_CLUSTER, DEF_THREE, DEF_GLIDEPOINT_TAP, + (char *)NULL /* extra */, + (Gpm_Type *)NULL, +- -1 ++ -1, ++ 0, 0 /* save byte, is_save_byte */ + } + }; + struct mouse_features *which_mouse; +@@ -329,25 +330,57 @@ + * fetch the actual device data from the mouse device, dependent on + * what Gpm_Type is being passed. + *-------------------------------------------------------------------*/ +-static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode) ++static inline char *getMouseData(int fd, Gpm_Type *type, int kd_mode, ++ unsigned char *save_byte , int *is_save_byte, ++ int *restart) + { + static unsigned char data[32]; /* quite a big margin :) */ + char *edata=data+type->packetlen; + int howmany=type->howmany; ++ int preread; + int i,j; + + /*....................................... read and identify one byte */ + +- if (read(fd, data, howmany)!=howmany) { +- if (opt_test) exit(0); +- gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); +- return NULL; ++ preread = 0; ++ if (*is_save_byte) { ++ /* one byte is saved, howmany must be 1 otherwise this ++ byte hasn't been saved */ ++ data[0] = *save_byte; ++ *is_save_byte = 0; ++ preread = 1; ++ } else { ++ if ((preread = read(fd, data, howmany))!=howmany) { ++ if (opt_test) exit(0); ++ gpm_report(GPM_PR_ERR,GPM_MESS_READ_FIRST, strerror(errno)); ++ return NULL; ++ } ++ } ++ ++ /* try to find sequence AA 00 which is generated by kernel-2.4.9 or higher ++ when PS/2 mouse was replugged */ ++ if ((m_type->isPS2 == 1) && (data[0] == 0xaa)) { ++ if (preread == 1) { ++ // read second byte ++ if (read(fd, &(data[1]),1) == 1) ++ preread += 1; ++ } ++ if ((preread >= 2) && (data[1] == 0x0)) { ++ gpm_report(GPM_PR_DEBUG,GPM_MESS_REPLUGGED); ++ *restart = 1; ++ return NULL; ++ } + } + + if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep) + write(fifofd, data, howmany); + + if ((data[0]&(m_type->proto)[0]) != (m_type->proto)[1]) { ++ if (preread > howmany) { ++ /* second byte was involuntary preread in test for PS/2 replugging */ ++ *save_byte = data[1]; ++ *is_save_byte = 1; ++ } + if (m_type->getextra == 1) { + data[1]=GPM_EXTRA_MAGIC_1; data[2]=GPM_EXTRA_MAGIC_2; + gpm_report(GPM_PR_DEBUG,GPM_EXTRA_DATA,data[0]); +@@ -357,6 +390,12 @@ + return NULL; + } + ++ if ((preread > howmany) && ++ (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep)) ++ /* one byte was read in test for replugging sequence and will be ++ used as normal data byte */ ++ write(fifofd, &(data[1]), 1); ++ + /*....................................... read the rest */ + + /* +@@ -364,13 +403,20 @@ + * tried ps2 with the original selection package, which called usleep() + */ + +- if((i=m_type->packetlen-howmany)) /* still to get */ ++ if((i=m_type->packetlen-preread) > 0) { /* still to get */ + do { + j = read(fd,edata-i,howmany); /* edata is pointer just after data */ + if (kd_mode!=KD_TEXT && fifofd != -1 && opt_rawrep && j > 0) + write(fifofd, edata-i, j); + i -= j; + } while (i && j); ++ } else { ++ if (preread > m_type->packetlen) { ++ /* second byte was involuntary preread in test for PS/2 replugging */ ++ *save_byte = data[1]; ++ *is_save_byte = 1; ++ } ++ } + + if (i) { + gpm_report(GPM_PR_ERR,GPM_MESS_READ_REST, strerror(errno)); +@@ -396,7 +442,7 @@ + * the data via repeat_fun() to the repeater device + *-------------------------------------------------------------------*/ + static inline int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, +- int kd_mode) ++ int kd_mode, unsigned char *save_byte, int *is_save_byte) + { + char *data; + static int fine_dx, fine_dy; +@@ -408,6 +454,7 @@ + fd_set fdSet; + static int newB=0, oldB=0, oldT=0; /* old buttons and Type to chain events */ + /* static int buttonlock, buttonlockflag; */ ++ int restart; + + #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) + #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \ +@@ -433,8 +480,11 @@ + FD_ZERO(&fdSet); FD_SET(fd,&fdSet); i=0; + + do { /* cluster loop */ +- if(((data=getMouseData(fd,m_type,kd_mode))==NULL) ++ restart = 0; ++ if(((data=getMouseData(fd,m_type,kd_mode, ++ save_byte,is_save_byte,&restart))==NULL) + || ((*(m_type->fun))(&nEvent,data)==-1) ) { ++ if (restart) return -1; + if (!i) return 0; + else break; + } +@@ -916,6 +966,32 @@ + exit(0); + } + ++static inline void initMouse(int i, int *fd, int *maxfd) ++{ ++ which_mouse=mouse_table+i; /* used to access options */ ++ ++ if (!opt_dev) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); ++ ++ if(!strcmp(opt_dev,"-")) *fd=0; /* use stdin */ ++ else if( (*fd=open(opt_dev,O_RDWR | O_NDELAY)) < 0) ++ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev); ++ ++ /* and then reset the flag */ ++ fcntl(*fd,F_SETFL,fcntl(*fd,F_GETFL) & ~O_NDELAY); ++ ++ /* create argc and argv for this device */ ++ mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); ++ ++ /* init the device, and use the return value as new mouse type */ ++ if (m_type->init) ++ m_type=(m_type->init)(*fd, m_type->flags, m_type, mouse_argc[i], ++ mouse_argv[i]); ++ if (!m_type) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); ++ ++ which_mouse->fd=*fd; ++ *maxfd=max(*fd, *maxfd); ++} ++ + /*-------------------------------------------------------------------*/ + int old_main() + { +@@ -928,28 +1004,7 @@ + Gpm_Event event; + + for (i = 1; i <= 1+opt_double; i++) { +- which_mouse=mouse_table+i; /* used to access options */ +- +- if (!opt_dev) gpm_report(GPM_PR_OOPS,GPM_MESS_NEED_MDEV); +- +- if(!strcmp(opt_dev,"-")) fd=0; /* use stdin */ +- else if( (fd=open(opt_dev,O_RDWR | O_NDELAY)) < 0) +- gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,opt_dev); +- +- /* and then reset the flag */ +- fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NDELAY); +- +- /* create argc and argv for this device */ +- mouse_argv[i] = build_argv(opt_type, opt_options, &mouse_argc[i], ','); +- +- /* init the device, and use the return value as new mouse type */ +- if (m_type->init) +- m_type=(m_type->init)(fd, m_type->flags, m_type, mouse_argc[i], +- mouse_argv[i]); +- if (!m_type) gpm_report(GPM_PR_OOPS,GPM_MESS_MOUSE_INIT); +- +- which_mouse->fd=fd; +- maxfd=max(fd, maxfd); ++ initMouse(i, &fd, &maxfd); + } + + /*....................................... catch interesting signals */ +@@ -1063,10 +1118,14 @@ + */ + + for (i=1; i <= 1+opt_double; i++) { ++ int rc; + which_mouse=mouse_table+i; /* used to access options */ + if (FD_ISSET(which_mouse->fd,&selSet)) { + FD_CLR(which_mouse->fd,&selSet); pending--; +- if (processMouse(which_mouse->fd, &event, m_type, kd_mode)) ++ rc = processMouse(which_mouse->fd, &event, m_type, kd_mode, ++ &(which_mouse->save_byte), ++ &(which_mouse->is_save_byte)); ++ if (rc > 0) { + /* pass it to the client, if any + * or to the default handler, if any + * or to the selection handler +@@ -1075,7 +1134,15 @@ + (cinfo[event.vc] && do_client(cinfo[event.vc], &event)) + || (cinfo[0] && do_client(cinfo[0], &event)) + || do_selection(&event); ++ } else if (rc == -1) { ++ /* try to reinitialise the mouse */ ++ FD_CLR(which_mouse->fd, &selSet); ++ close(which_mouse->fd); ++ initMouse(i, &fd, &maxfd); ++ FD_CLR(which_mouse->fd, &selSet); ++ which_mouse->is_save_byte=0; + } ++ } + } + + /*..................... got connection, process it */ +--- src/headers/gpmInt.h ++++ src/headers/gpmInt.h +@@ -142,6 +142,7 @@ + + int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ + /* itz Mon Jan 11 23:27:54 PST 1999 */ ++ int isPS2; /* is 1 for PS/2 mouses, 0 otherwise */ + } Gpm_Type; + + #define GPM_EXTRA_MAGIC_1 0xAA +@@ -165,6 +166,8 @@ + char *opt_options; /* extra textual configuration */ + Gpm_Type *m_type; + int fd; ++ unsigned char save_byte; ++ int is_save_byte; + }; + + extern struct mouse_features mouse_table[3], *which_mouse; /*the current one*/ +--- src/headers/message.h ++++ src/headers/message.h +@@ -65,6 +65,7 @@ + #define GPM_MESS_VERSION "gpm " GPM_RELEASE " (X-Mas), " GPM_RELEASE_DATE + #define GPM_MESS_STARTED "Started gpm successfully. Entered daemon mode." + #define GPM_MESS_KILLED "Killed gpm(%d)." ++#define GPM_MESS_REPLUGGED "Mouse was replugged" + #define GPM_MESS_SKIP_DATA "Skipping a data packet (?)" + #define GPM_MESS_DATA_4 "Data %02x %02x %02x (%02x)" + #define GPM_MESS_NO_MAGIC "No magic" +--- src/mice.c ++++ src/mice.c +@@ -2217,113 +2217,113 @@ + + {"mman", "The \"MouseMan\" and similar devices (3/4 bytes per packet).", + "Mouseman", M_mman, I_serial, CS7 | STD_FLG, /* first */ +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 1, 0, 0, 0}, + {"ms", "The original ms protocol, with a middle-button extension.", + "", M_ms, I_serial, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, + {"acecad", "Acecad tablet absolute mode(Sumagrapics MM-Series mode)", + "", M_summa, I_summa, STD_FLG, +- {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0}, ++ {0x80, 0x80, 0x00, 0x00}, 7, 1, 0, 1, 0, 0}, + {"bare", "Unadorned ms protocol. Needed with some 2-buttons mice.", + "Microsoft", M_bare, I_serial, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, + {"bm", "Micro$oft busmice and compatible devices.", + "BusMouse", M_bm, I_empty, STD_FLG, /* bm is sun */ +- {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0}, ++ {0xf8, 0x80, 0x00, 0x00}, 3, 3, 0, 0, 0, 0}, + {"brw", "Fellowes Browser - 4 buttons (and a wheel) (dual protocol?)", + "", M_brw, I_pnp, CS7 | STD_FLG, +- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0}, ++ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, 0, 0}, + {"cal", "Calcomp UltraSlate", + "", M_calus, I_calus, CS8 | CSTOPB | STD_FLG, +- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0}, ++ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 1, 0, 0}, + {"calr", "Calcomp UltraSlate - relative mode", + "", M_calus_rel, I_calus, CS8 | CSTOPB | STD_FLG, +- {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0}, ++ {0x80, 0x80, 0x80, 0x00}, 6, 6, 0, 0, 0, 0}, + #ifdef HAVE_LINUX_INPUT_H + {"evdev", "Linux Event Device", + "", M_evdev, I_empty, STD_FLG, +- {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL}, ++ {0x00, 0x00, 0x00, 0x00} , 16, 16, 0, 0, NULL, 0}, + #endif /* HAVE_LINUX_INPUT_H */ + {"exps2", "IntelliMouse Explorer (ps2) - 3 buttons, wheel unused", + "ExplorerPS/2", M_imps2, I_exps2, STD_FLG, +- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, ++ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0, 1}, + #ifdef HAVE_LINUX_JOYSTICK_H + {"js", "Joystick mouse emulation", + "Joystick", M_js, NULL, 0, +- {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0}, ++ {0xFC, 0x00, 0x00, 0x00}, 12, 12, 0, 0, 0 ,0}, + #endif + {"genitizer", "\"Genitizer\" tablet, in relative mode.", + "", M_geni, I_serial, CS8|PARENB|PARODD, +- {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, ++ {0x80, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, + {"gunze", "Gunze touch-screens (only button-1 events, by now)", + "", M_gunze, I_gunze, STD_FLG, +- {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL}, ++ {0xF9, 0x50, 0xF0, 0x30}, 11, 1, 0, 1, NULL, 0}, + {"imps2","Microsoft Intellimouse (ps2)-autodetect 2/3 buttons,wheel unused", + "", M_imps2, I_imps2, STD_FLG, +- {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2}, ++ {0xC0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, R_imps2 , 1}, + {"logi", "Used in some Logitech devices (only serial).", + "Logitech", M_logi, I_logi, CS8 | CSTOPB | STD_FLG, +- {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0}, ++ {0xe0, 0x80, 0x80, 0x00}, 3, 3, 0, 0, 0, 0}, + {"logim", "Turn logitech into Mouse-Systems-Compatible.", + "", M_logimsc, I_serial, CS8 | CSTOPB | STD_FLG, +- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0}, ++ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, 0, 0}, + {"mm", "MM series. Probably an old protocol...", + "MMSeries", M_mm, I_serial, CS8 | PARENB|PARODD | STD_FLG, +- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, ++ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, + {"ms3", "Microsoft Intellimouse (serial) - 3 buttons, wheel unused", + "", M_ms3, I_pnp, CS7 | STD_FLG, +- {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3}, ++ {0xc0, 0x40, 0xc0, 0x00}, 4, 1, 0, 0, R_ms3, 0}, + {"ms+", "Like 'ms', but allows dragging with the middle button.", + "", M_ms_plus, I_serial, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, + {"ms+lr", "'ms+', but you can reset m by pressing lr (see man page).", + "", M_ms_plus_lr, I_serial, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, + {"msc", "Mouse-Systems-Compatible (5bytes). Most 3-button mice.", + "MouseSystems", M_msc, I_serial, CS8 | CSTOPB | STD_FLG, +- {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc}, ++ {0xf8, 0x80, 0x00, 0x00}, 5, 1, 0, 0, R_msc, 0}, + {"mtouch", "MicroTouch touch-screens (only button-1 events, by now)", + "", M_mtouch, I_mtouch, STD_FLG, +- {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL}, ++ {0x80, 0x80, 0x80, 0x00}, 5, 1, 0, 1, NULL, 0}, + {"ncr", "Ncr3125pen, found on some laptops", + "", M_ncr, NULL, STD_FLG, +- {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0}, ++ {0x08, 0x08, 0x00, 0x00}, 7, 7, 0, 1, 0, 0}, + {"netmouse","Genius NetMouse (ps2) - 2 buttons and 2 buttons 'up'/'down'.", + "", M_netmouse, I_netmouse, CS7 | STD_FLG, +- {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0}, ++ {0xc0, 0x00, 0x00, 0x00}, 4, 1, 0, 0, 0 ,1}, + {"pnp", "Plug and pray. New mice may not run with '-t ms'.", + "", M_bare, I_pnp, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 3, 1, 0, 0, 0, 0}, + {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", + "PS/2", M_ps2, I_ps2, STD_FLG, +- {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2}, ++ {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2, 1}, + {"sun", "'msc' protocol, but only 3 bytes per packet.", + "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, +- {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0}, ++ {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, + {"summa", "Summagraphics or Genius tablet absolute mode(MM-Series)", + "", M_summa, I_summa, STD_FLG, +- {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa}, ++ {0x80, 0x80, 0x00, 0x00}, 5, 1, 0, 1, R_summa, 0}, + {"syn", "The \"Synaptics\" serial TouchPad.", + "synaptics", M_synaptics_serial, I_serial, CS7 | STD_FLG, +- {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0}, ++ {0x40, 0x40, 0x40, 0x00}, 6, 6, 1, 0, 0 ,0}, + {"synps2", "The \"Synaptics\" PS/2 TouchPad", + "synaptics_ps2", M_synaptics_ps2, I_synps2, STD_FLG, +- {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0}, ++ {0x80, 0x80, 0x00, 0x00}, 6, 1, 1, 0, 0, 1}, + {"twid", "Twidddler keyboard", + "", M_twid, I_twid, CS8 | STD_FLG, +- {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0}, ++ {0x80, 0x00, 0x80, 0x80}, 5, 1, 0, 0, 0 ,0}, + {"vsxxxaa", "The DEC VSXXX-AA/GA serial mouse on DEC workstations.", + "", M_vsxxx_aa, I_serial, CS8 | PARENB | PARODD | STD_FLG, +- {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0}, ++ {0xe0, 0x80, 0x80, 0x00}, 3, 1, 0, 0, 0, 0}, + {"wacom","Wacom Protocol IV Tablets: Pen+Mouse, relative+absolute mode", + "", M_wacom, I_wacom, STD_FLG, +- {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0}, ++ {0x80, 0x80, 0x80, 0x00}, 7, 1, 0, 0, 0, 0}, + {"wp", "Genius WizardPad tablet", + "wizardpad", M_wp, I_wp, STD_FLG, +- {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0}, ++ {0xFA, 0x42, 0x00, 0x00}, 10, 1, 0, 1, 0 ,0}, + {"", "", + "", NULL, NULL, 0, +- {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0} ++ {0x00, 0x00, 0x00, 0x00}, 0, 0, 0, 0, 0, 0} + }; + + /*------------------------------------------------------------------------*/ diff --git a/gpm-1.20.1-quiet_libgpm.patch b/gpm-1.20.1-quiet_libgpm.patch new file mode 100644 index 0000000..cb4f175 --- /dev/null +++ b/gpm-1.20.1-quiet_libgpm.patch @@ -0,0 +1,18 @@ +--- src/lib/report-lib.c ++++ src/lib/report-lib.c +@@ -26,6 +26,7 @@ + + void gpm_report(int line, char *file, int stat, char *text, ... ) + { ++#ifndef QUIET_LIBGPM + char *string = NULL; + va_list ap; + va_start(ap,text); +@@ -43,5 +44,7 @@ + + va_end(ap); + ++#endif /* QUIET_LIBGPM */ ++ + if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ + } diff --git a/gpm-1.20.1-silitek.patch b/gpm-1.20.1-silitek.patch new file mode 100644 index 0000000..e2d901c --- /dev/null +++ b/gpm-1.20.1-silitek.patch @@ -0,0 +1,1117 @@ +--- conf/gpm-silitek.conf ++++ conf/gpm-silitek.conf +@@ -0,0 +1,45 @@ ++# Standard key mapping for Silitek SM-1000 ++# on Linux virtual console (TERM=linux) ++key 1 1 1 ++key 2 2 2 ++key 3 3 3 ++key 4 4 4 ++key 5 5 5 ++key 6 6 6 ++key 7 7 7 ++key 8 8 8 ++key 9 9 9 ++key 0 0 0 ++key * * * ++key # # # ++# Ctrl+Q ++key > \021 \021 ++# Ctrl+S ++key || \023 \023 ++# Crtl+C ++key [] \003 \003 ++# End ++key >>| \033[4~ \033[4~ ++# Home ++key |<< \033[1~ \033[1~ ++# Delete ++key Mute \033[3~ \033[3~ ++# Cursor up ++key Vol+ \033[A \033[A ++# Cursor down ++key Vol- \033[B \033[B ++# Insert ++key Display \033[2~ \033[2~ ++# Page up ++key PgUp \033[5~ \033[5~ ++Page down ++key PgDn \033[6~ \033[6~ ++# Cursor left ++key Back \033[D \033[D ++# Cursor right ++key Forward \033[C \033[C ++# F1 upto F4 ++key CD \033[[A \033[[A ++key ShowWiz \033[[B \033[[B ++key WWW \033[[C \033[[C ++key Close \033[[D \033[[D +--- doc/README.silitek ++++ doc/README.silitek +@@ -0,0 +1,188 @@ ++This README describes the support for the Silitek SM-1000 IR commander ++(also called Netshooter). ++ ++This IR commander can be used with two types of mouse driver: ++ ++ * Type `silicom' supports the IR receiver which is shipped the ++ SM-1000 and plugged into a serial connector. ++ ++ * Type `silips2' supports the IR receiver which is shipped ++ with the Silitek IR keyboard SK-7100 (also called Airboard). ++ The mouse connector of this IR receiver should be plugged ++ into the PS/2 mouse connector (not to a serial connector). ++ You may need an adapter (9 pin serial to PS/2) to do this. ++ ++Both types of mouse driver uses the system wide configuration file ++ ++ /etc/gpm-silitek.conf ++ ++which defines the return values of any key not being mouse button ++or mouse stick. For this keys the drag mouse button works as a ++modifier: pressed once, the last column in /etc/gpm-silitek.conf ++is used. To switch back to the normal return values, the drag mouse ++button has to be pressed again. It is allowed to use escaped ++sequences as return values. Characters other than printable can ++be coded by using the backslash, e.g. `\033' for the octal number ++of the special character ESC (Escape) of `\x0D' for the hexadecimal ++number of the special character CR (Carriage Return), for more ++codings see the manual page ascii(7). ++ ++The default key mapping for the SM-1000 IR commander is on the ++virtual console is: ++ ++ SM-1000 Key normal drag active ++ ------------------------------------- ++ key 1 1 1 ++ key 2 2 2 ++ key 3 3 3 ++ key 4 4 4 ++ key 5 5 5 ++ key 6 6 6 ++ key 7 7 7 ++ key 8 8 8 ++ key 9 9 9 ++ key 0 0 0 ++ key * * * ++ key # # # ++ key > Ctrl Q Ctrl Q ++ key || Ctrl S Ctrl S ++ key [] Crtl C Crtl C ++ key >>| End End ++ key |<< Home Home ++ key Mute Delete Delete ++ key Vol+ Cursor Up Cursor Up ++ key Vol- Cursor Down Cursor Down ++ key Display Insert Insert ++ key PgUp Page Up Page Up ++ key PgDn Page Down Page Down ++ key Back Cursor Left Cursor Left ++ key Forward Cursor Right Cursor Right ++ key CD F1 F1 ++ key ShowWiz F2 F2 ++ key WWW F3 F3 ++ key Close F4 F4 ++ ++Usage with the IR receiver of the Silitek Keyboard SK-7100: ++ ++In comparison of the IR receiver of shipped with the SM-1000 ++this IR receiver has the advantage that both mouse interface ++of the IR keyboard and the IR Netshooter can be used in parallel. ++One advantage more is that only one IR receiver is required to ++use both the IR keyboard and the IR Netshooter. Next point is ++that the IR receiver of the IR keyboard seems to more insensitive ++for other IR commanders like those from TV sets. ++ ++The Multimedia keys of the IR keyboard SK-7100 can be configured ++by using setkeycodes(8) and loadkeys(8) to be usable in parallel ++to those of the IR commander SM-1000. ++ ++Notice: The key 7 of the IR commander SM-1000 generates the keyboard ++scancode for KP_ENTER if the SK-7100 keyboard is used in parallel. ++This happens even if the mouse type `silicom' is used in conjunction ++with the IR receiver of the SM-1000. This because if both IR receiver ++are used, the SM-1000 and the SK-7100, both receives signals from the ++SM-1000. Therefore this key should be disabled (note that the SK-7100 ++does not have a KP_ENTER): ++ ++-------------------------------------------------------------------- ++loadkeys <<-EOF ++keycode 96 = F39 ++string F39 = "" ++EOF ++-------------------------------------------------------------------- ++ ++With `showkeys -s' on the virtual console and `xev' under X11 the ++the other Multimedia keys of the SK-7100 causes the following ++scancodes/keycodes: ++ ++ SK-7100 Key console X11 ++ -------------------------- ++ Close e017 151 ++ CD e025 165 ++ Video e018 152 ++ WWW e032 178 ++ U/P e01e 158 ++ |<< e010 144 ++ || e012 146 ++ > e022 162 ++ [] e024 164 ++ >>| e019 153 ++ Vol- e02e 174 ++ Vol+ e030 176 ++ Mute e020 160 ++ Display e026 166 ++ ++If we map for e.g. the keys ++ ++ Video Switch to vc 8 where the Video Recoder Program runs (Console_8) ++ |<< Cursor Left (keycode 105) ++ >>| Cursor Right (keycode 106) ++ Display Win Menu key (keycode 127) ++ ++(Compares this with `dumpkeys | less' on a virtual console). ++ ++With the following command sequence (called in a script during boot): ++ ++-------------------------------------------------------------------- ++setkeycodes \ ++ e017 85 \ ++ e025 89 \ ++ e018 90 \ ++ e032 91 \ ++ e01e 92 \ ++ e010 105 \ ++ e012 94 \ ++ e022 95 \ ++ e024 120 \ ++ e019 106 \ ++ e02e 122 \ ++ e030 123 \ ++ e020 124 \ ++ e026 127 ++loadkeys <<-EOF ++ keycode 85 = F50 ++ keycode 89 = F51 ++ keycode 90 = Console_8 ++ keycode 91 = F53 ++ keycode 92 = F54 ++ keycode 94 = F56 ++ keycode 95 = F57 ++ keycode 120 = F58 ++ keycode 122 = F60 ++ keycode 123 = F61 ++ keycode 124 = F62 ++ keycode 127 = F63 ++ keycode 96 = F39 ++ string F50 = "\033[[Z" ++ string F51 = "\033[[Y" ++ string F53 = "\033[[W" ++ string F54 = "\033[[U" ++ string F56 = "\033[[H" ++ string F57 = "\033[[T" ++ string F58 = "\033[[F" ++ string F60 = "\033[[L" ++ string F61 = "\033[[M" ++ string F62 = "\033[[X" ++ string F63 = "\033[[R" ++ string F39 = "" ++EOF ++-------------------------------------------------------------------- ++ ++the Multimedia keys on IR Keyboard SK-7100 are usable (for ncurses ++based programs see below). After editing /etc/gpm-silitek.conf ++to get the similar named keys to work similar, both the IR Keyboard ++SK-7100 and the IR commander SM-1000 are usable in parallel. ++ ++For ncurses based programs the added keys have to be extended ++by dumping the current terminfo entry for the virtual consoles ++for TERM=linux: ++ ++ infocmp -1 linux > linux.tic ++ ++and editing the file linux.tic which means adding the function ++keys kf50, kf51, kf52, kf53, kf54, kf56, kf57, kf58, kf60, kf61, ++kf62, kf63, and kf39. After that the command ++ ++ tic linux.tic ++ ++installs the edited terminfo entry for TERM=linux. +--- src/Makefile.in ++++ src/Makefile.in +@@ -13,7 +13,7 @@ + + # Main portion: regular build rules + +-GSRC = main.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c \ ++GSRC = main.c gpm.c gpn.c mice.c special.c twiddler.c synaptics.c silitek.c \ + startup.c server_tools.c + + GOBJ = $(GSRC:.c=.o) report.o tools.o +@@ -24,7 +24,7 @@ + + PICS = $(LOBJ:.o=.lo) + +-HDRS = gpm.h gpmInt.h twiddler.h synaptics.h message.h ++HDRS = gpm.h gpmInt.h twiddler.h synaptics.h silitek.h message.h + + PSRC = prog/mev.c prog/hltest.c prog/mouse-test.c prog/disable-paste.c + +@@ -143,7 +143,7 @@ + $(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $< + $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.a + +-prog/mouse-test: mice.o twiddler.o synaptics.o ++prog/mouse-test: mice.o twiddler.o synaptics.o silitek.o + + $(PROG): lib/libgpm.so lib/@SHLIB@ lib/libgpm.a + +--- src/headers/message.h ++++ src/headers/message.h +@@ -194,6 +194,10 @@ + #define GPM_MESS_INCORRECT_LINE "%s: %s :%i: Incorrect line:\"%s\"" + #define GPM_MESS_FIRST_DEV "Use -m device -t protocol [-o options]!" + ++#define GPM_MESS_SILIPS2_ENABLE "silips2: enable error" ++#define GPM_MESS_SILIPS2_DISABLE "silips2: disable error" ++#define GPM_MESS_SILIPS2_RESET "silips2: reset error" ++ + + /* warnings */ + #define GPM_MESS_REQUEST_ON "Request on vc %i > %i" +--- src/headers/silitek.h ++++ src/headers/silitek.h +@@ -0,0 +1,33 @@ ++/* ++ * silitek.h - support for the Silitek SM-1000 (Netshooter) with its IR ++ * receiver plugged serial connector and also with the IR ++ * receiver of the Silitek SK-7100 keyboard (Airboard) ++ * PS2 mouse connector. ++ * ++ * Copyright 2002 Werner Fink ++ * ++ * 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; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++extern int silitek_get_check(unsigned char *data); ++extern int silitek_get_check_ps2(unsigned char *data); ++extern void silitek_keys(unsigned char *data, int *drag); ++extern void silitek_keys_ps2(unsigned char *data, int *drag); ++extern int silitek_ghost_ps2(unsigned char *data); ++extern int fd_silitek; ++#define SILI_SYSTEM_FILE SYSCONFDIR "/gpm-silitek.conf" ++#define SILISTRLEN 32 ++#define SILISTRSCN "key %32s %32s %32s" ++extern void silitek_mapping(void); +--- src/mice.c ++++ src/mice.c +@@ -74,6 +74,7 @@ + #include "headers/gpmInt.h" + #include "headers/twiddler.h" + #include "headers/synaptics.h" ++#include "headers/silitek.h" + #include "headers/message.h" + + /*========================================================================*/ +@@ -667,6 +668,86 @@ + + } + ++#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) ++static int M_silitek_ps2(Gpm_Event *state, unsigned char *data) ++{ ++ static int drag = 0; ++ ++ if (!silitek_get_check_ps2(data)) ++ return -1; ++ ++ /* ++ * Map some ghost mouse PS2 events caused by the other ++ * keys. Maybe there is a better initialization for the chip ++ * of the SK-7100 IR receiver which would avoid those events. ++ */ ++ (void)silitek_ghost_ps2(data); ++ ++ /* All none PS2 events */ ++ if (data[0] & 0xc0) ++ { ++ silitek_keys_ps2(data, &drag); ++ return -1; /* Do not highlight, but success */ ++ } ++ ++ state->buttons = ((data[0]&0x01)<<2)|(data[0]&0x02)|((data[0]&0x04)>>2); ++ ++ /* Drag is just a modifier for none mouse keys */ ++ if (state->buttons&GPM_B_LEFT) ++ drag = ((!drag) ? 1 : 0); ++ else ++ drag = 0; ++ ++ if(data[1]) state->dx = (data[0] & 0x10) ? data[1] - 0xFF : data[1]; ++ if(data[2]) state->dy = -((data[0] & 0x20) ? data[2] - 0xFF : data[2]); ++ ++ return 0; ++} ++ ++static int M_silitek(Gpm_Event *state, unsigned char *data) ++{ ++ static int drag = 0; ++ ++ if (!silitek_get_check(data)) ++ return -1; ++ ++ /* All none mouse events */ ++ if (!(data[0] & 0x40)) ++ { ++ silitek_keys(data, &drag); ++ return -1; /* Do not highlight, but success */ ++ } ++ ++ /* ++ * Sanity check: SM-1000 mouse events do not use this bit ++ * but Keyboard SK-7100 PgUp/PgDn/`x' ++ * (0xfe5da5/0xfd5da5/0x7c845d) ++ */ ++ if ((data[1] & 0x40) || (data[2] & 0x40)) ++ return -1; ++ ++ switch(data[0]) ++ { ++ case 0xfe: state->buttons = GPM_B_LEFT; break; ++ case 0xfd: state->buttons = GPM_B_RIGHT; break; ++ case 0x7f: state->buttons = GPM_B_BOTH; break; ++ case 0x7c: state->buttons = 0; break; ++ default: return -1; /* Do not highlight */ ++ break; ++ } ++ ++ /* Drag is just a modifier for none mouse keys */ ++ if (state->buttons&GPM_B_LEFT) ++ drag = ((!drag) ? 1 : 0); ++ else ++ drag = 0; ++ ++ state->dx = (data[1] & 0x20) ? ((data[1] & 0x1f) - 0x20) : (data[1] & 0x1f); ++ state->dy = (data[2] & 0x20) ? ((data[2] & 0x1f) - 0x20) : (data[2] & 0x1f); ++ ++ return 0; ++} ++ + static int M_netmouse(Gpm_Event *state, unsigned char *data) + { + /* Avoid these beasts if you can. They connect to normal PS/2 port, +@@ -745,7 +826,6 @@ + return type; + } + +-#define GPM_B_BOTH (GPM_B_LEFT|GPM_B_RIGHT) + static int M_mman(Gpm_Event *state, unsigned char *data) + { + /* +@@ -1828,7 +1908,7 @@ + * + * Returns 0 if OK, or >0 if 1 or more errors occurred. + */ +-static int write_to_mouse(int fd, unsigned char *data, size_t len) ++static int write_to_mouse(int fd, const unsigned char *data, size_t len) + { + int i; + int error = 0; +@@ -1845,6 +1925,89 @@ + return(error); + } + ++static Gpm_Type *I_silitek(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) ++{ ++ struct termios tty; ++ int speed = B1200; ++ fd_silitek = fd; ++ ++ tcgetattr(fd, &tty); ++ cfmakeraw(&tty); ++ cfsetspeed(&tty, speed); ++ tty.c_cc[VMIN] = 1; ++ tty.c_cc[VTIME] = 0; ++ tty.c_cflag |= CS8; ++#if 0 ++ tty.c_cflag &= ~(CRTSCTS|CSTOPB|PARODD); ++ tty.c_cflag |= flags; ++#endif ++ tcsetattr(fd, TCSAFLUSH, &tty); ++ silitek_mapping(); ++ ++ return type; ++} ++ ++static Gpm_Type *I_silitek_ps2(int fd, unsigned short flags, struct Gpm_Type *type, int argc, char **argv) ++{ ++ const unsigned char off[] = {GPM_AUX_DISABLE_DEV, }; ++ const unsigned char buf[] = {GPM_AUX_SET_RES, 3, ++ GPM_AUX_SET_SCALE11, ++ GPM_AUX_SET_SAMPLE, 200, ++ GPM_AUX_ENABLE_DEV, }; ++ int n, c, err, id; ++ ++ fd_silitek = fd; ++ ++ (void)write_to_mouse(fd, off, sizeof(off)); ++ ++ err=1; ++ for (n = 0; n < 3 && err; n++) ++ { ++ err=0; ++ c = GPM_AUX_RESET; ++ write(fd, &c, 1); ++ read(fd, &c, 1); ++ if (c != GPM_AUX_ACK) err++; ++ read(fd, &c, 1); ++ if (c != 0xAA) err++; ++ read(fd, &c, 1); ++ if (c != 0x00) err++; ++ if (err) usleep(50000); ++ } ++ ++ (void)write_to_mouse(fd, buf, sizeof(buf)); ++ usleep(50000); ++ ++ if ((id = read_mouse_id(fd)) == GPM_AUX_ID_ERROR) ++ { ++ if (write_to_mouse(fd, off, sizeof(off))) ++ gpm_report(GPM_PR_ERR,GPM_MESS_SILIPS2_DISABLE); ++ ++ err=1; ++ for (n = 0; n < 3 && err; n++) ++ { ++ err=0; ++ c = GPM_AUX_RESET; ++ write(fd, &c, 1); ++ read(fd, &c, 1); ++ if (c != GPM_AUX_ACK) err++; ++ read(fd, &c, 1); ++ if (c != 0xAA) err++; ++ read(fd, &c, 1); ++ if (c != 0x00) err++; ++ if (err) ++ usleep(50000); ++ } ++ if (err > 0) ++ gpm_report(GPM_PR_ERR,GPM_MESS_SILIPS2_RESET); ++ if (write_to_mouse(fd, buf, sizeof(buf))) ++ gpm_report(GPM_PR_ERR,GPM_MESS_SILIPS2_ENABLE); ++ id = 0x00; ++ } ++ silitek_mapping(); ++ ++ return type; ++} + + /* intellimouse, ps2 version: Ben Pfaff and Colin Plumb */ + /* Autodetect: Steve Bennett */ +@@ -2297,6 +2460,12 @@ + {"ps2", "Busmice of the ps/2 series. Most busmice, actually.", + "PS/2", M_ps2, I_ps2, STD_FLG, + {0xc0, 0x00, 0x00, 0x00}, 3, 1, 0, 0, R_ps2, 1}, ++ {"silips2","Silitek SM-1000 Netshooter plugged into ps/2 mouse connector.", ++ "SiliPS/2", M_silitek_ps2, I_silitek_ps2, STD_FLG, ++ {0x00, 0x00, 0x00, 0x00}, 1, 1, 0, 0, 0, 1}, ++ {"silicom","Silitek SM-1000 Netshooter plugged into serial connector.", ++ "SiliCom", M_silitek, I_silitek, STD_FLG, ++ {0x20, 0x20, 0x00, 0x00}, 1, 1, 0, 0, 0, 0}, + {"sun", "'msc' protocol, but only 3 bytes per packet.", + "", M_sun, I_serial, CS8 | CSTOPB | STD_FLG, + {0xf8, 0x80, 0x00, 0x00}, 3, 1, 0, 0, 0, 0}, +--- src/silitek.c ++++ src/silitek.c +@@ -0,0 +1,580 @@ ++/* ++ * silitek.c - support for the Silitek SM-1000 (Netshooter) with its IR ++ * receiver plugged serial connector and also with the IR ++ * receiver of the Silitek SK-7100 keyboard (Airboard) ++ * PS2 mouse connector. ++ * ++ * Copyright 2002 Werner Fink ++ * ++ * 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; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++/* ++ * Serial settings used herein: raw but I/O with baud rate 1200 and 8bit (YES!) ++ * For testing, e.g.: stty -a < /dev/ttyS1 ++ * To set this, e.g.: stty raw 1200 cs8 < /dev/ttyS1 ++ * For reading keycodes use, e.g.: ++ * od [-j (1|2)] -v -t x1 --width=3 < /dev/ttyS1 ++ * compare with I_silitek() in mice.c. ++ * Which provides following keycodes received by the IR receiver ++ * included in the SM-1000 shipment for the SM-1000 its self: ++ * ++ * First byte: 0xbf (Key down, 8 bit striped this is 0x3f) ++ * 0x31 (Key hold down) ++ * 0x2a (Key up) ++ * 0x7c (Mouse event: move, any button up) ++ * 0x7f (Mouse event: move, l+r-mouse button down) ++ * 0xfd (Mouse event: move, r-mouse button down) ++ * 0xfe (Mouse event: move, l-mouse button down) ++ * Which provides: Any if (byte0 & 0x20) == 0x20 (for GPM protocol check) ++ * Key if (byte0 & 0x40) == 0x00 ++ * Mouse if (byte0 & 0x40) == 0x40 ++ * Second and third byte (unsigned char, aka 8bits): ++ * 1: 0xc1 0xfe ++ * 2: 0xc2 0xfd ++ * 3: 0x43 0x7c ++ * 4: 0xc4 0xfb ++ * 5: 0x45 0x7a ++ * 6: 0x46 0x79 ++ * 7: 0xc7 0xf8 ++ * 8: 0xc8 0xf7 ++ * 9: 0x49 0x76 ++ * 0: 0x4a 0x75 ++ * *: 0xcb 0xf4 ++ * #: 0x4c 0x73 ++ * >: 0xcd 0xf2 ++ * ||: 0xce 0xf1 ++ * []: 0x4f 0x70 ++ * >>|: 0xd0 0xef ++ * |<<: 0x51 0x6e ++ * Mute: 0x52 0x6d ++ * Vol+: 0xd3 0xec ++ * Vol-: 0x54 0x6b ++ * Display: 0xd5 0xea ++ * PgUp: 0xd6 0xe9 ++ * PgDn: 0x57 0x68 ++ * Back: 0x58 0x67 ++ * Forward: 0xd9 0xe6 ++ * CD: 0xda 0xe5 ++ * ShowWiz: 0x5b 0x64 ++ * WWW: 0xdc 0xe3 ++ * Close: 0x5d 0x62 ++ * Which provides: byte1 & 0x20 == 0x00, byte1 & 0x40 == 0x40 ++ * (byte1 & 0x7f) & (byte2 & 0x7f) == 0x40 ++ * (byte1 & 0x7f) | (byte2 & 0x7f) == 0x7f ++ * (byte1 & 0x1f) == keycode ++ * ++ * No mouse move but mouse button: ++ * 0x80 0x80 ++ * Mouse move but no button: ++ * right (byte1 & 0x20) == 0x20 ++ * left (byte2 & 0x20) == 0x20 ++ * value (byte1 & 0x1f), (byte2 & 0x1f) ++ * Mouse move and button: ++ * OR combinations from above. ++ * In both bytes, byte1 and byte2, the 0x40 bit seeems not to be used. ++ * ++ * PS2 settings used herin: Standard PS2 mouse. ++ * For reading keycodes use, e.g.: ++ * od [-j (1|2)] -v -t x1 --width=3 < /dev/psaux ++ * compare with I_silitek_ps2() in mice.c. ++ * Which provides following keycodes received by the IR receiver ++ * included in the SK-7100 shipment for the SM-1000 keys: ++ * ++ * First byte: 0xe7 (Key down) ++ * 0xd7 (Key hold down) ++ * 0xf7 (Key up) ++ * byte0 & 0xc0 == 0x00 (PS2 mouse event) ++ * Which provides: Key if (byte0 & 0xc0) == 0xc0 ++ * Mouse if (byte0 & 0xc0) == 0x00 (PS2 mouse) ++ * In other words: No GPM protocol check. ++ * Second and third byte (unsigned char, aka 8bits): ++ * 1: 0x01 0xfe ++ * 2: 0x02 0xfd ++ * 3: 0x03 0xfc ++ * 4: 0x04 0xfb ++ * 5: 0x05 0xfa ++ * 6: 0x06 0xf9 ++ * 7: 0x07 0xf8 ++ * 8: 0x08 0xf7 ++ * 9: 0x09 0xf6 ++ * 0: 0x0a 0xf5 ++ * *: 0x0b 0xf4 ++ * #: 0x0c 0xf3 ++ * >: 0x0d 0xf2 ++ * ||: 0x0e 0xf1 ++ * []: 0x0f 0xf0 ++ * >>|: 0x10 0xef ++ * |<<: 0x11 0xee ++ * Mute: 0x12 0xed ++ * Vol+: 0x13 0xec ++ * Vol-: 0x14 0xeb ++ * Display: 0x15 0xea ++ * PgUp: 0x16 0xe9 ++ * PgDn: 0x17 0xe8 ++ * Back: 0x18 0xe7 ++ * Forward: 0x19 0xe6 ++ * CD: 0x1a 0xe5 ++ * ShowWiz: 0x1b 0xe4 ++ * WWW: 0x1c 0xe3 ++ * Close: 0x1d 0xe2 ++ * Which provides: byte1 & byte2 == 0x00 ++ * byte1 | byte2 == 0xff ++ * byte1 == keycode ++ * ++ * Mouse is standard PS2 mouse ++ */ ++ ++/* ++ * TODO ++ * Serial part: Find device settings which avoids changing IR sequences of other ++ * vendors like from Sony TV commanders. This because to filter ++ * them out. ++ * PS2 part: Better device settings which avoids the `ghost' mouse events ++ * caused by the other keys. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "headers/gpm.h" ++#include "headers/silitek.h" ++#include "headers/gpmInt.h" ++#include "headers/message.h" ++ ++int fd_silitek = -1; ++ ++struct silitek_key_struct { ++ char *key; ++ char item[32]; ++ char drag[32]; ++} static K_silitek[] = { ++ /* TERM=linux */ ++ { NULL, "", "" }, ++ {"1", "1", "1" }, ++ {"2", "2", "2" }, ++ {"3", "3", "3" }, ++ {"4", "4", "4" }, ++ {"5", "5", "5" }, ++ {"6", "6", "6" }, ++ {"7", "7", "7" }, ++ {"8", "8", "8" }, ++ {"9", "9", "9" }, ++ {"0", "0", "0" }, ++ {"*", "*", "*" }, ++ {"#", "#", "#" }, ++ {">", "\021", "\021" }, /* Ctrl+Q */ ++ {"||", "\023", "\023" }, /* Ctrl+S */ ++ {"[]", "\003", "\003" }, /* Ctrl+C */ ++ {">>|", "\033[4~", "\033[4~"}, /* End */ ++ {"|<<", "\033[1~", "\033[1~"}, /* Home */ ++ {"Mute", "\033[3~", "\033[3~"}, /* Delete */ ++ {"Vol+", "\033[A", "\033[A" }, /* Cursor up */ ++ {"Vol-", "\033[B", "\033[B" }, /* Cursor down */ ++ {"Display", "\033[2~", "\033[2~"}, /* Insert */ ++ {"PgUp", "\033[5~", "\033[5~"}, /* Page up */ ++ {"PgDn", "\033[6~", "\033[6~"}, /* Page down */ ++ {"Back", "\033[D", "\033[D" }, /* Cursor left */ ++ {"Forward", "\033[C", "\033[C" }, /* Cursor right */ ++ {"CD", "\033[[A", "\033[[A"}, /* F1 */ ++ {"ShowWiz", "\033[[B", "\033[[B"}, /* F2 */ ++ {"WWW", "\033[[C", "\033[[C"}, /* F3 */ ++ {"Close", "\033[[D", "\033[[D"}, /* F4 */ ++ { NULL, "", "" } ++}; ++#define SILITEK_KEYS (sizeof(K_silitek)/sizeof(struct silitek_key_struct)) ++ ++/* From twiddler.c: The same silly function as in gpm.c */ ++static inline int open_console(const int mode) ++{ ++ int fd; ++ extern struct options option; ++ ++ if ((fd=open(option.consolename, mode)) < 0) ++ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,option.consolename); ++ return fd; ++} ++ ++static inline int silitek_wait(int timeout) ++{ ++ fd_set Set; ++ struct timeval tv = {0, timeout}; ++ int ret = 0; ++ ++ do { ++ FD_ZERO(&Set); ++ FD_SET(fd_silitek, &Set); ++ ret = select(fd_silitek+1, &Set, NULL, NULL, &tv); ++ ++ } while (ret < 0 && (errno == EINTR || errno == EAGAIN)); ++ ++ if (ret < 0 || !(FD_ISSET(fd_silitek, &Set))) ++ return 0; ++ return 1; ++} ++ ++static inline int silitek_read(unsigned char *data, int timeout) ++{ ++ ssize_t r = 0; ++ do { ++ if (!silitek_wait(timeout)) ++ break; ++ r = read(fd_silitek, data, 1); ++ ++ } while (r < 0 && (errno == EINTR || errno == EAGAIN)); ++ ++ if(r != 1) ++ return 0; ++ return 1; ++} ++ ++int silitek_get_check(unsigned char *data) ++{ ++ if ((data[0] != 0xbf) && /* key down */ ++ (data[0] != 0x31) && /* key hold down */ ++ (data[0] != 0x2a) && /* key up */ ++ (data[0] != 0x7c) && /* mouse event and/or button up */ ++ (data[0] != 0x7f) && /* mouse event and l+r-mouse button down */ ++ (data[0] != 0xfd) && /* mouse event and r-mouse button down */ ++ (data[0] != 0xfe)) /* mouse event and l-mouse button down */ ++ return 0; ++ if (!silitek_read(&data[1], 50000)) ++ return 0; ++ if (!silitek_read(&data[2], 50000)) ++ return 0; ++#if 0 ++ /* ++ * Sony IR ++ * various, it seems that the bit rate is to high to get stable ++ * bytes in correct order. Or the protocol of such a TV commander ++ * is more complicated than those of the SM-1000 because the IR ++ * receivers of the SM-1000 seems not read this fully correct. ++ */ ++ if (data[0] == 0xfe) { ++ if (data[1] == 0x14 && data[2] == 0x8c) ++ return 0; ++ if (data[1] == 0x94 && (data[2] == 0x8c || data[2] == 0x8d)) ++ return 0; ++ } ++#endif ++ return 1; ++} ++ ++void silitek_keys(unsigned char *data, int *drag) ++{ ++ int ret = 0, unblank = 4, cfd; ++ int but = (data[1] & 0x7f); ++ int chk = (data[2] & 0x7f); ++ int timediff = 0; ++ char *item; ++ ++ if ((but & 0x20) || (but & 0x40) != 0x40) ++ return; ++ if ((but&chk) != 0x40 || (but|chk) != 0x7f) ++ return; ++ but &= 0x1f; ++ chk &= 0x1f; ++ ++ if ((but|chk) != 0x1f) ++ return; ++ if (but < 1 || but > SILITEK_KEYS) ++ return; ++ ++#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) ++#define DIF_TIME(t1,t2) ((t2.tv_sec-t1.tv_sec)*1000 + (t2.tv_usec-t1.tv_usec)/1000) ++ ++ switch(data[0]) { ++ static struct timeval uptv; ++ struct timeval tv; ++ case 0x2a: ++ uptv.tv_sec = 0; ++ /* fall through */ ++ default: ++ return; ++ break; ++ case 0x31: ++ case 0xbf: ++ GET_TIME(tv); ++ if (!uptv.tv_sec) { ++ uptv.tv_sec = tv.tv_sec; ++ uptv.tv_usec = tv.tv_usec; ++ } ++ timediff = DIF_TIME(uptv, tv); ++ break; ++ } ++ ++#undef GET_TIME ++#undef DIF_TIME ++ ++ if (timediff && timediff < opt_time) ++ return; ++ ++ item = K_silitek[but].item; ++ if (*drag) { ++ item = K_silitek[but].drag; ++ but = 0; ++ } ++#if 0 ++ *drag = 0; ++#endif ++ ++ cfd = open_console(O_WRONLY|O_NONBLOCK|O_NOCTTY); ++ if (cfd < 0) ++ return; ++ while (*item && !ret) ++ ret = ioctl(cfd, TIOCSTI, item++); ++ ioctl(cfd, TIOCLINUX, &unblank); ++ close(cfd); ++} ++ ++int silitek_get_check_ps2(unsigned char *data) ++{ ++#if 0 ++ /* ++ * Enable this to trace foreign IR bytes sequences received by ++ * by the IR receiver of the SK-7100 keyboard. ++ */ ++ FILE *log; ++ if (!(log = fopen("/tmp/log", "a"))) ++ return 0; ++ fprintf(log, "TV: 0x%.2x 0x%.2x 0x%.2x\n", data[0], data[1], data[2]); ++ fclose(log); ++#endif ++ if ((data[0] != 0xe7) && /* key down */ ++ (data[0] != 0xd7) && /* key hold down */ ++ (data[0] != 0xf7) && /* key up */ ++ (data[0]&0xc0)) /* PS2 mouse event */ ++ return 0; ++ if (!silitek_read(&data[1], 50000)) ++ return 0; ++ if (!silitek_read(&data[2], 50000)) ++ return 0; ++ /* ++ * Other IR, current known: ++ * ++ * Sony IR ++ * 0x29 0x0c 0xf4 ++ * 0x29 0x14 0xf4 ++ */ ++ if (data[0] == 0x29 && data[2] == 0xf4 && ((data[1] && 0x0c) || (data[1] && 0x14))) { ++ return 0; ++ } ++ return 1; ++} ++ ++void silitek_keys_ps2(unsigned char *data, int *drag) ++{ ++ int ret = 0, unblank = 4, cfd; ++ int but = data[1]; ++ int chk = data[2]; ++ int timediff = 0; ++ char *item; ++ ++ if ((but&chk) && (but|chk) != 0xff) ++ return; ++ ++ if (but < 1 || but > SILITEK_KEYS) ++ return; ++ ++#define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL)) ++#define DIF_TIME(t1,t2) ((t2.tv_sec-t1.tv_sec)*1000 + (t2.tv_usec-t1.tv_usec)/1000) ++ ++ switch(data[0]) { ++ static struct timeval uptv; ++ struct timeval tv; ++ case 0xe7: ++ uptv.tv_sec = 0; ++ /* fall through */ ++ default: ++ return; ++ break; ++ case 0xd7: ++ case 0xf7: ++ GET_TIME(tv); ++ if (!uptv.tv_sec) { ++ uptv.tv_sec = tv.tv_sec; ++ uptv.tv_usec = tv.tv_usec; ++ } ++ timediff = DIF_TIME(uptv, tv); ++ break; ++ } ++ ++#undef GET_TIME ++#undef DIF_TIME ++ ++ if (timediff && timediff < opt_time) ++ return; ++ ++ item = K_silitek[but].item; ++ if (*drag) { ++ item = K_silitek[but].drag; ++ but = 0; ++ } ++#if 0 ++ *drag = 0; ++#endif ++ ++ cfd = open_console(O_WRONLY|O_NONBLOCK|O_NOCTTY); ++ if (cfd < 0) ++ return; ++ while (*item && !ret) ++ ret = ioctl(cfd, TIOCSTI, item++); ++ ioctl(cfd, TIOCLINUX, &unblank); ++ close(cfd); ++} ++ ++/* ++ * Map some ghost mouse PS2 events caused by the other ++ * keys. Maybe there is a better initialization for the chip ++ * of the SK-7100 IR receiver which would avoid those events. ++ */ ++int silitek_ghost_ps2(unsigned char *data) ++{ ++ if (data[0] == 0x18 || data[0] == 0x19) { ++ int but = data[1] - 0xc0; ++ int chk = data[2] - 0x01; ++ ++ if ((but >= 1 && but <= SILITEK_KEYS) && (but == chk)) { ++ data[0] = 0xf7; ++ data[1] = but; ++ data[2] = 0xff - but; ++ } ++ } ++ return 0; ++} ++ ++static char ansicstr_ret[SILISTRLEN+1]; ++static char* ansicstr(char *string) ++{ ++ int c, conv = 0, o; ++ char *ptr = string; ++ char *ret = &ansicstr_ret[0]; ++ ++ memset(&ansicstr_ret[0], 0, sizeof(ansicstr_ret)); ++ while (ptr && *ptr) { ++ switch (c = *ptr++) { ++ case '\\': ++ if (!conv) { ++ conv = 1; ++ continue; ++ } else ++ c = '\\'; ++ conv = 0; break; ++ case 'a': if (conv) c = '\a'; conv = 0; break; ++ case 'b': if (conv) c = '\b'; conv = 0; break; ++ case 't': if (conv) c = '\t'; conv = 0; break; ++ case 'n': if (conv) c = '\n'; conv = 0; break; ++ case 'v': if (conv) c = '\v'; conv = 0; break; ++ case 'f': if (conv) c = '\f'; conv = 0; break; ++ case 'r': if (conv) c = '\r'; conv = 0; break; ++ case 'e': if (conv) c = '\e'; conv = 0; break; ++ case 'E': if (conv) c = '\e'; conv = 0; break; ++ case '0': case '1': case '2': case '3': ++ case '4': case '5': case '6': case '7': ++ if (!conv) break; ++ c -= '0'; ++ for (o = 2; ptr && (*ptr >= '0' && *ptr <= '7' ) && o--; ptr++) ++ c = (c * 8) + (*ptr - '0'); ++ conv = 0; break; ++ case 'x': ++ if (!conv) break; ++ for (o = 3; ptr && isxdigit(*ptr) && o--; ptr++) ++ c = (c * 16) + ++ ((*ptr >= 'a' && *ptr <= 'f') ? (*ptr - 'a' + 10) : ++ ((*ptr >= 'A' && *ptr <= 'F') ? (*ptr - 'A' + 10) : (*ptr - '0'))); ++ if (o == 3) { ++ *ret++ = '\\'; ++ c = 'x'; ++ } ++ conv = 0; break; ++ default: ++ conv = 0; break; ++ } ++ *ret++ = c; ++ } ++ return &ansicstr_ret[0]; ++} ++ ++void silitek_mapping() ++{ ++ static int mapdone = 0; ++ FILE *conf; ++ char line[128]; ++ int k = 1; ++ ++ /* Just in case if called twice with -M option */ ++ if (mapdone) ++ return; ++ mapdone = 1; ++ ++ if (!(conf = fopen(SILI_SYSTEM_FILE, "r"))) { ++ if (errno != ENOENT) ++ gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN,SILI_SYSTEM_FILE); ++ return; ++ } ++ ++ while (fgets(line, 128, conf)) { ++ int n; ++ char key[SILISTRLEN+1], item[SILISTRLEN+1], drag[SILISTRLEN+1]; ++ /* Comments and empty lines */ ++ if (line[0] == '\n' || line[0] == '#') ++ continue; ++ ++ if (line[strlen(line) - 1] == '\n') ++ line[strlen(line) - 1] = '\0'; ++ while (isspace(line[strlen(line) - 1])) ++ line[strlen(line) - 1] = '\0'; ++ ++ if (line[0] == '\0') ++ continue; ++ ++ key[0] = item[0] = drag[0] = '\0'; ++ if ((n = sscanf(line, SILISTRSCN, key, item, drag)) > 1 && n < 4) { ++ while (k < SILITEK_KEYS) { ++ if (!K_silitek[k].key) { ++ k = 1; ++ break; ++ } ++ if (!strncasecmp(key, K_silitek[k].key, SILISTRLEN)) { ++ size_t i = strlen(item), d = strlen(drag); ++ if (d) { ++ if (d > SILISTRLEN) ++ d = SILISTRLEN; ++ strncpy(K_silitek[k].drag, ansicstr(drag), d); ++ K_silitek[k].drag[d] = '\0'; ++ } ++ if (i) { ++ if (i > SILISTRLEN) ++ i = SILISTRLEN; ++ strncpy(K_silitek[k].item, ansicstr(item), i); ++ K_silitek[k].item[i] = '\0'; ++ } ++ break; ++ } ++ k++; ++ } ++ } ++ } ++} diff --git a/gpm-1.20.1-syn_conf.patch b/gpm-1.20.1-syn_conf.patch new file mode 100644 index 0000000..75cb047 --- /dev/null +++ b/gpm-1.20.1-syn_conf.patch @@ -0,0 +1,158 @@ +--- conf/gpm-syn.conf ++++ conf/gpm-syn.conf +@@ -1,49 +1,107 @@ ++/* generated from src/synaptics.c, gpm-1.20.1 */ + /* enabling configuration parameters */ +-[edge_motion_enabled] TRUE +-[edge_motion_speed_enabled] TRUE +-[corner_taps_enabled] TRUE +-[tap_gesture_enabled] TRUE +-[pressure_speed_enabled] TRUE +-[tossing_enabled] TRUE +-[does_toss_use_static_speed] TRUE +-/* pressure induced speed related configuration parameters */ +-[low_pressure] 60 +-[speed_up_pressure] 60 +-[pressure_factor] 0.10 +-[standard_speed_factor] 0.10 +-/* toss/catch related parameters */ +-[min_toss_time] 100 +-[max_toss_time] 300 +-[prevent_toss_time] 300 +-[min_toss_dist] 2 +-[static_toss_speed] 70 +-[toss_speed_factor] 0.5 +-/* edge motion related configuration parameters */ +-[edge_speed] 20 +-/* corner tap actions */ +-[upper_left_action] 0 (none) +-[upper_right_action] 2 (middle) +-[lower_left_action] 0 (none) +-[lower_right_action] 3 (right) +-/* wmode parameters */ +-[wmode_enabled] TRUE +-[drag_lock_enabled] FALSE +-[finger_threshold] 30 +-[tap_lower_limit] 5 +-[tap_upper_limit] 200 +-[tap_range] 100 +-[tap_interval] 200 +-[pads_tap_interval] 8 +-[multiple_tap_delay] 30 +-[palm_detect_enabled] TRUE +-[palm_detect_level] 12 +-[multi_finger_tap_enable] TRUE +-[multi_finger_stop_enabled] TRUE +-[multi_finger_stop_delay] 8 +- /* Additional options */ +-[touch_pad_enabled] TRUE +-[stick_enabled] TRUE +-[scrolling_enabled] TRUE +-[scrolling_edge] 2 +-[auto_scrolling_enabled] TRUE +- ++[edge_motion_enabled] TRUE ++[edge_motion_speed_enabled] TRUE ++[corner_taps_enabled] TRUE ++[tap_gesture_enabled] TRUE ++[pressure_speed_enabled] TRUE ++[tossing_enabled] TRUE ++[does_toss_use_static_speed] TRUE ++[tap_hold_edge_motion_enabled] TRUE ++/* pressure induced speed related configuration parameters */ ++[low_pressure] 60 ++[speed_up_pressure] 60 ++[pressure_factor] 0.05 ++[standard_speed_factor] 0.08 ++/* toss/catch related parameters */ ++[min_toss_time] 100 ++[max_toss_time] 300 ++[prevent_toss_time] 300 ++[min_toss_dist] 2 ++[static_toss_speed] 70 ++[toss_speed_factor] 0.5 ++/* edge motion related configuration parameters */ ++[x_min_center] 1632 ++[x_max_center] 5312 ++[y_min_center] 1408 ++[y_max_center] 4108 ++[edge_speed] 20 ++/* use wmode */ ++[wmode_enabled] TRUE ++[drag_lock_enabled] TRUE ++[finger_threshold] 30 ++[tap_lower_limit] 5 ++[tap_upper_limit] 200 ++[tap_range] 100 ++[tap_interval] 200 ++[multiple_tap_delay] 30 ++[pads_tap_interval] 8 ++/* Additional wmode parameters */ ++[palm_detect_enabled] TRUE ++[palm_detect_level] 12 ++[multi_finger_tap_enable] TRUE ++[multi_finger_stop_enabled] TRUE ++[multi_finger_stop_delay] 8 ++[fake_finger_layer_enabled] 1 ++/* Additional options*/ ++/* Values for [scrolling_edge]: ++ LEFT_EDGE 0x01 ++ RIGHT_EDGE 0x02 ++ TOP_EDGE 0x04 ++ BOTTOM_EDGE 0x08 ++ UPPER_LEFT_CORNER (LEFT_EDGE | TOP_EDGE) ++ LOWER_LEFT_CORNER (LEFT_EDGE | BOTTOM_EDGE) ++ UPPER_RIGHT_CORNER (RIGHT_EDGE | TOP_EDGE) ++ LOWER_RIGHT_CORNER (RIGHT_EDGE | BOTTOM_EDGE) */ ++[touchpad_enabled] TRUE ++[stick_enabled] TRUE ++[stick_pressure_enabled] FALSE ++[four_way_button_enabled] TRUE ++[four_way_button_is_mouse] TRUE ++[scrolling_enabled] TRUE ++[auto_scrolling_enabled] TRUE ++[scrolling_edge] 0x02 ++[scrolling_speed] 10 ++[scrolling_button_factor] 0.5 ++[auto_scrolling_factor] 2.0 ++/* Action id's: ++ No_Action = 0 ++ Left_Button_Action = 1 ++ Middle_Button_Action = 2 ++ Right_Button_Action = 3 ++ Fourth_Button_Action = 4 ++ Up_Button_Action = 5 ++ Down_Button_Action = 6 ++ Turn_On_Off_Action = 7 ++ Debug_On_Off_Action = 8 ++ Reset_Touchpad_Action = 9 ++ Toggle_Four_Way_Button_Action = 10 ++ Toggle_Stick_Pressure_Action = 11 ++ Toggle_Scrolling_Action = 12 ++ Left_Double_Click_Action = 13 ++*/ ++/* corner tap actions */ ++[upper_left_action] 0 ++[lower_left_action] 0 ++[upper_right_action] 2 ++[lower_right_action] 3 ++/* no. of fingers tap actions */ ++[one_finger_tap_action] 1 ++[two_fingers_tap_action] 3 ++[three_fingers_tap_action] 2 ++/* normal button actions */ ++[left_button_action] 1 ++[middle_button_action] 2 ++[right_button_action] 3 ++[fourth_button_action] 4 ++[up_button_action] 5 ++[down_button_action] 6 ++/* 4 way button actions */ ++[four_way_left_button_action] 2 ++[four_way_right_button_action] 4 ++[four_way_up_button_action] 5 ++[four_way_down_button_action] 6 ++/* Synaptic Stick (passthrugh,stick) actions */ ++[stick_left_button_action] 1 ++[stick_middle_button_action] 2 ++[stick_right_button_action] 3 diff --git a/gpm-1.20.1-va_arg.patch b/gpm-1.20.1-va_arg.patch new file mode 100644 index 0000000..0f16dff --- /dev/null +++ b/gpm-1.20.1-va_arg.patch @@ -0,0 +1,155 @@ +--- src/lib/report-lib.c ++++ src/lib/report-lib.c +@@ -41,5 +41,7 @@ + vfprintf(stderr,text,ap); + fprintf(stderr,"\n"); + ++ va_end(ap); ++ + if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */ + } +--- src/report.c ++++ src/report.c +@@ -71,9 +71,18 @@ + void gpm_report(int line, char *file, int stat, char *text, ... ) + { + FILE *console = NULL; +- va_list ap; ++ va_list ap,ap2; ++#ifdef HAVE_VSYSLOG ++ va_list ap_sys; ++#endif ++ int exit_request=0; /* 0 -> return is requested ++ 1 -> exit(1) is requested ++ 2 -> _exit(1) is requested */ + + va_start(ap,text); ++#ifdef HAVE_VSYSLOG ++ va_copy(ap_sys,ap); ++#endif + + switch(option.run_status) { + /******************** STARTUP *****************/ +@@ -82,7 +91,7 @@ + case GPM_STAT_INFO: + #ifdef HAVE_VSYSLOG + syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); +- vsyslog(LOG_INFO | LOG_USER, text, ap); ++ vsyslog(LOG_INFO | LOG_USER, text, ap_sys); + #endif + fprintf(stderr,GPM_STRING_INFO); + vfprintf(stderr,text,ap); +@@ -92,7 +101,7 @@ + case GPM_STAT_WARN: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); +- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); ++ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap_sys); + #endif + fprintf(stderr,GPM_STRING_WARN); + vfprintf(stderr,text,ap); +@@ -102,7 +111,7 @@ + case GPM_STAT_ERR: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); +- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); ++ vsyslog(LOG_DAEMON | LOG_ERR, text, ap_sys); + #endif + fprintf(stderr,GPM_STRING_ERR); + vfprintf(stderr,text,ap); +@@ -112,13 +121,13 @@ + case GPM_STAT_OOPS: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); +- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); ++ vsyslog(LOG_DAEMON | LOG_ERR, text, ap_sys); + #endif + fprintf(stderr,GPM_STRING_OOPS); + vfprintf(stderr,text,ap); + fprintf(stderr,"\n"); + +- exit(1); /* we should have a oops()-function,but this works,too*/ ++ exit_request=1; /* we should have a oops()-function,but this works,too*/ + break; + } + break; /* startup sequence */ +@@ -129,14 +138,14 @@ + case GPM_STAT_INFO: + #ifdef HAVE_VSYSLOG + syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO); +- vsyslog(LOG_INFO | LOG_USER, text, ap); ++ vsyslog(LOG_INFO | LOG_USER, text, ap_sys); + #endif + break; + + case GPM_STAT_WARN: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN); +- vsyslog(LOG_DAEMON | LOG_WARNING, text, ap); ++ vsyslog(LOG_DAEMON | LOG_WARNING, text, ap_sys); + #endif + if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { + fprintf(console,GPM_STRING_WARN); +@@ -149,8 +158,9 @@ + case GPM_STAT_ERR: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR); +- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); ++ vsyslog(LOG_DAEMON | LOG_ERR, text, ap_sys); + #endif ++ va_copy(ap2,ap); + if((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) { + fprintf(console,GPM_STRING_ERR); + vfprintf(console,text,ap); +@@ -160,22 +170,24 @@ + + if((console = fopen(option.consolename,"a")) != NULL) { + fprintf(console,GPM_STRING_ERR); +- vfprintf(console,text,ap); ++ vfprintf(console,text,ap2); + fprintf(console,"\n"); + fclose(console); + } ++ ++ va_end(ap2); + break; + + case GPM_STAT_OOPS: + #ifdef HAVE_VSYSLOG + syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS); +- vsyslog(LOG_DAEMON | LOG_ERR, text, ap); ++ vsyslog(LOG_DAEMON | LOG_ERR, text, ap_sys); + #endif + fprintf(stderr,GPM_STRING_OOPS); + vfprintf(stderr,text,ap); + fprintf(stderr,"\n"); + +- _exit(1); /* we are the fork()-child */ ++ exit_request=2; /* we are the fork()-child */ + break; + } + break; /* running gpm */ +@@ -203,10 +215,21 @@ + vfprintf(console,text,ap); + fprintf(console,"\n"); + +- if(stat == GPM_STAT_OOPS) exit(1); +- ++ if(stat == GPM_STAT_OOPS) exit_request=1; ++ + break; + } /* switch for current modus */ ++ ++ va_end(ap); ++#ifdef HAVE_VSYSLOG ++ va_end(ap_sys); ++#endif ++ ++ if (exit_request == 2) ++ _exit(1); ++ if (exit_request == 1) ++ exit(1); ++ return; + } /* gpm_report */ + + diff --git a/gpm-1.20.1.patch b/gpm-1.20.1.patch new file mode 100644 index 0000000..e48f73c --- /dev/null +++ b/gpm-1.20.1.patch @@ -0,0 +1,113 @@ +--- Makefile.in ++++ Makefile.in +@@ -50,9 +50,13 @@ + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install + + installdirs: +- $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \ ++ $(INSTALL_DIR) $(DESTDIR)$(libdir) ++ $(INSTALL_DIR) $(DESTDIR)$(bindir) ++ $(INSTALL_DIR) $(DESTDIR)$(sbindir) ++ $(INSTALL_DIR) $(DESTDIR)$(includedir) ++ $(INSTALL_DIR) $(DESTDIR)$(sysconfdir); \ + if test "x@ELISP@" != "x" ; then \ +- $(MKDIR) $(lispdir) ; \ ++ $(INSTALL_DIR) $(DESTDIR)$(lispdir) ; \ + fi + + ### GENERIC +--- Makefile.include.in ++++ Makefile.include.in +@@ -37,6 +37,7 @@ + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_DIR = @INSTALL@ -d + LN_S = @LN_S@ + EMACS = @EMACS@ + ELISP = @ELISP@ +--- doc/Makefile.in ++++ doc/Makefile.in +@@ -112,29 +112,18 @@ + # install & uninstall + + installdirs: +- $(MKDIR) $(man1dir) $(man7dir) $(man8dir) $(infodir) ++ $(INSTALL_DIR) $(DESTDIR)$(man1dir) ++ $(INSTALL_DIR) $(DESTDIR)$(man7dir) ++ $(INSTALL_DIR) $(DESTDIR)$(man8dir) ++ $(INSTALL_DIR) $(DESTDIR)$(infodir) + + install: all installdirs +- $(INSTALL_DATA) -m 644 mev.1 $(man1dir) +- $(INSTALL_DATA) -m 644 mouse-test.1 $(man1dir) +- $(INSTALL_DATA) -m 644 gpm-root.1 $(man1dir) +- $(INSTALL_DATA) -m 644 gpm-types.7 $(man7dir) +- $(INSTALL_DATA) -m 644 gpm.8 $(man8dir) +- $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(infodir) +- # Use install-info if available +- -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ +- if [ -f $(infodir)/dir ] ; then \ +- install-info --dir-file=$(infodir)/dir $(infodir)/gpm.info; \ +- fi; \ +- fi +- #itz Sat Dec 26 23:21:05 PST 1998 +- #i keep all my infopages compressed and i'm tired to do it by +- #hand, so check if there are any compressed pages and do this +- #one too +- -ls $(infodir)/*[-.]info.gz >/dev/null 2>&1 \ +- && gzip -f $(infodir)/gpm.info +- # Hmm.... shouldn't man pages be compressed too? +- # maybe they should, but at least at my system they are not. ++ $(INSTALL_DATA) -m 644 mev.1 $(DESTDIR)$(man1dir) ++ $(INSTALL_DATA) -m 644 mouse-test.1 $(DESTDIR)$(man1dir) ++ $(INSTALL_DATA) -m 644 gpm-root.1 $(DESTDIR)$(man1dir) ++ $(INSTALL_DATA) -m 644 gpm-types.7 $(DESTDIR)$(man7dir) ++ $(INSTALL_DATA) -m 644 gpm.8 $(DESTDIR)$(man8dir) ++ $(INSTALL_DATA) -m 644 $(srcdir)/gpm.info $(DESTDIR)$(infodir) + + # This potentially leaves around cached manpages, + # e.g. /var/cache/man/cat1/mev.1.gz. Deleting these is not our job, +--- src/Makefile.in ++++ src/Makefile.in +@@ -91,15 +91,15 @@ + installdirs: + + install: check +- $(INSTALL_PROGRAM) gpm $(sbindir)/gpm +- $(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a +- $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h ++ $(INSTALL_PROGRAM) gpm $(DESTDIR)$(sbindir)/gpm ++ $(INSTALL_DATA) -m 644 lib/libgpm.a $(DESTDIR)$(libdir)/libgpm.a ++ $(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(DESTDIR)$(includedir)/gpm.h + # POSIX requires the range of a for loop be nonempty and Bash + # 2.x goes along; unfortunately that means an additional + # headache in cases like this + if test "x@SHLIB@" != "x" ; then \ +- $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ;\ +- cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ ++ $(INSTALL_DATA) -m 755 lib/libgpm.so.@abi_full@ $(DESTDIR)$(libdir)/libgpm.so.@abi_full@ ;\ ++ cd $(DESTDIR)$(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so ;\ + echo "WARNING: We installed a lib, you should now call ldconfig" ; \ + echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ;\ + echo "Or to update everything just type ldconfig"; \ +@@ -107,7 +107,7 @@ + + # prog/ + for i in $(PROG); do \ +- $(INSTALL_PROGRAM) $$i $(bindir)/`echo $$i | sed 's,prog/,,'` ;\ ++ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/`echo $$i | sed 's,prog/,,'` ;\ + done + + install-strip: +--- src/special.c ++++ src/special.c +@@ -155,7 +155,7 @@ + open(GPM_NULL_DEV,O_RDONLY); /* stdin */ + open(option.consolename,O_WRONLY); /* stdout */ + dup(1); /* stderr */ +- for (i=3;i +- gpm config files changes: + * installed gpm-twiddler.conf, many thanks to Dr. Werner Fink for hint + * fixed and installed gpm-syn.conf + * moved all gpm config files from /etc to /etc/gpm + * removed prefix "gpm-" from gpm config file names + * created README.SuSE + * improved "probe" part in init script to check changes + in config files from /etc/gpm/* +- fixed synaptics.c to read /etc/gpm/syn.conf with TABs +- fixed support for reconnection for PS/2 mouses to save necessary values + in struct mouse_features (to work correctly with dual-mouse stuff) + +------------------------------------------------------------------- +Wed Jul 10 17:05:00 CEST 2002 - pmladek@suse.cz + +- updated to version 1.20.1rc1: + * synaptics ps2 touchpad support + * removed compile problems + * objdir/ support without problems + * cleaned up internal message functions + * clean {g,m,}awk support + * clean ps2 initialization (allows using ps2 mouse after you + used synps!) + * gpm clients can't cause gpm do die. +- removed obsolete patch for gpm-root.y +- removed obsolete ia64 patch +- removed obsolete Werner's patch for devfs.c +- improved patch for reconnection of PS/2 mouses +- fixed start of gpm server when an old invalid /var/run/gpm.pid exists +- reorganized patches +- used %run_ldconfig macro in %post and %postun sections +- fixed init script according to skeleton + +------------------------------------------------------------------- +Tue Jul 9 11:43:38 CEST 2002 - werner@suse.de + +- Bug fix in devfs.c for twid and other keyboards +- Bug fix in gpm.c: Some PS/2 devices really wants be readed + byte by byte +- Complete the PS/2 command bytes in headers/defines.h + +------------------------------------------------------------------- +Fri Mar 15 17:19:12 CET 2002 - kukuk@suse.de + +- fix typo in sysconfig.gpm [Bug #15034] + +------------------------------------------------------------------- +Thu Jan 17 19:06:13 CET 2002 - pmladek@suse.cz + +- added variable GPM_PROTOCOL to /etc/sysconfig/mouse +- if the variable GPM_PARAM is empty then gpm will start with option + "-t $GPM_PROTOCOL -m $MOUSE" now + +------------------------------------------------------------------- +Wed Jan 16 18:40:46 CET 2002 - ro@suse.de + +- removed setup.selection + +------------------------------------------------------------------- +Fri Jan 11 18:39:17 CET 2002 - pmladek@suse.cz + +- used macro %{_libdir} to fix for lib64 +- fixed rights of static library to 644 +- fixed documentation in /usr/share/doc/packages/gpm + +------------------------------------------------------------------- +Tue Jan 8 20:30:05 CET 2002 - egmont@suselinux.hu + +- removed colons from init script messages + +------------------------------------------------------------------- +Tue Jan 8 17:34:20 CET 2002 - ro@suse.de + +- moved GPM_PARAM to /etc/sysconfig/mouse + +------------------------------------------------------------------- +Mon Dec 10 18:03:26 CET 2001 - pmladek@suse.cz + +- updated to version 1.19.6: + * Synaptics 4 Button Touchpad support + * IntelliMouse Explorer support + * some bug fixes +- removed obsolete mktemp security patch + +------------------------------------------------------------------- +Wed Dec 5 02:18:19 CET 2001 - ro@suse.de + +- add "-p" to macro call to deactivate perl-hack + +------------------------------------------------------------------- +Wed Dec 5 01:51:46 CET 2001 - ro@suse.de + +- use fillup_and_insserv and removed START_GPM +- move variable GPM_PARAM to this package + +------------------------------------------------------------------- +Thu Oct 18 15:37:02 CEST 2001 - pmladek@suse.cz + +- fixed permissions of /dev/gpmctl back to 777, thus the + applications (mc) can use mouse support for normal user (#11893) + +------------------------------------------------------------------- +Mon Sep 17 12:08:03 CEST 2001 - pmladek@suse.cz + +- fixed to detect tokens AA 00 only in protocols + for ps/2 mouses + +------------------------------------------------------------------- +Mon Sep 10 17:46:51 CEST 2001 - pmladek@suse.cz + +- fixed to read only two bytes when mouse is + reconected and it sends tokens AA 00 + +------------------------------------------------------------------- +Fri Sep 7 11:44:56 CEST 2001 - pmladek@suse.cz + +- fixed detection of reconnection of ps2 mouses and friends + with kernel 2.4.9 or higher (bug #9822) + * I take inspiration in patch from + George Staikos (staikos@0wned.org) + +------------------------------------------------------------------- +Thu Aug 23 10:30:51 CEST 2001 - pmladek@suse.cz + +- updated to version 1.19.3: + * security fixes: + * close the newly accept()ed socket in case of + identification failure + * removed initial setuid(0) call + * added initgroups() + * many bugfixes + * features: + * re-check console size on console change + * changed use of -o option +- removed obsolete security patches +- removed obsolete resize patch +- applied two patches from RedHat: + * fix permissions on /dev/gpmctl + * call initgroups in gpm-root before spawning command as user + * make gpm-root work on big endian + +------------------------------------------------------------------- +Mon Aug 6 15:59:55 CEST 2001 - kukuk@suse.de + +- Fix comment about init script location [Bug #9494] + +------------------------------------------------------------------- +Thu Jun 14 16:46:45 CEST 2001 - pmladek@suse.cz + +- fixed link libgpm.so.1 + +------------------------------------------------------------------- +Fri Jun 8 12:26:36 CEST 2001 - kukuk@suse.de + +- Use _libdir macros + +------------------------------------------------------------------- +Fri Jun 8 11:14:55 CEST 2001 - pmladek@suse.cz + +- fixed to compile on sparc64 (libraries in /usr/lib64 now) +- fixed BUILD_ROOT + +------------------------------------------------------------------- +Wed May 16 15:15:24 CEST 2001 - pmladek@suse.cz + +- fixed cast warnings on ia64 + +------------------------------------------------------------------- +Mon Apr 23 07:51:16 CEST 2001 - pmladek@suse.cz + +- fixed warnings on ia64 + +------------------------------------------------------------------- +Thu Apr 12 05:33:05 CEST 2001 - pmladek@suse.cz + +- fixed init script by new skeleton +- fixed to compile + - removed include $(DEPS) from makefile + +------------------------------------------------------------------- +Mon Jan 15 10:06:52 CET 2001 - nadvornik@suse.cz + +- added Required-Start: $remote_fs $syslog [bug #5580] + +------------------------------------------------------------------- +Tue Jan 2 00:02:38 CET 2001 - olh@suse.de + +- add script name to %postin + +------------------------------------------------------------------- +Wed Dec 20 16:12:48 MET 2000 - pthomas@suse.de + +- Fix bug in Gpm_Wgetch + +------------------------------------------------------------------- +Tue Nov 28 18:31:00 CET 2000 - ro@suse.de + +- sbin/init.d -> etc/init.d + +------------------------------------------------------------------- +Wed Nov 22 10:58:21 CET 2000 - nadvornik@suse.cz + +- removed runlevel links +- fixed init script + +------------------------------------------------------------------- +Mon Oct 9 09:00:19 CEST 2000 - nadvornik@suse.cz + +- fixed Copyright +- used bzip2 + +------------------------------------------------------------------- +Fri Oct 6 09:46:00 CEST 2000 - schwab@suse.de + +- Use getdtablesize() instead of OPEN_MAX. + +------------------------------------------------------------------- +Mon Jul 17 09:33:58 CEST 2000 - nadvornik@suse.cz + +- added security patch for disable-paste. Now it don't + need to be installed with suid root. + +------------------------------------------------------------------- +Thu Apr 27 08:58:34 CEST 2000 - nadvornik@suse.cz + +- added initgroups() patch +- used --sysconfdir=/etc + +------------------------------------------------------------------- +Tue Apr 18 09:56:08 CEST 2000 - nadvornik@suse.cz + +- added BuildRoot + +------------------------------------------------------------------- +Mon Apr 3 15:12:32 MEST 2000 - uli@suse.de + +- merged in gpm-root fix by Alessandro Rubini + +------------------------------------------------------------------- +Fri Feb 25 15:38:57 CET 2000 - kukuk@suse.de + +- Move /usr/{info,man} -> /usr/share/{info,man} + +------------------------------------------------------------------- +Mon Jan 31 13:46:24 MET 2000 - uli@suse.de + +- added fix for possible /tmp race attacks by thomas@suse.de + +------------------------------------------------------------------- +Fri Dec 17 00:52:15 CET 1999 - ro@suse.de + +- removed params for ldconfig (-l does not work any more) +- update to 1.18.1 +- got rid of Makefile.Linux +- use RPM_OPT_FLAGS for configure + +------------------------------------------------------------------- +Mon Oct 11 12:35:02 MEST 1999 - uli@suse.de + +- update -> 1.18.0 + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Tue Mar 16 18:15:37 MET 1999 - ro@suse.de + +- fixed rc-script: check if gpm already running + +------------------------------------------------------------------- +Fri Mar 5 17:48:03 MET 1999 - ro@suse.de + +- fixed rc script + +------------------------------------------------------------------- +Tue Mar 2 18:31:19 MET 1999 - ro@suse.de + +- update to 1.17.5 + +------------------------------------------------------------------- +Mon Dec 7 11:48:57 MET 1998 - ro@suse.de + +- updated init-script +- added rcgpm symlink + +---------------------------------------------------------------------------- +Fri Oct 24 15:06:18 MEST 1997 - florian@suse.de + +- update to gpm 1.13 + + +---------------------------------------------------------------------------- +Sun May 4 15:23:41 CEST 1997 - bs@suse.de + +- added /var/adm/setup/setup.selection + + +---------------------------------------------------------------------------- +Wed Apr 30 15:57:14 CEST 1997 - florian@suse.de + + +- update to version 1.12 + + +---------------------------------------------------------------------------- +Wed Nov 6 00:13:26 CET 1996 - florian@suse.de + + +- move startup scripts from aaa_base to gpm.tgz + diff --git a/gpm.spec b/gpm.spec new file mode 100644 index 0000000..1c60a82 --- /dev/null +++ b/gpm.spec @@ -0,0 +1,422 @@ +# +# spec file for package gpm (Version 1.20.1) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: gpm +URL: http://linux.schottelius.org/gpm/ +License: GPL +Group: System/Console +Provides: select +PreReq: /bin/sed %insserv_prereq %fillup_prereq +Autoreqprov: on +Version: 1.20.1 +Release: 312 +Summary: Console Mouse Support +Source0: http://arcana.linux.it/pub/gpm/gpm-%{version}.tar.bz2 +Source1: rcgpm +Source2: sysconfig.mouse-%{name} +Source3: README.SuSE +Patch0: gpm-%{version}.patch +Patch1: gpm-%{version}-ps2_command_bytes.patch +Patch2: gpm-%{version}-ps2_read.patch +Patch3: gpm-%{version}-ps2_reconnection.patch +Patch4: gpm-%{version}-syn_conf.patch +Patch5: gpm-%{version}-silitek.patch +Patch6: gpm-%{version}-conf.patch +Patch7: gpm-%{version}-va_arg.patch +Patch8: gpm-%{version}-quiet_libgpm.patch +Patch9: gpm-%{version}-no_templates_for_new_multiple_mode.patch +Patch10: gpm-%{version}-ceil.patch +Patch11: gpm-%{version}-Gpm_Open.patch +Patch12: gpm-%{version}-daemon_mode.patch +Patch13: gpm-%{version}-gunze-overflow.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: %install_info_prereq + +%description +The gpm (general purpose mouse) daemon tries to be a useful mouse +server for applications running on the Linux console. It can be used by +mc (Midnight Commander) or by w3m, the text-based Web browser. It +provides console cut and paste operations. + + + +Authors: +-------- + Alessandro Rubini + Nico Schottelius + +%prep +%setup -q +%patch0 +%patch1 +%patch2 +%patch3 +%patch4 +%patch5 +%patch6 +%patch7 +%patch8 +%patch9 +%patch10 +%patch11 +%patch12 +%patch13 +# +cp %{S:1} %{S:2} %{S:3} . + +%build +aclocal +autoconf +CFLAGS="$RPM_OPT_FLAGS -DQUIET_LIBGPM" \ +./configure --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --sysconfdir=/etc/gpm +%ifarch %arm +make CC="gcc -lm" +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install +# +# gpm confings +for file in conf/gpm-* ; do + install -m 644 $file $RPM_BUILD_ROOT/etc/${file/conf\/gpm-/gpm\/} +done +# +# lisp +install -d $RPM_BUILD_ROOT/usr/share/emacs/site-lisp +install contrib/emacs/t-mouse.el* $RPM_BUILD_ROOT/usr/share/emacs/site-lisp +# +# start script +install -m 755 -d $RPM_BUILD_ROOT/var/adm/fillup-templates +install -m 755 -d $RPM_BUILD_ROOT/etc/init.d +install -m 755 -d $RPM_BUILD_ROOT/usr/sbin +install -m 644 sysconfig.mouse-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates +install -m 755 rcgpm $RPM_BUILD_ROOT/etc/init.d/gpm +ln -sf ../../etc/init.d/gpm $RPM_BUILD_ROOT/usr/sbin/rcgpm + +%post +# rename variable in all possible locations for update +for i in etc/rc.config etc/sysconfig/mouse ; do + if test -f $i ; then + sed -e "s@^MOUSE=@MOUSEDEVICE=@" $i > $i.t && mv $i.t $i + rm -f $i.t + fi +done +# there were two variables with the same value GPM_PROTOCOL and MOUSETYPE +# in SuLi 8.2. The MOUSETYPE variable better conforms with with other +# variable names MOUSEDEVICE and XMOUSETYPE name scheme, so get rid of +# the obsolete GPM_PROTOCOL variable +if grep "^GPM_PROTOCOL=" /etc/sysconfig/mouse 1>/dev/null 2>/dev/null ; then + if grep "^MOUSETYPE=" /etc/sysconfig/mouse 1>/dev/null 2>/dev/null ; then + # comment out the obsolete MOUSETYPE variable + perl -pi -e "s|^(MOUSETYPE=.*)$|\#\$1 \# the variable GPM_PROTOCOL was renamed to MOUSETYPE|" /etc/sysconfig/mouse + fi + # rename GPM_PROTOCOL to MOUSETYPE + perl -pi -e "s|^GPM_PROTOCOL=(.*)$|\# the variable GPM_PROTOCOL was renamed to MOUSETYPE\nMOUSETYPE=\$1|" /etc/sysconfig/mouse +fi +%{fillup_and_insserv -p gpm} +%{fillup_only -an mouse } +%{run_ldconfig} +%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz + +%postun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz +%{insserv_cleanup} +%{run_ldconfig} + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc BUGS COPYING Changes README README.SuSE TODO +%doc doc/Announce doc/FAQ doc/README* +%doc %{_infodir}/* +%doc %{_mandir}/*/* +%dir /etc/gpm/ +%config /etc/gpm/* +%config /etc/init.d/gpm +/usr/bin/* +/usr/sbin/* +/usr/include/* +%{_libdir}/lib* +%dir /usr/share/emacs +%dir /usr/share/emacs/site-lisp +/usr/share/emacs/site-lisp/* +/var/adm/fillup-templates/* + +%changelog -n gpm +* Thu Feb 16 2006 - mmarek@suse.cz +- merge rcgpm-error-messages.diff into rcgpm +- hint users to run 'yast mouse' to configure gpm + [#114919 and duplicates] +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Thu Nov 03 2005 - mmarek@suse.cz +- fix apparent typo in gunze touchscreen driver [#132053] +* Tue Aug 23 2005 - pmladek@suse.cz +- fixed the init script to print error messages if there are any + problems with configuration [#106700] +* Sat Apr 09 2005 - aj@suse.de +- Fix build also on i386 with GCC 4. +* Sat Mar 26 2005 - aj@suse.de +- Fix build with GCC 4. +* Thu Mar 24 2005 - uli@suse.de +- fixed to build on ARM +* Wed Nov 10 2004 - ro@suse.de +- fixed file list +* Fri Mar 05 2004 - mcihar@suse.cz +- fix possible segfault in Gpm_Open (bug #31970) +* Fri Oct 17 2003 - mcihar@suse.cz +- do not build as root +* Mon Sep 15 2003 - mcihar@suse.cz +- allow to set gpm repeating in sysconfig (GPM_REPEAT) +* Thu Aug 14 2003 - mcihar@suse.cz +- added activation metadata to sysconfig template (bug #28903) +* Fri Jun 20 2003 - ro@suse.de +- added directories to filelist +* Thu Apr 24 2003 - ro@suse.de +- merged postuns +* Thu Apr 24 2003 - ro@suse.de +- fix install_info --delete call and move from preun to postun +* Fri Mar 14 2003 - pmladek@suse.cz +- redirected stdin, stdout and stderr to /dev/null in the daemon mode [#25386] +* Tue Mar 04 2003 - pmladek@suse.cz +- fixed Gpm_Open to initialize option.consolename only for the first time + (Gpm_Open.patch) [#24587] +* Mon Feb 17 2003 - mmj@suse.de +- Use %%install_info macros [#23421] +* Thu Jan 09 2003 - pmladek@suse.cz +- updated to the stable version 1.20.1: + * synaptics ps2 touchpad support + * code cleanup in various main files + * prototype of mouse support for n-mice. expect final in 1.20.3. +- removed the obsolete compat patch which fixed compactibility with an older + libgpm.so.1 +- removed the obsolete synaptic patch which fixed synaptics.c to read + /etc/gpm/syn.conf with TABs +- removed the obsolete old_pid_file patch which fixed the start of gpm server + when an old invalid /var/run/gpm.pid exists +- removed the prototype of mouse support for n-mice, because it does not work + for the present and it is uncomplete, it requires to define the mouse device + before the mouse type on the command line, but the option -M is still needed, + so this feature is not complete and can confuse the user + (no_templates_for_new_multiple_mode.patch) +- fixed the default gpm/syn.conf according to the new synaptics.c +- fixed to link with "-lm" if needed (ceil is not an inline function) + and where needed (gpm, libgpm.so) +* Thu Jan 02 2003 - pmladek@suse.cz +- added metadata to the sysconfig template [#22660] +- got rid of the variable GPM_PROTOCOL from the init script and the + sysconfig template, used MOUSETYPE instead (both variables were generated + by YaST in SuLi 8.2, which is confusing and the variable MOUSETYPE + better conforms with other variable names MOUSEDEVICE and XMOUSETYPE) +* Wed Sep 18 2002 - ro@suse.de +- removed bogus self-provides +* Mon Sep 02 2002 - kukuk@suse.de +- Remove unused yacc from neededforbuild +- Move rcgpm symlink to the same location as the binary is +- Remove not existent services from init script header +* Tue Aug 13 2002 - pmladek@suse.cz +- already enabled __os_install_post macro +* Mon Aug 12 2002 - pmladek@suse.de +- fixed problem with variable argument lists [#17528] +- removed patch which fixes messages, they are completely disabled + in libgpm now, generally, no library should write messages on + standart output or standart error output (it made problems + with w3m for example) +* Tue Jul 30 2002 - ro@suse.de +- also rename MOUSE to MOUSEDEVICE on update +- added PreReqs +* Tue Jul 30 2002 - pmladek@suse.cz +- used the MOUSEDEVICE variable instead of the MOUSE variable [#17266] +- the MOUSEDEVICE variable is filled up into /etc/sysconfig/mouse + by this package now [#17266] +* Thu Jul 25 2002 - pmladek@suse.cz +- fixed compactibility with older libgpm.so.1 +- fixed gpm messages: + * added prefix "gpm: " + * disabled debug messages in libgpm + * improved message in function Gpm_Open when gpm server + is not running +* Thu Jul 11 2002 - pmladek@suse.cz +- added Silitek mouse drivers created by Dr. Werner Fink +- gpm config files changes: + * installed gpm-twiddler.conf, many thanks to Dr. Werner Fink for hint + * fixed and installed gpm-syn.conf + * moved all gpm config files from /etc to /etc/gpm + * removed prefix "gpm-" from gpm config file names + * created README.SuSE + * improved "probe" part in init script to check changes + in config files from /etc/gpm/* +- fixed synaptics.c to read /etc/gpm/syn.conf with TABs +- fixed support for reconnection for PS/2 mouses to save necessary values + in struct mouse_features (to work correctly with dual-mouse stuff) +* Wed Jul 10 2002 - pmladek@suse.cz +- updated to version 1.20.1rc1: + * synaptics ps2 touchpad support + * removed compile problems + * objdir/ support without problems + * cleaned up internal message functions + * clean {g,m,}awk support + * clean ps2 initialization (allows using ps2 mouse after you + used synps!) + * gpm clients can't cause gpm do die. +- removed obsolete patch for gpm-root.y +- removed obsolete ia64 patch +- removed obsolete Werner's patch for devfs.c +- improved patch for reconnection of PS/2 mouses +- fixed start of gpm server when an old invalid /var/run/gpm.pid exists +- reorganized patches +- used %%run_ldconfig macro in %%post and %%postun sections +- fixed init script according to skeleton +* Tue Jul 09 2002 - werner@suse.de +- Bug fix in devfs.c for twid and other keyboards +- Bug fix in gpm.c: Some PS/2 devices really wants be readed + byte by byte +- Complete the PS/2 command bytes in headers/defines.h +* Fri Mar 15 2002 - kukuk@suse.de +- fix typo in sysconfig.gpm [Bug #15034] +* Thu Jan 17 2002 - pmladek@suse.cz +- added variable GPM_PROTOCOL to /etc/sysconfig/mouse +- if the variable GPM_PARAM is empty then gpm will start with option + "-t $GPM_PROTOCOL -m $MOUSE" now +* Wed Jan 16 2002 - ro@suse.de +- removed setup.selection +* Fri Jan 11 2002 - pmladek@suse.cz +- used macro %%{_libdir} to fix for lib64 +- fixed rights of static library to 644 +- fixed documentation in /usr/share/doc/packages/gpm +* Tue Jan 08 2002 - egmont@suselinux.hu +- removed colons from init script messages +* Tue Jan 08 2002 - ro@suse.de +- moved GPM_PARAM to /etc/sysconfig/mouse +* Mon Dec 10 2001 - pmladek@suse.cz +- updated to version 1.19.6: + * Synaptics 4 Button Touchpad support + * IntelliMouse Explorer support + * some bug fixes +- removed obsolete mktemp security patch +* Wed Dec 05 2001 - ro@suse.de +- add "-p" to macro call to deactivate perl-hack +* Wed Dec 05 2001 - ro@suse.de +- use fillup_and_insserv and removed START_GPM +- move variable GPM_PARAM to this package +* Thu Oct 18 2001 - pmladek@suse.cz +- fixed permissions of /dev/gpmctl back to 777, thus the + applications (mc) can use mouse support for normal user (#11893) +* Mon Sep 17 2001 - pmladek@suse.cz +- fixed to detect tokens AA 00 only in protocols + for ps/2 mouses +* Mon Sep 10 2001 - pmladek@suse.cz +- fixed to read only two bytes when mouse is + reconected and it sends tokens AA 00 +* Fri Sep 07 2001 - pmladek@suse.cz +- fixed detection of reconnection of ps2 mouses and friends + with kernel 2.4.9 or higher (bug #9822) + * I take inspiration in patch from + George Staikos (staikos@0wned.org) +* Thu Aug 23 2001 - pmladek@suse.cz +- updated to version 1.19.3: + * security fixes: + * close the newly accept()ed socket in case of + identification failure + * removed initial setuid(0) call + * added initgroups() + * many bugfixes + * features: + * re-check console size on console change + * changed use of -o option +- removed obsolete security patches +- removed obsolete resize patch +- applied two patches from RedHat: + * fix permissions on /dev/gpmctl + * call initgroups in gpm-root before spawning command as user + * make gpm-root work on big endian +* Mon Aug 06 2001 - kukuk@suse.de +- Fix comment about init script location [Bug #9494] +* Thu Jun 14 2001 - pmladek@suse.cz +- fixed link libgpm.so.1 +* Fri Jun 08 2001 - kukuk@suse.de +- Use _libdir macros +* Fri Jun 08 2001 - pmladek@suse.cz +- fixed to compile on sparc64 (libraries in /usr/lib64 now) +- fixed BUILD_ROOT +* Wed May 16 2001 - pmladek@suse.cz +- fixed cast warnings on ia64 +* Mon Apr 23 2001 - pmladek@suse.cz +- fixed warnings on ia64 +* Thu Apr 12 2001 - pmladek@suse.cz +- fixed init script by new skeleton +- fixed to compile +- removed include $(DEPS) from makefile +* Mon Jan 15 2001 - nadvornik@suse.cz +- added Required-Start: $remote_fs $syslog [bug #5580] +* Tue Jan 02 2001 - olh@suse.de +- add script name to %%postin +* Wed Dec 20 2000 - pthomas@suse.de +- Fix bug in Gpm_Wgetch +* Tue Nov 28 2000 - ro@suse.de +- sbin/init.d -> etc/init.d +* Wed Nov 22 2000 - nadvornik@suse.cz +- removed runlevel links +- fixed init script +* Mon Oct 09 2000 - nadvornik@suse.cz +- fixed Copyright +- used bzip2 +* Fri Oct 06 2000 - schwab@suse.de +- Use getdtablesize() instead of OPEN_MAX. +* Mon Jul 17 2000 - nadvornik@suse.cz +- added security patch for disable-paste. Now it don't + need to be installed with suid root. +* Thu Apr 27 2000 - nadvornik@suse.cz +- added initgroups() patch +- used --sysconfdir=/etc +* Tue Apr 18 2000 - nadvornik@suse.cz +- added BuildRoot +* Mon Apr 03 2000 - uli@suse.de +- merged in gpm-root fix by Alessandro Rubini +* Fri Feb 25 2000 - kukuk@suse.de +- Move /usr/{info,man} -> /usr/share/{info,man} +* Mon Jan 31 2000 - uli@suse.de +- added fix for possible /tmp race attacks by thomas@suse.de +* Fri Dec 17 1999 - ro@suse.de +- removed params for ldconfig (-l does not work any more) +- update to 1.18.1 +- got rid of Makefile.Linux +- use RPM_OPT_FLAGS for configure +* Mon Oct 11 1999 - uli@suse.de +- update -> 1.18.0 +* Mon Sep 13 1999 - bs@suse.de +- ran old prepare_spec on spec file to switch to new prepare_spec. +* Tue Mar 16 1999 - ro@suse.de +- fixed rc-script: check if gpm already running +* Fri Mar 05 1999 - ro@suse.de +- fixed rc script +* Tue Mar 02 1999 - ro@suse.de +- update to 1.17.5 +* Mon Dec 07 1998 - ro@suse.de +- updated init-script +- added rcgpm symlink +* Fri Oct 24 1997 - florian@suse.de +- update to gpm 1.13 +* Sun May 04 1997 - bs@suse.de +- added /var/adm/setup/setup.selection +* Wed Apr 30 1997 - florian@suse.de +- update to version 1.12 +* Thu Jan 02 1997 - florian@suse.de +- move startup scripts from aaa_base to gpm.tgz diff --git a/rcgpm b/rcgpm new file mode 100644 index 0000000..74d6c1c --- /dev/null +++ b/rcgpm @@ -0,0 +1,135 @@ +#!/bin/sh +# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany. +# All rights reserved. +# +# Author: +# +# /etc/init.d/gpm +# +# and it's symbolic link +# +# /usr/sbin/rcgpm +# +### BEGIN INIT INFO +# Provides: gpm +# Required-Start: $remote_fs $syslog +# X-UnitedLinux-Should-Start: +# Required-Stop: $remote_fs $syslog +# X-UnitedLinux-Should-Stop: +# Default-Start: 2 3 +# Default-Stop: 0 1 5 6 +# Description: Start gpm to allow mouse on console +### END INIT INFO + +# Check for missing binaries (stale symlinks should not happen) +GPM_BIN=/usr/sbin/gpm +test -x $GPM_BIN || { echo "$GPM_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +# Check for existence of needed config file and read it +GPM_SYSCONFIG=/etc/sysconfig/mouse +test -r $GPM_SYSCONFIG || { echo "$GPM_SYSCONFIG not existing"; + echo "Run 'yast mouse' to set up gpm"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } +. $GPM_SYSCONFIG + +# Check for existence of needed values from $GPM_SYSCONFIG +test \( "$MOUSEDEVICE" -a "$MOUSETYPE" \) -o "$GPM_PARAM" || { + echo "Neither the variables MOUSEDEVICE and MOUSETYPE nor the variable GPM_PARAM"; + echo "is set in $GPM_SYSCONFIG"; + echo "Run 'yast mouse' to set up gpm"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_status -s display "skipped" and exit with status 3 +# rc_status -u display "unused" and exit with status 3 +# rc_failed set local and overall rc status to failed +# rc_failed set local and overall rc status to +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status +# rc_active checks whether a service is activated by symlinks +# rc_splash arg sets the boot splash screen to arg (if active) +. /etc/rc.status + +# First reset status of this service +rc_reset + +# Return values acc. to LSB for all commands but status: +# 0 - success +# 1 - generic or unspecified error +# 2 - invalid or excess argument(s) +# 3 - unimplemented feature (e.g. "reload") +# 4 - user had insufficient privileges +# 5 - program is not installed +# 6 - program is not configured +# 7 - program is not running +# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) +# +# Note that starting an already running service, stopping +# or restarting a not-running service as well as the restart +# with force-reload (in case signaling is not supported) are +# considered a success. + +case "$1" in + start) + echo -n "Starting console mouse support (gpm)" + if test "$GPM_PARAM" ; then + startproc $GPM_BIN $GPM_PARAM + else + ADD_PARAMS="" + if test "$GPM_REPEAT" ; then + ADD_PARAMS="$ADD_PARAMS -R$GPM_REPEAT" + fi + startproc $GPM_BIN -m $MOUSEDEVICE -t $MOUSETYPE $ADD_PARAMS + fi + rc_status -v + ;; + stop) + echo -n "Shutting down console mouse support (gpm)" + killproc -TERM $GPM_BIN + rc_status -v + ;; + try-restart) + $0 status >/dev/null && $0 restart + rc_status + ;; + restart) + $0 stop + $0 start + rc_status + ;; + force-reload) + echo -n "Reload console mouse support (gpm)" + $0 stop && $0 start + rc_status + ;; + reload) + echo -n "Reload console mouse support (gpm)" + rc_failed 3 + rc_status -v + ;; + status) + echo -n "Checking for console mouse support (gpm): " + checkproc $GPM_BIN + rc_status -v + ;; + probe) + GPM_RESTART="False" + for file in $GPM_SYSCONFIG /etc/gpm/* ; do + test $file -nt /var/run/gpm.pid && GPM_RESTART="True" + done + test "$GPM_RESTART" = "True" && echo restart + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; +esac +rc_exit diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/sysconfig.mouse-gpm b/sysconfig.mouse-gpm new file mode 100644 index 0000000..c167e9a --- /dev/null +++ b/sysconfig.mouse-gpm @@ -0,0 +1,37 @@ +## Path: Hardware/Mouse/Console +## Description: Console mouse configuration +## ServiceRestart: gpm +# +## Type: string(/dev/input/mice,/dev/psaux) +## Default: "" +# +# The mouse device used on the console by gpm. +# The default value is generated by YaST. +# +MOUSEDEVICE="" + +## Type: string(imps2,ms,ms3,msc,mman,ps2,syn,synps2) +## Default: "" +# +# The mouse type which defines the mouse protocol used by gpm for the mouse +# device in the variable MOUSEDEVICE +# The default value is generated by YaST +# +MOUSETYPE="" + +## Type: string +## Default: "" +# +# You can define your own options to start gpm here. If the variable is empty +# then the gpm will start with the option "-m $MOUSEDEVICE -t $MOUSETYPE" +# +GPM_PARAM="" + +## Type: string(raw,imps2,ms,ms3,msc,mman,ps2,syn,synps2) +## Default: "" +# +# Define type of repeating for gpm. This is usually needed when you want to +# use gpm together with XFree. All mouse data will be repeated in fifo +# /dev/gpmdata. Use "raw" for repeating same data as received by gpm. +# +GPM_REPEAT=""