[systemd-commits] rules/60-keyboard.rules

David Herrmann dvdhrm at kemper.freedesktop.org
Fri Mar 20 04:32:18 PDT 2015


 rules/60-keyboard.rules |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9a2e1571c0d535ee784cd0401f1086d790c7650b
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Fri Mar 20 12:28:12 2015 +0100

    rules: avoid 'device/' accesses
    
    We should never access parents, as the sysfs hierarchy is in no way
    stable. Use KERNELS== etc. to match on a parent, then access it via
    $attr{} (which accesses the matching device, not the current device).

diff --git a/rules/60-keyboard.rules b/rules/60-keyboard.rules
index af3edb5..fe61691 100644
--- a/rules/60-keyboard.rules
+++ b/rules/60-keyboard.rules
@@ -13,7 +13,7 @@ DRIVERS=="atkbd", IMPORT{builtin}="hwdb 'keyboard:atkbd:$attr{[dmi/id]modalias}'
   RUN{builtin}+="keyboard", GOTO="keyboard_end"
 
 # device matching the input device name and the machine's DMI data
-IMPORT{builtin}="hwdb 'keyboard:name:$attr{device/name}:$attr{[dmi/id]modalias}'", \
+KERNELS=="input*", IMPORT{builtin}="hwdb 'keyboard:name:$attr{name}:$attr{[dmi/id]modalias}'", \
   RUN{builtin}+="keyboard", GOTO="keyboard_end"
 
 LABEL="keyboard_end"



More information about the systemd-commits mailing list