From 0b61620c222e42417e2a7a459f27c0f0bd401df8 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 17 Mar 2021 13:14:54 +0200 Subject: [PATCH] doc: fix udev rule in calibration-helper.bash This used a cargo-culted form of the ACTION check. Kernel is allowed to invent new ACTIONs and IIRC there are already actions like bind and unbind. Udev events before rule processing always start with a clean property list. This means that if you only match ACTION==add to add some value to the event, then that value will not be present for ACTION==bind. Udev event consumers do not accumulate values, so inconsistent value setting may confuse them. Therefore one needs to match ACTION!=remove, not ACTION==add|change, to keep the device properties consistent for every event. It doesn't hurt to set them on remove either, but it's a habit to try to avoid processing when not strictly needed. This issue came up in https://gitlab.freedesktop.org/wayland/weston/-/issues/476#note_841430 For more information, see https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.html the part "KERNEL API INCOMPATIBILITY" near the beginning. Signed-off-by: Pekka Paalanen --- doc/scripts/calibration-helper.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/scripts/calibration-helper.bash b/doc/scripts/calibration-helper.bash index 72effe3a..cd2d7d7b 100755 --- a/doc/scripts/calibration-helper.bash +++ b/doc/scripts/calibration-helper.bash @@ -50,7 +50,7 @@ SERIAL=$(udevadm info "$SYSPATH" --query=property | \ [ -z "$SERIAL" ] && exit 1 # You'd have this write a file instead. -echo "ACTION==\"add|change\",SUBSYSTEM==\"input\",ENV{ID_SERIAL}==\"$SERIAL\",ENV{LIBINPUT_CALIBRATION_MATRIX}=\"$MATRIX\"" +echo "ACTION!=\"remove\",SUBSYSTEM==\"input\",ENV{ID_SERIAL}==\"$SERIAL\",ENV{LIBINPUT_CALIBRATION_MATRIX}=\"$MATRIX\"" # Then you'd tell udev to reload the rules: #udevadm control --reload