Bug#265799: udev: /dev/input/* mode 0600 breaks remote control input

Darren Salt pkg-vdr-dvb-devel@lists.alioth.debian.org
Sun, 12 Sep 2004 17:00:03 +0100


This message is in MIME format which your mailer apparently does not support.
You either require a newer version of your software which supports MIME, or
a separate MIME decoding utility.  Alternatively, ask the sender of this
message to resend it in a different format.

--1202081585--365166189--39237126
Content-Type: text/plain; charset=us-ascii

I demand that Marco d'Itri may or may not have written...

> I'm not sure I understand how your inputdev.sh works: if I set
> $KEYWORDS='dvb|.' and run it with "input/event2" as the argument it only
> outputs a blank line. event2 is the IR device of my TV tuner card:

> I: Bus=0001 Vendor=1131 Product=0000 Version=0001
> N: Name="saa7134 IR (LifeView FlyVIDEO30"
> P: Phys=pci-0000:00:0a.0/ir0
> H: Handlers=kbd event2
> B: EV=100003
> B: KEY=c0304 100000 0 0 0 0 1 10000 2 1e0001 7bb80 0 0

You want KEYWORDS="dvb|saa7134" or something similar, and a slightly modified
script (attached).

I've made one other change: the script always outputs "inputdev". Replacing
this with "\2" will tell you which token was found.

> BTW, I wonder if it would be a good idea to move inputdev.sh and the
> associated rules file to dvb-utils.

dvb-utils or my vdr-plugin-remote package (although the script could easily
be used for other devices). I should mention that this issue doesn't affect
the vdr packages in sarge since vdr is run as root, but anybody using udev
along with my vdr packages (or, possibly, future vdr packages in unstable?)
will be bitten by this.

The script could be put to other (input-related) uses: maybe the keywords
list should be passed in as a second parameter, and it should stay in udev
with rules which use it going elsewhere?

(DVB devel list CC'd; followups set. <http://bugs.debian.org/265799>.)

-- 
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| Debian,     | s zap,tartarus,org            | Northumberland
| RISC OS     | @                             | Toon Army
|   I don't ask for much, just untold riches...

"I see!" said the blind man as he picked up his hammer and saw.

--1202081585--365166189--39237126
Content-Type: text/plain; charset=iso-8859-1; name="inputdev.sh"
Content-Disposition: attachment; filename="inputdev.sh"
Content-Transfer-Encoding: quoted-printable

#! /bin/sh
# (c) 2004 Darren Salt <linux@youmustbejoking.demon.co.uk>
# GPL v2 or later applies.

# Scans /proc/bus/input/devices for the given device.

test "$1" =3D "" && exit 0

# "|"-separated list.
# The first found in the given device's "N:" line will be output.
KEYWORDS=3D'dvb|saa7134'

# input device name, less leading "input/"
DEVICE=3D"`echo "$1" | sed -e s.input/..`"

sed -nre '
  /^I:/ {
    : gather
    N
    /\nH:/! b gather
    /'"$DEVICE"'/ {
      s/^.*\nN:[^\n]*("|\b)('"$KEYWORDS"')("|\b)[^\n]*\n.*$/inputdev/
      T
      p
    }
  }' </proc/bus/input/devices

--1202081585--365166189--39237126--