1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00

extras/keymap/findkeyboards: Filter out non-event devices

This avoids running udevadm info --query=name against a non-existing devnode,
which aborts the script early.
This commit is contained in:
Martin Pitt 2011-10-26 11:03:21 +02:00
parent 3aa3be179f
commit 8ab7a9be03

View File

@ -21,6 +21,11 @@ keyboard_devices() {
for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do
walk=`udevadm info --attribute-walk --path=$dev` walk=`udevadm info --attribute-walk --path=$dev`
env=`udevadm info --query=env --path=$dev` env=`udevadm info --query=env --path=$dev`
# filter out non-event devices, such as the parent input devices which
# have no devnode
if ! echo "$env" | grep -q '^DEVNAME='; then
continue
fi
if echo "$walk" | grep -q 'DRIVERS=="atkbd"'; then if echo "$walk" | grep -q 'DRIVERS=="atkbd"'; then
echo -n 'AT keyboard: ' echo -n 'AT keyboard: '
elif echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then elif echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then