]> git.ipfire.org Git - thirdparty/systemd.git/commit
udevadm: introduce new 'verify' command
authorDmitry V. Levin <ldv@strace.io>
Thu, 2 Mar 2023 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@strace.io>
Wed, 8 Mar 2023 18:55:40 +0000 (18:55 +0000)
commitacdba85e0e2bf229f356ad09a2b880e89224715d
treec070f6407dd1bd639708e1c7dfb5243478f4dd05
parent4f5de157316f00e046bc43687144fb8a6a81808f
udevadm: introduce new 'verify' command

We seem to have no tool to verify udev rule files.  There is a simple
udev rules syntax checker in the tree, test/rule-syntax-check.py, but
it is too simple to detect less trivial issues not detected by udev,
e.g. redundant comparisons (#26593) or labels without references.

Such a tool would be beneficial not only for maintaining udev rules
distributed along with udev, but also and even more so for maintaining
third party udev rules that are more likely to have issues with syntax
and semantic correctness.

Implement a udev rules syntax and semantics checker in the form of
'udevadm verify [OPTIONS] FILE...' command that is based on
udev_rules_parse_file() interface and would apply further checks
on top of it in subsequent commits.

Resolves: #26606
man/udevadm.xml
shell-completion/bash/udevadm
shell-completion/zsh/_udevadm
src/udev/meson.build
src/udev/udev-rules.c
src/udev/udev-rules.h
src/udev/udevadm-verify.c [new file with mode: 0644]
src/udev/udevadm.c
src/udev/udevadm.h