summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-verify.c
Commit message (Collapse)AuthorAgeFilesLines
* udev-rules: move udev_check_rule_line() invocationDmitry V. Levin2023-03-271-1/+1
| | | | | | | | | Move udev_check_rule_line() invocation from udev_rule_file_get_issues() to udev_rules_parse_file(), invoke udev_check_rule_line() only when udev_rules_parse_file() is called by udevadm verify. Subsequent commits are going to perform more checks invoked from udev_rules_parse_file().
* udevadm-verify: add a short summaryYu Watanabe2023-03-161-2/+18
|
* udevadm-verify: fix indentation of help messageYu Watanabe2023-03-131-1/+1
|
* udev-rule: rework logging about udev rulesYu Watanabe2023-03-131-2/+5
| | | | | | | | | | | | | | | This makes the loggers take the most relevant object, i.e. when applying udev rules to a device, the loggers take sd_device and UdevRuleToken object, and when parsing udev rules, they take UdevRuleLine or UdevRuleFile object. To achieve that, this drops 'iterators' in UdevRules or friends named `current_file` or so. Instead of that, each object now has its parent object, e.g. UdevRuleToken.rule_line that references the UdevRuleLine object the token belonging to. And each function previously took UdevRules object now takes the most relevant object, e.g. UdevRuleToken. Solves the discussion in https://github.com/systemd/systemd/pull/26698#discussion_r1129261193.
* udevadm verify: introduce --root optionDmitry V. Levin2023-03-101-5/+28
| | | | | | When udevadm verify is invoked without positional arguments and loads all rules files from the system like the udev daemon does, this option can be used to operate on files underneath the specified root path.
* udevadm verify: load all rules from the system if no rules were givenDmitry V. Levin2023-03-101-4/+14
| | | | | | When udevadm verify is invoked without positional arguments, that is, when no udev rules files are specified, load all rules files from the system like the udev daemon does, and verify them.
* udevadm: introduce new 'verify' commandDmitry V. Levin2023-03-081-0/+125
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