diff options
-rw-r--r-- | 99-marsond.rules.in | 13 | ||||
-rw-r--r-- | LICENSE | 14 | ||||
-rw-r--r-- | README | 37 | ||||
-rw-r--r-- | rc.marsond | 36 |
4 files changed, 56 insertions, 44 deletions
diff --git a/99-marsond.rules.in b/99-marsond.rules.in new file mode 100644 index 0000000..40719f2 --- /dev/null +++ b/99-marsond.rules.in @@ -0,0 +1,13 @@ +# udev rule for marsond. + +# should be installed to /etc/udev/rules.d/99-marsond.rules +# (but NOT /lib/udev...) + +# if you need a user other than "nobody", you can add: +# ENV{MARSOND_USER}="whoever", +# and maybe ENV{MARSOND_GROUP}="somegroup" as well. + +# if you need extra arguments to marsond, you can put them in +# the RUN string. + +ACTION=="add", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="0101", RUN+="@SBINDIR@/marsond" @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + @@ -26,7 +26,7 @@ Prerequisites ------------- - Recent-ish Linux kernel. Anything from 4.x up should be fine. -- Kernel headers. +- glibc and kernel headers. - uinput support in the kernel. Most distros should have this. - gcc or clang. - make. @@ -44,14 +44,35 @@ If you want to build a static binary, you can't do it with glibc, due to it needing libnss_compat at runtime (for the getpwnam() and getgrnam() calls). You'll have to use something like musl-libc. +After installation, or any time you edit the udev .rules file, +run this: + +# udevadm control --reload + +If you're packaging this for a Linux distro, you can run the +above command from your package system's post-install hook (e.g. +doinst.sh on Slackware). See also the variables at the top of +the Makefile. + Running the daemon ------------------ -Everyone seems to use a different init system these days. I only -provide an rc.marsond script for Slackware's SysV init. Basically, you -want to start up the daemon at boot, using whatever facility your OS -provides (systemd, s6, openrc, etc). It must be started as root, and -it will drop privileges after initialization and run as the 'nobody' -user by default. See the man page for other options you might want -to use. +After "make install", it will run via udev when the device is plugged +in. See /etc/udev/rules.s/99-marsond.rules to change the options, +if needed. If it doesn't start automatically, check the vendor and +product IDs in dmesg against the ones in the .rules file. If you have +a different vendor/product ID that has the Enter key problem, please +contact me so I can add them to the udev rule. + +When the device is unplugged, the daemon will exit. + +For testing purposes, you can start it manually. Usually when you do +this, you'll want the -v and -f options (verbose, foreground). + + +Contact +------- + +Email: B. Watson, <urchlay@slackware.uk> +IRC: Urchlay on irc.libera.chat diff --git a/rc.marsond b/rc.marsond deleted file mode 100644 index dfacf40..0000000 --- a/rc.marsond +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# Start/stop/restart marsond, Slackware-style. - -# To start marsond at boot, make sure this script is executable: - -# chmod 755 /etc/rc.d/rc.marsond -# ...and then add this to /etc/rc.d/rc.local: - -# [ -x /etc/rc.d/rc.marsond ] && /etc/rc.d/rc.marsond - -# There's no need to add anything to rc.local_shutdown, as the -# daemon will always exit cleanly. - -# If you need to set the keyboard's input device name and/or the -# delay time for Enter key releases, uncomment and modify the -# next line: - -#MARSOND_OPTS="-d 30 -k /dev/input/by-id/your-device-name-goes-here" - -# By default, marsond drops privilege to nobody:nogroup after -# initialization. You can use a different user and group by -# uncommenting and modifying these: - -#export MARSON_USER=nobody -#export MARSON_GROUP=nogroup - -PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin -export PATH - -case "$1" in - start) /usr/sbin/marsond $MARSOND_OPTS ;; - stop) /sbin/killall marsond ;; - restart) "$0" stop ; sleep 2; "$0" start ;; - *) echo "usage $0 start|stop|restart" ;; -esac |