From: Martin Pitt Date: Wed, 26 Oct 2011 09:03:21 +0000 (+0200) Subject: extras/keymap/findkeyboards: Filter out non-event devices X-Git-Tag: 175~15 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ab7a9be03441db21d459cbb9c08400377c3556d;p=systemd 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. --- diff --git a/extras/keymap/findkeyboards b/extras/keymap/findkeyboards index 5a22649e..fd64301d 100755 --- a/extras/keymap/findkeyboards +++ b/extras/keymap/findkeyboards @@ -21,6 +21,11 @@ keyboard_devices() { for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do walk=`udevadm info --attribute-walk --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 echo -n 'AT keyboard: ' elif echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then