udevadm verify: introduce --root option

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.
This commit is contained in:
Dmitry V. Levin
2023-03-10 17:10:41 +00:00
parent e8c53080c4
commit 0a7eda348c
4 changed files with 39 additions and 6 deletions
+5 -1
View File
@@ -64,7 +64,7 @@ _udevadm() {
[MONITOR_ARG]='-s --subsystem-match -t --tag-match'
[TEST]='-a --action -N --resolve-names'
[TEST_BUILTIN]='-a --action'
[VERIFY]='-N --resolve-names'
[VERIFY]='-N --resolve-names --root'
[WAIT]='-t --timeout --initialized=no --removed --settle'
[LOCK]='-t --timeout -d --device -b --backing -p --print'
)
@@ -254,6 +254,10 @@ _udevadm() {
-N|--resolve-names)
comps='early never'
;;
--root)
comps=$(compgen -A directory -- "$cur" )
compopt -o dirnames
;;
*)
comps=''
;;