diff options
author | Dmitry V. Levin <ldv@strace.io> | 2023-03-02 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-03-08 18:55:40 +0000 |
commit | acdba85e0e2bf229f356ad09a2b880e89224715d (patch) | |
tree | c070f6407dd1bd639708e1c7dfb5243478f4dd05 /man/udevadm.xml | |
parent | 4f5de157316f00e046bc43687144fb8a6a81808f (diff) | |
download | systemd-acdba85e0e2bf229f356ad09a2b880e89224715d.tar.gz |
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
Diffstat (limited to 'man/udevadm.xml')
-rw-r--r-- | man/udevadm.xml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/man/udevadm.xml b/man/udevadm.xml index 33af155021..95b8da2b0a 100644 --- a/man/udevadm.xml +++ b/man/udevadm.xml @@ -49,6 +49,11 @@ <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command> </cmdsynopsis> <cmdsynopsis> + <command>udevadm verify</command> + <arg choice="opt" rep="repeat">options</arg> + <arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> <command>udevadm wait <optional>options</optional> <replaceable>device|syspath</replaceable></command> </cmdsynopsis> <cmdsynopsis> @@ -738,6 +743,37 @@ </refsect2> <refsect2> + <title>udevadm verify + <arg choice="opt"><replaceable>options</replaceable></arg> + <arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg> + … + </title> + + <para>Verify syntactic and semantic correctness of udev rules files.</para> + + <para>Positional arguments should be used to specify one or more files to check.</para> + + <para>The exit status is <constant>0</constant> if all specified udev rules files + are syntactically and semantically correct, and a non-zero error code otherwise.</para> + + <variablelist> + <varlistentry> + <term><option>-N</option></term> + <term><option>--resolve-names=<constant>early</constant>|<constant>never</constant></option></term> + <listitem> + <para>Specify when udevadm should resolve names of users + and groups. When set to <constant>early</constant> (the + default), names will be resolved when the rules are + parsed. When set to <constant>never</constant>, names will + never be resolved.</para> + </listitem> + </varlistentry> + + <xi:include href="standard-options.xml" xpointer="help" /> + </variablelist> + </refsect2> + + <refsect2> <title>udevadm wait <arg choice="opt"><replaceable>options</replaceable></arg> <arg choice="opt"><replaceable>device|syspath</replaceable></arg> |