Skip to content

udev rules Wconflict match

Alexey Gladkov edited this page Mar 15, 2023 · 2 revisions

-Wconflict-match

Warn when a checks in the rule has opposite conditions or same variable is tested on different values.

Udev sorts all the conditions and actions in the rule so that the checks are at the beginning of the rule. Therefore, having two opposite checks does not make any sense.

Problematic code:

ACTION=="add", ACTION!="add", RUN+="/bin/true"

or

ACTION=="add", ENV{DEVTYPE}=="disk", ENV{DEVTYPE}=="partition", RUN+="/bin/true"
Clone this wiki locally