Browse Source

Benjamin Schieder:


			
			
				rocklinux
			
			
		
Benjamin Schieder 19 years ago
parent
commit
001e5fc621
2 changed files with 32 additions and 0 deletions
  1. +30
    -0
      package/base/udev/inputdev.sh
  2. +2
    -0
      package/base/udev/udev.conf

+ 30
- 0
package/base/udev/inputdev.sh

@ -0,0 +1,30 @@
#!/bin/sh -e
#
# Scans /proc/bus/input/devices for the given device.
#
# (c) 2004 Darren Salt <linux@youmustbejoking.demon.co.uk>
# GPL v2 or later applies.
[ "$1" ] || exit 0
# input device name, less leading "input/"
DEVICE=${1#input/}
# "|"-separated list.
# The first found in the given device's "N:" line will be output.
DEFAULT_KEYWORDS='dvb|saa7134'
KEYWORDS=${2:-$DEFAULT_KEYWORDS}
exec sed -nre '
/^I:/ {
: gather
N
/\nH:/! b gather
/'"$DEVICE"'/ {
s/^.*\nN:[^\n]*("|\b)('"$KEYWORDS"')("|\b)[^\n]*\n.*$/inputdev/
T
p
}
}
' < /proc/bus/input/devices

+ 2
- 0
package/base/udev/udev.conf

@ -27,6 +27,8 @@ udev_pm() {
cp -v extras/{ide-devfs.sh,scsi-devfs.sh} $root/etc/udev/scripts/
chmod +x $root/etc/udev/scripts/{ide-devfs.sh,scsi-devfs.sh}
cp -v $confdir/permissions.rules $root/etc/udev/rules.d/
cp -v $confdir/inputdev.sh $root/etc/udev/scripts
chmod +x $root/etc/udev/scripts/inputdev.sh
ln -svf ../etc/udev/scripts $root/lib/udev
install_init udevd $confdir/udevd.init
}

Loading…
Cancel
Save