systemd/rules.d/60-evdev.rules

31 lines
1.1 KiB
Plaintext
Raw Normal View History

# do not edit this file, it will be overwritten on update
ACTION=="remove", GOTO="evdev_end"
KERNEL!="event*", GOTO="evdev_end"
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
# Execute the match patterns below, from least-to-most specific.
# Device matching the modalias string (bustype, vendor, product, version, other properties)
IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
ENV{.HAVE_HWDB_PROPERTIES}="1"
# AT keyboard matching by the machine's DMI data
DRIVERS=="atkbd", \
IMPORT{builtin}="hwdb 'evdev:atkbd:$attr{[dmi/id]modalias}'", \
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
ENV{.HAVE_HWDB_PROPERTIES}="1"
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
# Device matching the input device name and the machine's DMI data
KERNELS=="input*", \
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \
ENV{.HAVE_HWDB_PROPERTIES}="1"
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
# Device matching the input device name + properties + the machine's DMI data
KERNELS=="input*", \
udev: rework 60-evdev.rules to be "additive" We would execute up to four hwdb match patterns (+ the keyboard builtin): After the first hit, we would skip the other patterns, because of the GOTO="evdev_end" action. 57bb707d48131f4daad2b1b746eab586eb66b4f3 (rules: Add extended evdev/input match rules for event nodes with the same name), added an additional match with ":phys:<phys>:ev:<ev>" inserted. This breaks backwards compatibility for user hwdb patterns, because we quit after the first match. In general hwdb properties are "additive". We often have a general rule that matches a wider class and then some specific overrides. E.g. in this particular case, we have a match for all trackpoints, and then a bunch of model-specific settings. So let's change the rules to try all the match patterns and combine the received properties. We execute builtin-keyboard once at the end, if there was at least one match. Fixes #25698. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2152226. This also impacts other cases which I think would be very confusing for users. Since we quit after a first successful match, if we had e.g. a match for 'evdev:input:b*v*p*' in out database, and the user added a match using 'evdev:name:*', which is the approach we document in the .hwdb files and which users quite often use, it would be silently ignored. What's worse, if we added our 'evdev:input:b*v*p*' match at a later point, user's match would stop working. If we combine all the properties, we get more stable behaviour.
2022-12-12 11:52:12 +00:00
IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:phys:$attr{phys}:ev:$attr{capabilities/ev}:$attr{[dmi/id]modalias}'", \
ENV{.HAVE_HWDB_PROPERTIES}="1"
ENV{.HAVE_HWDB_PROPERTIES}=="1", \
IMPORT{builtin}="keyboard"
LABEL="evdev_end"