Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e34c9fcf1c | ||
|
|
c9a200ca8e | ||
|
|
b6a96a4dd3 |
No files matched your search
Vendored
+28
@@ -1,3 +1,31 @@
|
|||||||
|
g15daemon (1.9.5.3-7) unstable; urgency=low
|
||||||
|
|
||||||
|
* Don't distribute .la file
|
||||||
|
|
||||||
|
-- Giacomo Catenazzi <cate@debian.org> Thu, 08 Oct 2009 07:22:15 +0200
|
||||||
|
|
||||||
|
g15daemon (1.9.5.3-6) unstable; urgency=low
|
||||||
|
|
||||||
|
* Shared devices (lcd dispaly + audio) are not good handled
|
||||||
|
by udev script. Adding workaround until improving
|
||||||
|
programs to handle disconnections (Closes: #541780)
|
||||||
|
* Add debugging flag (and code) for init.d and udev scripts
|
||||||
|
* Change syslog facility: from user to daemon
|
||||||
|
* better (and more secure) screenshort creation in /tmp
|
||||||
|
|
||||||
|
-- Giacomo Catenazzi <cate@debian.org> Wed, 19 Aug 2009 07:33:22 +0200
|
||||||
|
|
||||||
|
g15daemon (1.9.5.3-5) unstable; urgency=low
|
||||||
|
|
||||||
|
* Handle keyboard device with udev, so detecting detachement
|
||||||
|
and attachment of keyboarda (Closes: #489978).
|
||||||
|
* init.d LSB header: try to start before xorg, to be able
|
||||||
|
to have full access to all extra keys.
|
||||||
|
* Recent libg15 corrected strange behaviour in new G15 keyboard
|
||||||
|
(Closes: #494180)
|
||||||
|
|
||||||
|
-- Giacomo Catenazzi <cate@debian.org> Thu, 13 Aug 2009 08:20:02 +0200
|
||||||
|
|
||||||
g15daemon (1.9.5.3-4) unstable; urgency=low
|
g15daemon (1.9.5.3-4) unstable; urgency=low
|
||||||
|
|
||||||
* Try to load uinput module, in order to have Gx key working
|
* Try to load uinput module, in order to have Gx key working
|
||||||
|
|||||||
Vendored
+3
@@ -8,5 +8,8 @@
|
|||||||
|
|
||||||
SWITCH_KEY="L1"
|
SWITCH_KEY="L1"
|
||||||
|
|
||||||
|
# Turn on debugging of g15 init.d and udev scripts
|
||||||
|
#G15DEBUG="on"
|
||||||
|
|
||||||
# Additional options that are passed to the Daemon.
|
# Additional options that are passed to the Daemon.
|
||||||
DAEMON_OPTS=""
|
DAEMON_OPTS=""
|
||||||
Vendored
+98
-32
@@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: g15daemon
|
# Provides: g15daemon
|
||||||
# Required-Start: $local_fs
|
# Required-Start: $syslog $local_fs
|
||||||
# Required-Stop: $local_fs
|
# Required-Stop: $syslog $local_fs
|
||||||
# Should-Start: $remote_fs
|
# Should-Start: $remote_fs
|
||||||
# Should-Stop: $remote_fs
|
# Should-Stop: $remote_fs
|
||||||
|
# X-Start-Before: xdm kdm gdm ldm sdm
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
# Default-Stop: 0 1 6
|
# Default-Stop: 0 1 6
|
||||||
# Short-Description: load deamon for Logitech G15 keyboard lcd display
|
# Short-Description: load deamon for Logitech G15 keyboard lcd display
|
||||||
@@ -18,7 +19,7 @@ DAEMON=/usr/sbin/g15daemon
|
|||||||
NAME=g15daemon
|
NAME=g15daemon
|
||||||
DESC=g15daemon
|
DESC=g15daemon
|
||||||
|
|
||||||
test -x $DAEMON || exit 0
|
[ -x "$DAEMON" ] || exit 0
|
||||||
|
|
||||||
# Include g15daemon defaults if available
|
# Include g15daemon defaults if available
|
||||||
if [ -f /etc/default/g15daemon ] ; then
|
if [ -f /etc/default/g15daemon ] ; then
|
||||||
@@ -31,40 +32,76 @@ fi
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [ "$G15DEBUG" = "on" ]; then
|
||||||
|
|
||||||
load_uinput () {
|
log() {
|
||||||
DEVICE=/dev/input/uinput
|
logger -p daemon.debug -t g15 -- "$*"
|
||||||
DEV=".none."
|
}
|
||||||
if [ ! -e "$DEVICE" ] ; then
|
else
|
||||||
modprobe -q uinput || true
|
|
||||||
for i in `seq 80`; do
|
log() {
|
||||||
if [ -e "$DEVICE" ]; then
|
true
|
||||||
DEV="$DEVICE"
|
}
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
echo -n "."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
wait_for_file() {
|
||||||
|
local file=$1
|
||||||
|
local timeout=$2
|
||||||
|
[ "$timeout" ] || timeout=120
|
||||||
|
|
||||||
|
local count=$(($timeout * 10))
|
||||||
|
while [ $count != 0 ]; do
|
||||||
|
[ -e "$file" ] && return 0
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
count=$(($count - 1))
|
||||||
done
|
done
|
||||||
if [ "$DEV" = ".none." ]; then
|
return 1
|
||||||
echo -n "Warning: uinput ($DEVICE) doesn't exist. The G-keys are unsupported..."
|
}
|
||||||
|
|
||||||
|
load_uinput() {
|
||||||
|
if [ ! -e /dev/input/uinput ] ; then
|
||||||
|
modprobe -q uinput || true
|
||||||
|
wait_for_file /dev/input/uinput 3 || return 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_usr_mount() {
|
||||||
|
if [ ! -e "$DAEMON" ] ; then
|
||||||
|
wait_for_file "$DAEMON" 7 || return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_running() {
|
||||||
|
start-stop-daemon --stop --test --quiet --pidfile \
|
||||||
|
/var/run/$NAME.pid --exec $DAEMON
|
||||||
|
}
|
||||||
|
|
||||||
|
do_start() {
|
||||||
|
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
||||||
|
--exec $DAEMON -- $DAEMON_OPTS
|
||||||
|
}
|
||||||
|
|
||||||
|
do_stop() {
|
||||||
|
$DAEMON -k
|
||||||
|
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
|
||||||
|
--oknodo --retry 5 --exec $DAEMON
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting $DESC: "
|
echo -n "Starting $DESC: "
|
||||||
load_uinput
|
load_uinput || echo -n ".../dev/input/uinput not found ..."
|
||||||
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
|
do_start
|
||||||
--exec $DAEMON -- $DAEMON_OPTS
|
|
||||||
echo "$NAME."
|
echo "$NAME."
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Stopping $DESC: "
|
echo -n "Stopping $DESC: "
|
||||||
$DAEMON -k
|
do_stop
|
||||||
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
|
|
||||||
--oknodo --retry 5 --exec $DAEMON
|
|
||||||
echo "$NAME."
|
echo "$NAME."
|
||||||
;;
|
;;
|
||||||
#reload)
|
#reload)
|
||||||
@@ -86,24 +123,53 @@ case "$1" in
|
|||||||
# just the same as "restart" except that it does nothing if the
|
# just the same as "restart" except that it does nothing if the
|
||||||
# daemon isn't already running.
|
# daemon isn't already running.
|
||||||
# check wether $DAEMON is running. If so, restart
|
# check wether $DAEMON is running. If so, restart
|
||||||
start-stop-daemon --stop --test --quiet --pidfile \
|
is_running && $0 restart || exit 0
|
||||||
/var/run/$NAME.pid --exec $DAEMON \
|
|
||||||
&& $0 restart \
|
|
||||||
|| exit 0
|
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
echo -n "Restarting $DESC: "
|
echo -n "Restarting $DESC: "
|
||||||
start-stop-daemon --stop --quiet --pidfile \
|
do_stop
|
||||||
/var/run/$NAME.pid --exec $DAEMON
|
# the device is slow to shut-down
|
||||||
sleep 1
|
sleep 1
|
||||||
start-stop-daemon --start --quiet --pidfile \
|
do_start
|
||||||
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
|
|
||||||
echo "$NAME."
|
echo "$NAME."
|
||||||
;;
|
;;
|
||||||
|
udev)
|
||||||
|
log "calling g15 udev; action: $ACTION, product $PRODUCT"
|
||||||
|
if [ "x$ACTION" = "xadd" ] ; then
|
||||||
|
load_uinput || true
|
||||||
|
wait_usr_mount || true
|
||||||
|
# it seems udev will not release a device if userspace is still
|
||||||
|
# connected
|
||||||
|
is_running && ( do_stop; sleep 1 )
|
||||||
|
do_start
|
||||||
|
elif [ "x$ACTION" = "xremove" ] ; then
|
||||||
|
do_stop
|
||||||
|
else
|
||||||
|
echo "unknow udev action '$ACTION'"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
shared-udev)
|
||||||
|
# some devices share usb also for audio, which causes some spourios
|
||||||
|
# udev messages.
|
||||||
|
log "calling g15 shared-dev; action: $ACTION, product $PRODUCT"
|
||||||
|
if [ "x$ACTION" = "xadd" ] ; then
|
||||||
|
load_uinput || true
|
||||||
|
wait_usr_mount || true
|
||||||
|
do_start
|
||||||
|
elif [ "x$ACTION" = "xremove" ] ; then
|
||||||
|
do_stop
|
||||||
|
else
|
||||||
|
echo "unknow udev action '$ACTION'"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
N=/etc/init.d/$NAME
|
N=/etc/init.d/$NAME
|
||||||
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
|
echo "Usage: $N {start|stop|restart|force-reload|udev}" >&2
|
||||||
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# udev rule to start g15daemon when logitech g15 keyboards are attached
|
||||||
|
#
|
||||||
|
# Recognized devices from libg15-1.2.7/libg15.c
|
||||||
|
#
|
||||||
|
|
||||||
|
# Logitech g11 -- extra keys, no LCD
|
||||||
|
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c225", RUN+="/etc/init.d/g15daemon udev"
|
||||||
|
|
||||||
|
# Logitech G15 (blue) -- extra keys and LCD
|
||||||
|
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c222", RUN+="/etc/init.d/g15daemon udev"
|
||||||
|
|
||||||
|
# Logitech G15 v2 (orange) -- extra keys and LCD
|
||||||
|
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c227", RUN+="/etc/init.d/g15daemon shared-udev"
|
||||||
|
|
||||||
|
# Logitech Z10 -- extra keys and LCD
|
||||||
|
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="0a07", RUN+="/etc/init.d/g15daemon udev"
|
||||||
|
|
||||||
|
# Logitech G15 Gamepanel -- extra keys and LCD
|
||||||
|
SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c251", RUN+="/etc/init.d/g15daemon shared-udev"
|
||||||
|
|
||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
debian/tmp/usr/include/* usr/include/
|
debian/tmp/usr/include/* usr/include/
|
||||||
debian/tmp/usr/lib/lib*.a usr/lib/
|
debian/tmp/usr/lib/lib*.a usr/lib/
|
||||||
debian/tmp/usr/lib/lib*.so usr/lib/
|
debian/tmp/usr/lib/lib*.so usr/lib/
|
||||||
debian/tmp/usr/lib/*.la usr/lib/
|
|
||||||
|
|
||||||
Vendored
+3
@@ -23,6 +23,9 @@ AUTOMAKE_REMOVE += */.libs/
|
|||||||
|
|
||||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||||
include /usr/share/cdbs/1/class/autotools.mk
|
include /usr/share/cdbs/1/class/autotools.mk
|
||||||
|
include /usr/share/cdbs/1/rules/utils.mk
|
||||||
|
|
||||||
|
common-binary-predeb-arch:: list-missing
|
||||||
|
|
||||||
DEB_CONFIGURE_EXTRA_FLAGS = --quiet
|
DEB_CONFIGURE_EXTRA_FLAGS = --quiet
|
||||||
|
|
||||||
+4
-3
@@ -96,10 +96,11 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
|
|||||||
displaying->backlight_state %= 3; // limit to 0-2 inclusive
|
displaying->backlight_state %= 3; // limit to 0-2 inclusive
|
||||||
}
|
}
|
||||||
if(value & G15_KEY_M1 && value & G15_KEY_M3) {
|
if(value & G15_KEY_M1 && value & G15_KEY_M3) {
|
||||||
|
#define FILENAME_SIZE 128
|
||||||
static int scr_num=0;
|
static int scr_num=0;
|
||||||
char filename[128];
|
char filename[FILENAME_SIZE];
|
||||||
lcd_t *displaying = lcd->masterlist->current->lcd;
|
lcd_t *displaying = lcd->masterlist->current->lcd;
|
||||||
sprintf(filename,"/tmp/g15daemon-sc-%i.pbm",scr_num);
|
snprintf(filename, FILENAME_SIZE, "/tmp/g15daemon-sc-%i.pbm",scr_num);
|
||||||
uf_screendump_pbm(displaying->buf,filename);
|
uf_screendump_pbm(displaying->buf,filename);
|
||||||
scr_num++;
|
scr_num++;
|
||||||
}
|
}
|
||||||
@@ -456,7 +457,7 @@ int main (int argc, char *argv[])
|
|||||||
struct passwd *nobody;
|
struct passwd *nobody;
|
||||||
unsigned char location[1024];
|
unsigned char location[1024];
|
||||||
|
|
||||||
openlog("g15daemon", LOG_PID, LOG_USER);
|
openlog("g15daemon", LOG_PID, LOG_DAEMON);
|
||||||
if(strlen((char*)user)==0){
|
if(strlen((char*)user)==0){
|
||||||
nobody = getpwnam("nobody");
|
nobody = getpwnam("nobody");
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -666,12 +666,23 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int uf_screendump_pbm(unsigned char *buffer,char *filename) {
|
int uf_screendump_pbm(unsigned char *buffer,char *filename) {
|
||||||
|
int fd;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int x,y;
|
int x,y;
|
||||||
#define WIDTH 40
|
#define WIDTH 40
|
||||||
g15canvas *canvas=g15daemon_xmalloc(sizeof(g15canvas));
|
g15canvas *canvas=g15daemon_xmalloc(sizeof(g15canvas));
|
||||||
memcpy(canvas->buffer,buffer,LCD_BUFSIZE);
|
memcpy(canvas->buffer,buffer,LCD_BUFSIZE);
|
||||||
f = fopen(filename,"w+");
|
fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||||
|
if(fd == -1) {
|
||||||
|
g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: open, %s.\n", strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
f = fdopen(fd,"w");
|
||||||
|
if(f==NULL) {
|
||||||
|
close(fd);
|
||||||
|
g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: fdopen, %s.\n", strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
fprintf(f,"P1\n160 43\n");
|
fprintf(f,"P1\n160 43\n");
|
||||||
fprintf(f,"# G15 screendump - %s\n\n",filename);
|
fprintf(f,"# G15 screendump - %s\n\n",filename);
|
||||||
for(y=0;y<43;y++)
|
for(y=0;y<43;y++)
|
||||||
@@ -682,6 +693,8 @@ int uf_screendump_pbm(unsigned char *buffer,char *filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
fsync(fd);
|
||||||
|
close(fd);
|
||||||
free(canvas);
|
free(canvas);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user