| 1 |
'\" t |
| 2 |
.TH "UDEVADM" "8" "" "systemd 261~rc3" "udevadm" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
udevadm \- udev management tool |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.HP \w'\fBudevadm\fR\ 'u |
| 26 |
\fBudevadm\fR [\fB\-\-debug\fR] [\fB\-\-version\fR] [\fB\-\-help\fR] |
| 27 |
.HP \w'\fBudevadm\ info\fR\ 'u |
| 28 |
\fBudevadm info\fR [\fIoptions\fR...] [\fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR...] |
| 29 |
.HP \w'\fBudevadm\ trigger\fR\ 'u |
| 30 |
\fBudevadm trigger\fR [\fIoptions\fR...] [\fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR...] |
| 31 |
.HP \w'\fBudevadm\ settle\fR\ 'u |
| 32 |
\fBudevadm settle\fR [\fIoptions\fR...] |
| 33 |
.HP \w'\fBudevadm\ control\fR\ 'u |
| 34 |
\fBudevadm control\fR \fIoptions\fR... |
| 35 |
.HP \w'\fBudevadm\ monitor\fR\ 'u |
| 36 |
\fBudevadm monitor\fR [\fIoptions\fR...] |
| 37 |
.HP \w'\fBudevadm\ test\fR\ 'u |
| 38 |
\fBudevadm test\fR [\fIoptions\fR...] \fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR |
| 39 |
.HP \w'\fBudevadm\ test\-builtin\fR\ 'u |
| 40 |
\fBudevadm test\-builtin\fR [\fIoptions\fR...] \fIcommand\fR \fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR |
| 41 |
.HP \w'\fBudevadm\ verify\fR\ 'u |
| 42 |
\fBudevadm verify\fR [\fIoptions\fR...] [\fIfiles\fR...] |
| 43 |
.HP \w'\fBudevadm\ cat\fR\ 'u |
| 44 |
\fBudevadm cat\fR [\fIoptions\fR...] [\fIfiles\fR...] |
| 45 |
.HP \w'\fBudevadm\ wait\fR\ 'u |
| 46 |
\fBudevadm wait\fR [\fIoptions\fR...] \fIdevpath\fR|\fIsyspath\fR... |
| 47 |
.HP \w'\fBudevadm\ lock\fR\ 'u |
| 48 |
\fBudevadm lock\fR [\fIoptions\fR...] \fIcommand\fR... |
| 49 |
.SH "DESCRIPTION" |
| 50 |
.PP |
| 51 |
\fBudevadm\fR |
| 52 |
expects a command and command specific options\&. It controls the runtime behavior of |
| 53 |
\fBsystemd\-udevd\fR, requests kernel events, manages the event queue, and provides simple debugging mechanisms\&. |
| 54 |
.SH "OPTIONS" |
| 55 |
.PP |
| 56 |
\fB\-d\fR, \fB\-\-debug\fR |
| 57 |
.RS 4 |
| 58 |
Print debug messages to standard error\&. This option is implied in |
| 59 |
\fBudevadm test\fR |
| 60 |
and |
| 61 |
\fBudevadm test\-builtin\fR |
| 62 |
commands\&. |
| 63 |
.RE |
| 64 |
.PP |
| 65 |
\fB\-V\fR, \fB\-\-version\fR |
| 66 |
.RS 4 |
| 67 |
Print a short version string and exit\&. |
| 68 |
.RE |
| 69 |
.PP |
| 70 |
\fB\-h\fR, \fB\-\-help\fR |
| 71 |
.RS 4 |
| 72 |
Print a short help text and exit\&. |
| 73 |
.RE |
| 74 |
.SS "udevadm info [\fIoptions\fR\&...] [\fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR\&...]" |
| 75 |
.PP |
| 76 |
Query the udev database for device information\&. |
| 77 |
.PP |
| 78 |
Positional arguments should be used to specify one or more devices\&. Each one may be a device name (in which case it must start with |
| 79 |
/dev/), a sys path (in which case it must start with |
| 80 |
/sys/), a device ID (such as |
| 81 |
"n1", |
| 82 |
"c5:1", or |
| 83 |
"b259:1", see |
| 84 |
\fBsd_device_get_device_id\fR(3))\&. or a systemd device unit name (in which case it must end with |
| 85 |
"\&.device", see |
| 86 |
\fBsystemd.device\fR(5))\&. |
| 87 |
.PP |
| 88 |
\fB\-q\fR, \fB\-\-query=\fR\fB\fITYPE\fR\fR |
| 89 |
.RS 4 |
| 90 |
Query the database for the specified type of device data\&. Valid |
| 91 |
\fITYPE\fRs are: |
| 92 |
\fBname\fR, |
| 93 |
\fBsymlink\fR, |
| 94 |
\fBpath\fR, |
| 95 |
\fBproperty\fR, |
| 96 |
\fBall\fR\&. |
| 97 |
.RE |
| 98 |
.PP |
| 99 |
\fB\-\-property=\fR\fB\fINAME\fR\fR |
| 100 |
.RS 4 |
| 101 |
When showing device properties using the |
| 102 |
\fB\-\-query=property\fR |
| 103 |
option, limit display to properties specified in the argument\&. The argument should be a comma\-separated list of property names\&. If not specified, all known properties are shown\&. |
| 104 |
.sp |
| 105 |
Added in version 250\&. |
| 106 |
.RE |
| 107 |
.PP |
| 108 |
\fB\-\-value\fR |
| 109 |
.RS 4 |
| 110 |
When showing device properties using the |
| 111 |
\fB\-\-query=property\fR |
| 112 |
option, print only their values, and skip the property name and |
| 113 |
"="\&. |
| 114 |
.sp |
| 115 |
Cannot be used together with |
| 116 |
\fB\-x/\-\-export\fR |
| 117 |
or |
| 118 |
\fB\-P/\-\-export\-prefix\fR\&. |
| 119 |
.sp |
| 120 |
Added in version 250\&. |
| 121 |
.RE |
| 122 |
.PP |
| 123 |
\fB\-p\fR, \fB\-\-path=\fR\fB\fIDEVPATH\fR\fR |
| 124 |
.RS 4 |
| 125 |
The |
| 126 |
/sys/ |
| 127 |
path of the device to query, e\&.g\&. |
| 128 |
[/sys/]/class/block/sda\&. This option is an alternative to the positional argument with a |
| 129 |
/sys/ |
| 130 |
prefix\&. |
| 131 |
\fBudevadm info \-\-path=/class/block/sda\fR |
| 132 |
is equivalent to |
| 133 |
\fBudevadm info /sys/class/block/sda\fR\&. |
| 134 |
.RE |
| 135 |
.PP |
| 136 |
\fB\-n\fR, \fB\-\-name=\fR\fB\fIFILE\fR\fR |
| 137 |
.RS 4 |
| 138 |
The name of the device node or a symlink to query, e\&.g\&. |
| 139 |
[/dev/]/sda\&. This option is an alternative to the positional argument with a |
| 140 |
/dev/ |
| 141 |
prefix\&. |
| 142 |
\fBudevadm info \-\-name=sda\fR |
| 143 |
is equivalent to |
| 144 |
\fBudevadm info /dev/sda\fR\&. |
| 145 |
.RE |
| 146 |
.PP |
| 147 |
\fB\-r\fR, \fB\-\-root\fR |
| 148 |
.RS 4 |
| 149 |
Print absolute paths in |
| 150 |
\fBname\fR |
| 151 |
or |
| 152 |
\fBsymlink\fR |
| 153 |
query\&. |
| 154 |
.RE |
| 155 |
.PP |
| 156 |
\fB\-a\fR, \fB\-\-attribute\-walk\fR |
| 157 |
.RS 4 |
| 158 |
Print all sysfs properties of the specified device that can be used in udev rules to match the specified device\&. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules\&. |
| 159 |
.sp |
| 160 |
This switch supports JSON output mode (see |
| 161 |
\fB\-\-json=\fR |
| 162 |
below)\&. Note that because this switch generates multiple JSON objects, JSON\-SEQ mode is automatically enabled (RFC7464)\&. (Note: tools such as |
| 163 |
\m[blue]\fBjq\fR\m[]\&\s-2\u[1]\d\s+2 |
| 164 |
natively support JSON\-SEQ via the |
| 165 |
\fB\-\-seq\fR |
| 166 |
switch\&.) |
| 167 |
.RE |
| 168 |
.PP |
| 169 |
\fB\-t\fR, \fB\-\-tree\fR |
| 170 |
.RS 4 |
| 171 |
Display a sysfs tree\&. This recursively iterates through the sysfs hierarchy and displays it in a tree structure\&. If a path is specified only the subtree below and its parent directories are shown\&. This will show both device and subsystem items\&. |
| 172 |
.sp |
| 173 |
Added in version 251\&. |
| 174 |
.RE |
| 175 |
.PP |
| 176 |
\fB\-x\fR, \fB\-\-export\fR |
| 177 |
.RS 4 |
| 178 |
Print output as key/value pairs\&. Values are enclosed in single quotes\&. This takes effects only when |
| 179 |
\fB\-\-query=property\fR |
| 180 |
or |
| 181 |
\fB\-\-device\-id\-of\-file=\fR\fB\fIFILE\fR\fR |
| 182 |
is specified\&. |
| 183 |
.RE |
| 184 |
.PP |
| 185 |
\fB\-P\fR, \fB\-\-export\-prefix=\fR\fB\fINAME\fR\fR |
| 186 |
.RS 4 |
| 187 |
Add a prefix to the key name of exported values\&. This implies |
| 188 |
\fB\-\-export\fR\&. |
| 189 |
.RE |
| 190 |
.PP |
| 191 |
\fB\-d\fR, \fB\-\-device\-id\-of\-file=\fR\fB\fIFILE\fR\fR |
| 192 |
.RS 4 |
| 193 |
Print major/minor numbers of the underlying device, where the file lives on\&. If this is specified, all positional arguments are ignored\&. |
| 194 |
.RE |
| 195 |
.PP |
| 196 |
\fB\-e\fR, \fB\-\-export\-db\fR |
| 197 |
.RS 4 |
| 198 |
Export the content of the udev database\&. |
| 199 |
.RE |
| 200 |
.PP |
| 201 |
\fB\-c\fR, \fB\-\-cleanup\-db\fR |
| 202 |
.RS 4 |
| 203 |
Cleanup the udev database\&. |
| 204 |
.RE |
| 205 |
.PP |
| 206 |
\fB\-w\fR\fB[SECONDS]\fR, \fB\-\-wait\-for\-initialization\fR\fB[=SECONDS]\fR |
| 207 |
.RS 4 |
| 208 |
Wait for device to be initialized\&. If argument |
| 209 |
\fISECONDS\fR |
| 210 |
is not specified, the default is to wait forever\&. |
| 211 |
.sp |
| 212 |
Added in version 243\&. |
| 213 |
.RE |
| 214 |
.PP |
| 215 |
\fB\-\-subsystem\-match\fR\fB[=SUBSYSTEM]\fR, \fB\-\-subsystem\-nomatch\fR\fB[=SUBSYSTEM]\fR |
| 216 |
.RS 4 |
| 217 |
When used with |
| 218 |
\fB\-\-export\-db\fR, only show devices of or not of the given subsystem respectively\&. |
| 219 |
.sp |
| 220 |
Added in version 255\&. |
| 221 |
.RE |
| 222 |
.PP |
| 223 |
\fB\-\-attr\-match\fR\fB[=FILE[=VALUE]]\fR, \fB\-\-attr\-nomatch\fR\fB[=FILE[=VALUE]]\fR |
| 224 |
.RS 4 |
| 225 |
When used with |
| 226 |
\fB\-\-export\-db\fR, only show devices matching or not matching the given attribute respectively\&. |
| 227 |
.sp |
| 228 |
Added in version 255\&. |
| 229 |
.RE |
| 230 |
.PP |
| 231 |
\fB\-\-property\-match\fR\fB[=KEY=VALUE]\fR |
| 232 |
.RS 4 |
| 233 |
When used with |
| 234 |
\fB\-\-export\-db\fR, only show devices matching the given property and value\&. |
| 235 |
.sp |
| 236 |
Added in version 255\&. |
| 237 |
.RE |
| 238 |
.PP |
| 239 |
\fB\-\-tag\-match\fR\fB[=TAG]\fR |
| 240 |
.RS 4 |
| 241 |
When used with |
| 242 |
\fB\-\-export\-db\fR, only show devices with the given tag\&. |
| 243 |
.sp |
| 244 |
Added in version 255\&. |
| 245 |
.RE |
| 246 |
.PP |
| 247 |
\fB\-\-sysname\-match\fR\fB[=NAME]\fR |
| 248 |
.RS 4 |
| 249 |
When used with |
| 250 |
\fB\-\-export\-db\fR, only show devices with the given |
| 251 |
"/sys" |
| 252 |
path\&. |
| 253 |
.sp |
| 254 |
Added in version 255\&. |
| 255 |
.RE |
| 256 |
.PP |
| 257 |
\fB\-\-name\-match\fR\fB[=NAME]\fR |
| 258 |
.RS 4 |
| 259 |
When used with |
| 260 |
\fB\-\-export\-db\fR, only show devices with the given name in |
| 261 |
"/dev"\&. |
| 262 |
.sp |
| 263 |
Added in version 255\&. |
| 264 |
.RE |
| 265 |
.PP |
| 266 |
\fB\-\-parent\-match\fR\fB[=NAME]\fR |
| 267 |
.RS 4 |
| 268 |
When used with |
| 269 |
\fB\-\-export\-db\fR, only show devices with the given parent device\&. |
| 270 |
.sp |
| 271 |
Added in version 255\&. |
| 272 |
.RE |
| 273 |
.PP |
| 274 |
\fB\-\-initialized\-match\fR, \fB\-\-initialized\-nomatch\fR |
| 275 |
.RS 4 |
| 276 |
When used with |
| 277 |
\fB\-\-export\-db\fR, only show devices that are initialized or not initialized respectively\&. |
| 278 |
.sp |
| 279 |
Added in version 255\&. |
| 280 |
.RE |
| 281 |
.PP |
| 282 |
\fB\-\-json=\fR\fB\fIMODE\fR\fR |
| 283 |
.RS 4 |
| 284 |
Shows output formatted as JSON\&. Expects one of |
| 285 |
"short" |
| 286 |
(for the shortest possible output without any redundant whitespace or line breaks), |
| 287 |
"pretty" |
| 288 |
(for a pretty version of the same, with indentation and line breaks) or |
| 289 |
"off" |
| 290 |
(to turn off JSON output, the default)\&. |
| 291 |
.RE |
| 292 |
.PP |
| 293 |
\fB\-\-no\-pager\fR |
| 294 |
.RS 4 |
| 295 |
Do not pipe output into a pager\&. |
| 296 |
.RE |
| 297 |
.PP |
| 298 |
The generated output shows the current device database entry in a terse format\&. Each line shown is prefixed with one of the following characters: |
| 299 |
.sp |
| 300 |
.it 1 an-trap |
| 301 |
.nr an-no-space-flag 1 |
| 302 |
.nr an-break-flag 1 |
| 303 |
.br |
| 304 |
.B Table\ \&1.\ \&udevadm info output prefixes |
| 305 |
.TS |
| 306 |
allbox tab(:); |
| 307 |
lB lB. |
| 308 |
T{ |
| 309 |
Prefix |
| 310 |
T}:T{ |
| 311 |
Meaning |
| 312 |
T} |
| 313 |
.T& |
| 314 |
l l |
| 315 |
l l |
| 316 |
l l |
| 317 |
l l |
| 318 |
l l |
| 319 |
l l |
| 320 |
l l |
| 321 |
l l |
| 322 |
l l |
| 323 |
l l |
| 324 |
l l |
| 325 |
l l |
| 326 |
l l |
| 327 |
l l |
| 328 |
l l. |
| 329 |
T{ |
| 330 |
"P:" |
| 331 |
T}:T{ |
| 332 |
Device path in /sys/ |
| 333 |
T} |
| 334 |
T{ |
| 335 |
"M:" |
| 336 |
T}:T{ |
| 337 |
Device name in /sys/ (i\&.e\&. the last component of "P:") |
| 338 |
T} |
| 339 |
T{ |
| 340 |
"R:" |
| 341 |
T}:T{ |
| 342 |
Device number in /sys/ (i\&.e\&. the numeric suffix of the last component of "P:") |
| 343 |
T} |
| 344 |
T{ |
| 345 |
"J:" |
| 346 |
T}:T{ |
| 347 |
Device ID |
| 348 |
T} |
| 349 |
T{ |
| 350 |
"U:" |
| 351 |
T}:T{ |
| 352 |
Kernel subsystem |
| 353 |
T} |
| 354 |
T{ |
| 355 |
"B:" |
| 356 |
T}:T{ |
| 357 |
Driver subsystem |
| 358 |
T} |
| 359 |
T{ |
| 360 |
"T:" |
| 361 |
T}:T{ |
| 362 |
Kernel device type within subsystem |
| 363 |
T} |
| 364 |
T{ |
| 365 |
"D:" |
| 366 |
T}:T{ |
| 367 |
Kernel device node major/minor |
| 368 |
T} |
| 369 |
T{ |
| 370 |
"I:" |
| 371 |
T}:T{ |
| 372 |
Network interface index |
| 373 |
T} |
| 374 |
T{ |
| 375 |
"N:" |
| 376 |
T}:T{ |
| 377 |
Kernel device node name |
| 378 |
T} |
| 379 |
T{ |
| 380 |
"L:" |
| 381 |
T}:T{ |
| 382 |
Device node symlink priority |
| 383 |
T} |
| 384 |
T{ |
| 385 |
"S:" |
| 386 |
T}:T{ |
| 387 |
Device node symlink |
| 388 |
T} |
| 389 |
T{ |
| 390 |
"Q:" |
| 391 |
T}:T{ |
| 392 |
Block device sequence number (DISKSEQ) |
| 393 |
T} |
| 394 |
T{ |
| 395 |
"V:" |
| 396 |
T}:T{ |
| 397 |
Attached driver |
| 398 |
T} |
| 399 |
T{ |
| 400 |
"E:" |
| 401 |
T}:T{ |
| 402 |
Device property |
| 403 |
T} |
| 404 |
.TE |
| 405 |
.sp 1 |
| 406 |
.SS "udevadm trigger [\fIoptions\fR\&...] [\fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR\&...]" |
| 407 |
.PP |
| 408 |
Request device events from the kernel\&. Primarily used to replay events at system coldplug time\&. |
| 409 |
.PP |
| 410 |
Takes device specifications as positional arguments\&. See the description of |
| 411 |
\fBudevadm info\fR |
| 412 |
above\&. |
| 413 |
.PP |
| 414 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 415 |
.RS 4 |
| 416 |
Print the list of devices which will be triggered\&. |
| 417 |
.RE |
| 418 |
.PP |
| 419 |
\fB\-n\fR, \fB\-\-dry\-run\fR |
| 420 |
.RS 4 |
| 421 |
Do not actually trigger the event\&. |
| 422 |
.RE |
| 423 |
.PP |
| 424 |
\fB\-q\fR, \fB\-\-quiet\fR |
| 425 |
.RS 4 |
| 426 |
Suppress error logging in triggering events\&. |
| 427 |
.sp |
| 428 |
Added in version 248\&. |
| 429 |
.RE |
| 430 |
.PP |
| 431 |
\fB\-t\fR, \fB\-\-type=\fR\fB\fITYPE\fR\fR |
| 432 |
.RS 4 |
| 433 |
Trigger a specific type of devices\&. Valid types are |
| 434 |
"all", |
| 435 |
"devices", and |
| 436 |
"subsystems"\&. The default value is |
| 437 |
"devices"\&. |
| 438 |
.RE |
| 439 |
.PP |
| 440 |
\fB\-c\fR, \fB\-\-action=\fR\fB\fIACTION\fR\fR |
| 441 |
.RS 4 |
| 442 |
Type of event to be triggered\&. Possible actions are |
| 443 |
"add", |
| 444 |
"remove", |
| 445 |
"change", |
| 446 |
"move", |
| 447 |
"online", |
| 448 |
"offline", |
| 449 |
"bind", and |
| 450 |
"unbind"\&. Also, the special value |
| 451 |
"help" |
| 452 |
can be used to list the possible actions\&. The default value is |
| 453 |
"change"\&. |
| 454 |
.RE |
| 455 |
.PP |
| 456 |
\fB\-\-prioritized\-subsystem=\fR\fB\fISUBSYSTEM\fR\fI[,\fISUBSYSTEM\fR\&...]\fR\fR |
| 457 |
.RS 4 |
| 458 |
Takes a comma separated list of subsystems\&. When triggering events for devices, the devices from the specified subsystems and their parents are triggered first\&. For example, if |
| 459 |
\fB\-\-prioritized\-subsystem=block,net\fR, then firstly all block devices and their parents are triggered, in the next all network devices and their parents are triggered, and lastly the other devices are triggered\&. This option can be specified multiple times, and in that case the lists of the subsystems will be merged\&. That is, |
| 460 |
\fB\-\-prioritized\-subsystem=block \-\-prioritized\-subsystem=net\fR |
| 461 |
is equivalent to |
| 462 |
\fB\-\-prioritized\-subsystem=block,net\fR\&. |
| 463 |
.sp |
| 464 |
Added in version 251\&. |
| 465 |
.RE |
| 466 |
.PP |
| 467 |
\fB\-s\fR, \fB\-\-subsystem\-match=\fR\fB\fISUBSYSTEM\fR\fR |
| 468 |
.RS 4 |
| 469 |
Trigger events for devices which belong to a matching subsystem\&. This option supports shell style pattern matching\&. When this option is specified more than once, then each matching result is ORed, that is, all the devices in each subsystem are triggered\&. |
| 470 |
.RE |
| 471 |
.PP |
| 472 |
\fB\-S\fR, \fB\-\-subsystem\-nomatch=\fR\fB\fISUBSYSTEM\fR\fR |
| 473 |
.RS 4 |
| 474 |
Do not trigger events for devices which belong to a matching subsystem\&. This option supports shell style pattern matching\&. When this option is specified more than once, then each matching result is ANDed, that is, devices which do not match all specified subsystems are triggered\&. |
| 475 |
.RE |
| 476 |
.PP |
| 477 |
\fB\-a\fR, \fB\-\-attr\-match=\fR\fB\fIATTRIBUTE\fR\fR\fB=\fR\fB\fIVALUE\fR\fR |
| 478 |
.RS 4 |
| 479 |
Trigger events for devices with a matching sysfs attribute\&. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\&. If no value is specified, the existence of the sysfs attribute is checked\&. When this option is specified multiple times, then each matching result is ANDed, that is, only devices which have all specified attributes are triggered\&. |
| 480 |
.RE |
| 481 |
.PP |
| 482 |
\fB\-A\fR, \fB\-\-attr\-nomatch=\fR\fB\fIATTRIBUTE\fR\fR\fB=\fR\fB\fIVALUE\fR\fR |
| 483 |
.RS 4 |
| 484 |
Do not trigger events for devices with a matching sysfs attribute\&. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\&. If no value is specified, the existence of the sysfs attribute is checked\&. When this option is specified multiple times, then each matching result is ANDed, that is, only devices which have none of the specified attributes are triggered\&. |
| 485 |
.RE |
| 486 |
.PP |
| 487 |
\fB\-p\fR, \fB\-\-property\-match=\fR\fB\fIPROPERTY\fR\fR\fB=\fR\fB\fIVALUE\fR\fR |
| 488 |
.RS 4 |
| 489 |
Trigger events for devices with a matching property value\&. This option supports shell style pattern matching\&. When this option is specified more than once, then each matching result is ORed, that is, devices which have one of the specified properties are triggered\&. |
| 490 |
.RE |
| 491 |
.PP |
| 492 |
\fB\-g\fR, \fB\-\-tag\-match=\fR\fB\fITAG\fR\fR |
| 493 |
.RS 4 |
| 494 |
Trigger events for devices with a matching tag\&. When this option is specified multiple times, then each matching result is ANDed, that is, devices which have all specified tags are triggered\&. |
| 495 |
.RE |
| 496 |
.PP |
| 497 |
\fB\-y\fR, \fB\-\-sysname\-match=\fR\fB\fINAME\fR\fR |
| 498 |
.RS 4 |
| 499 |
Trigger events for devices for which the last component (i\&.e\&. the filename) of the |
| 500 |
/sys/ |
| 501 |
path matches the specified |
| 502 |
\fIPATH\fR\&. This option supports shell style pattern matching\&. When this option is specified more than once, then each matching result is ORed, that is, all devices which have any of the specified |
| 503 |
\fINAME\fR |
| 504 |
are triggered\&. |
| 505 |
.RE |
| 506 |
.PP |
| 507 |
\fB\-\-name\-match=\fR\fB\fINAME\fR\fR |
| 508 |
.RS 4 |
| 509 |
Trigger events for devices with a matching device path\&. When this option is specified more than once, then each matching result is ORed, that is, all specified devices are triggered\&. |
| 510 |
.sp |
| 511 |
Added in version 218\&. |
| 512 |
.RE |
| 513 |
.PP |
| 514 |
\fB\-b\fR, \fB\-\-parent\-match=\fR\fB\fISYSPATH\fR\fR |
| 515 |
.RS 4 |
| 516 |
Trigger events for all children of a given device\&. When this option is specified more than once, then each matching result is ORed, that is, all children of each specified device are triggered\&. |
| 517 |
.RE |
| 518 |
.PP |
| 519 |
\fB\-\-initialized\-match\fR, \fB\-\-initialized\-nomatch\fR |
| 520 |
.RS 4 |
| 521 |
When |
| 522 |
\fB\-\-initialized\-match\fR |
| 523 |
is specified, trigger events for devices that are already initialized by |
| 524 |
\fBsystemd\-udevd\fR, and skip devices that are not initialized yet\&. |
| 525 |
.sp |
| 526 |
When |
| 527 |
\fB\-\-initialized\-nomatch\fR |
| 528 |
is specified, trigger events for devices that are not initialized by |
| 529 |
\fBsystemd\-udevd\fR |
| 530 |
yet, and skip devices that are already initialized\&. |
| 531 |
.sp |
| 532 |
Typically, it is essential that applications which intend to use such a match, make sure a suitable udev rule is installed that sets at least one property on devices that shall be matched\&. See also Initialized Devices section below for more details\&. |
| 533 |
.if n \{\ |
| 534 |
.sp |
| 535 |
.\} |
| 536 |
.RS 4 |
| 537 |
.it 1 an-trap |
| 538 |
.nr an-no-space-flag 1 |
| 539 |
.nr an-break-flag 1 |
| 540 |
.br |
| 541 |
.ps +1 |
| 542 |
\fBWarning\fR |
| 543 |
.ps -1 |
| 544 |
.br |
| 545 |
\fB\-\-initialized\-nomatch\fR |
| 546 |
can potentially save a significant amount of time compared to re\-triggering all devices in the system and e\&.g\&. can be used to optimize boot time\&. However, this is not safe to be used in a boot sequence in general\&. Especially, when udev rules for a device depend on its parent devices (e\&.g\&. |
| 547 |
"ATTRS" |
| 548 |
or |
| 549 |
"IMPORT{parent}" |
| 550 |
keys, see |
| 551 |
\fBudev\fR(7) |
| 552 |
for more details), the final state of the device becomes easily unstable with this option\&. |
| 553 |
.sp .5v |
| 554 |
.RE |
| 555 |
Added in version 251\&. |
| 556 |
.RE |
| 557 |
.PP |
| 558 |
\fB\-\-include\-parents\fR |
| 559 |
.RS 4 |
| 560 |
Trigger parent devices of found devices even if the parents will not match the filter condition\&. This is useful if we are interested to limit the coldplug activities to some devices or subsystems\&. |
| 561 |
.sp |
| 562 |
Added in version 258\&. |
| 563 |
.RE |
| 564 |
.PP |
| 565 |
\fB\-w\fR, \fB\-\-settle\fR |
| 566 |
.RS 4 |
| 567 |
Apart from triggering events, also waits for those events to finish\&. Note that this is different from calling |
| 568 |
\fBudevadm settle\fR\&. |
| 569 |
\fBudevadm settle\fR |
| 570 |
waits for all events to finish\&. This option only waits for events triggered by the same command to finish\&. |
| 571 |
.sp |
| 572 |
Added in version 238\&. |
| 573 |
.RE |
| 574 |
.PP |
| 575 |
\fB\-\-uuid\fR |
| 576 |
.RS 4 |
| 577 |
Trigger the synthetic device events, and associate a randomized UUID with each\&. These UUIDs are printed to standard output, one line for each event\&. These UUIDs are included in the uevent environment block (in the |
| 578 |
"SYNTH_UUID=" |
| 579 |
property) and may be used to track delivery of the generated events\&. |
| 580 |
.sp |
| 581 |
Added in version 249\&. |
| 582 |
.RE |
| 583 |
.PP |
| 584 |
\fB\-\-wait\-daemon[=\fR\fB\fISECONDS\fR\fR\fB]\fR |
| 585 |
.RS 4 |
| 586 |
Before triggering uevents, wait for systemd\-udevd daemon to be initialized\&. Optionally takes timeout value\&. Default timeout is 5 seconds\&. This is equivalent to invoking |
| 587 |
\fBudevadm control \-\-ping\fR |
| 588 |
before |
| 589 |
\fBudevadm trigger\fR\&. |
| 590 |
.sp |
| 591 |
Added in version 241\&. |
| 592 |
.RE |
| 593 |
.PP |
| 594 |
In addition, optional positional arguments can be used to specify device names or sys paths\&. They must start with |
| 595 |
/dev/ |
| 596 |
or |
| 597 |
/sys/ |
| 598 |
respectively\&. |
| 599 |
.SS "udevadm settle [\fIoptions\fR\&...]" |
| 600 |
.PP |
| 601 |
Watches the udev event queue, and exits if all current events are handled\&. |
| 602 |
.PP |
| 603 |
\fB\-t\fR, \fB\-\-timeout=\fR\fB\fISECONDS\fR\fR |
| 604 |
.RS 4 |
| 605 |
Maximum number of seconds to wait for the event queue to become empty\&. The default value is 120 seconds\&. A value of 0 will check if the queue is empty and always return immediately\&. A non\-zero value will return an exit code of 0 if queue became empty before timeout was reached, non\-zero otherwise\&. |
| 606 |
.RE |
| 607 |
.PP |
| 608 |
\fB\-E\fR, \fB\-\-exit\-if\-exists=\fR\fB\fIFILE\fR\fR |
| 609 |
.RS 4 |
| 610 |
Stop waiting if file exists\&. |
| 611 |
.RE |
| 612 |
.PP |
| 613 |
See |
| 614 |
\fBsystemd-udev-settle.service\fR(8) |
| 615 |
for more information\&. |
| 616 |
.SS "udevadm control \fIoptions\fR\&..." |
| 617 |
.PP |
| 618 |
Modify the internal state of the running udev daemon\&. |
| 619 |
.PP |
| 620 |
\fB\-e\fR, \fB\-\-exit\fR |
| 621 |
.RS 4 |
| 622 |
Signal and wait for systemd\-udevd to exit\&. No option except for |
| 623 |
\fB\-\-timeout\fR |
| 624 |
can be specified after this option\&. Note that |
| 625 |
systemd\-udevd\&.service |
| 626 |
contains |
| 627 |
\fBRestart=always\fR |
| 628 |
and so as a result, this option restarts systemd\-udevd\&. If you want to stop |
| 629 |
systemd\-udevd\&.service, please use the following: |
| 630 |
.sp |
| 631 |
.if n \{\ |
| 632 |
.RS 4 |
| 633 |
.\} |
| 634 |
.nf |
| 635 |
systemctl stop systemd\-udevd\-control\&.socket systemd\-udevd\-kernel\&.socket systemd\-udevd\-varlink\&.socket systemd\-udevd\&.service |
| 636 |
.fi |
| 637 |
.if n \{\ |
| 638 |
.RE |
| 639 |
.\} |
| 640 |
.sp |
| 641 |
.RE |
| 642 |
.PP |
| 643 |
\fB\-l\fR, \fB\-\-log\-level=\fR\fB\fIvalue\fR\fR |
| 644 |
.RS 4 |
| 645 |
Set the internal log level of |
| 646 |
systemd\-udevd\&. Valid values are the numerical syslog priorities or their textual representations: |
| 647 |
\fBemerg\fR, |
| 648 |
\fBalert\fR, |
| 649 |
\fBcrit\fR, |
| 650 |
\fBerr\fR, |
| 651 |
\fBwarning\fR, |
| 652 |
\fBnotice\fR, |
| 653 |
\fBinfo\fR, and |
| 654 |
\fBdebug\fR\&. |
| 655 |
.RE |
| 656 |
.PP |
| 657 |
\fB\-s\fR, \fB\-\-stop\-exec\-queue\fR |
| 658 |
.RS 4 |
| 659 |
Signal systemd\-udevd to stop executing new events\&. Incoming events will be queued\&. |
| 660 |
.RE |
| 661 |
.PP |
| 662 |
\fB\-S\fR, \fB\-\-start\-exec\-queue\fR |
| 663 |
.RS 4 |
| 664 |
Signal systemd\-udevd to enable the execution of events\&. |
| 665 |
.RE |
| 666 |
.PP |
| 667 |
\fB\-R\fR, \fB\-\-reload\fR |
| 668 |
.RS 4 |
| 669 |
Signal systemd\-udevd to reload the rules files and other databases like the kernel module index\&. Reloading rules and databases does not apply any changes to already existing devices; the new configuration will only be applied to new events\&. |
| 670 |
.RE |
| 671 |
.PP |
| 672 |
\fB\-p\fR, \fB\-\-property=\fR\fB\fIKEY\fR\fR\fB=\fR\fB\fIvalue\fR\fR |
| 673 |
.RS 4 |
| 674 |
Set a global property for all events\&. |
| 675 |
.RE |
| 676 |
.PP |
| 677 |
\fB\-m\fR, \fB\-\-children\-max=\fR\fB\fIvalue\fR\fR |
| 678 |
.RS 4 |
| 679 |
Set the maximum number of events, systemd\-udevd will handle at the same time\&. When 0 is specified, then the maximum is determined based on the system resources\&. |
| 680 |
.RE |
| 681 |
.PP |
| 682 |
\fB\-\-ping\fR |
| 683 |
.RS 4 |
| 684 |
Send a ping message to systemd\-udevd and wait for the reply\&. This may be useful to check that systemd\-udevd daemon is running\&. |
| 685 |
.sp |
| 686 |
Added in version 241\&. |
| 687 |
.RE |
| 688 |
.PP |
| 689 |
\fB\-\-trace=\fR\fB\fIBOOL\fR\fR |
| 690 |
.RS 4 |
| 691 |
Enable/disable trace logging in |
| 692 |
\fBsystemd\-udevd\fR\&. |
| 693 |
.sp |
| 694 |
Added in version 258\&. |
| 695 |
.RE |
| 696 |
.PP |
| 697 |
\fB\-\-revert\fR |
| 698 |
.RS 4 |
| 699 |
Revert settings previously set with |
| 700 |
\fBudevadm control\fR |
| 701 |
command\&. When specified, settings set with |
| 702 |
\fB\-l/\-\-log\-level=\fR, |
| 703 |
\fB\-\-trace\fR, |
| 704 |
\fB\-m/\-\-children\-max=\fR, and |
| 705 |
\fB\-p/\-\-property=\fR |
| 706 |
will be cleared\&. |
| 707 |
.sp |
| 708 |
Added in version 258\&. |
| 709 |
.RE |
| 710 |
.PP |
| 711 |
\fB\-t\fR, \fB\-\-timeout=\fR\fB\fIseconds\fR\fR |
| 712 |
.RS 4 |
| 713 |
The maximum number of seconds to wait for a reply from systemd\-udevd\&. |
| 714 |
.RE |
| 715 |
.PP |
| 716 |
\fB\-\-load\-credentials\fR |
| 717 |
.RS 4 |
| 718 |
When specified, the following credentials are used when passed in: |
| 719 |
.PP |
| 720 |
\fIudev\&.conf\&.*\fR |
| 721 |
.RS 4 |
| 722 |
These credentials should contain valid |
| 723 |
\fBudev.conf\fR(5) |
| 724 |
configuration data\&. From each matching credential a separate file is created\&. Example: a passed credential |
| 725 |
udev\&.conf\&.50\-foobar |
| 726 |
will be copied into a configuration file |
| 727 |
/run/udev/udev\&.conf\&.d/50\-foobar\&.conf\&. |
| 728 |
.sp |
| 729 |
Added in version 256\&. |
| 730 |
.RE |
| 731 |
.PP |
| 732 |
\fIudev\&.rules\&.*\fR |
| 733 |
.RS 4 |
| 734 |
These credentials should contain valid |
| 735 |
\fBudev\fR(7) |
| 736 |
rules\&. From each matching credential a separate file is created\&. Example: a passed credential |
| 737 |
udev\&.rules\&.50\-foobar |
| 738 |
will be copied into a configuration file |
| 739 |
/run/udev/rules\&.d/50\-foobar\&.rules\&. |
| 740 |
.sp |
| 741 |
Added in version 256\&. |
| 742 |
.RE |
| 743 |
.sp |
| 744 |
Note, this |
| 745 |
\fIdoes not\fR |
| 746 |
imply |
| 747 |
\fB\-\-reload\fR |
| 748 |
option\&. So, if |
| 749 |
\fBsystemd\-udevd\fR |
| 750 |
is already running, please consider to also specify |
| 751 |
\fB\-reload\fR |
| 752 |
to make the copied udev rules files used by |
| 753 |
\fBsystemd\-udevd\fR\&. |
| 754 |
.sp |
| 755 |
Added in version 256\&. |
| 756 |
.RE |
| 757 |
.SS "udevadm monitor [\fIoptions\fR\&...]" |
| 758 |
.PP |
| 759 |
Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console\&. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event\&. |
| 760 |
.PP |
| 761 |
\fB\-k\fR, \fB\-\-kernel\fR |
| 762 |
.RS 4 |
| 763 |
Print the kernel uevents\&. |
| 764 |
.RE |
| 765 |
.PP |
| 766 |
\fB\-u\fR, \fB\-\-udev\fR |
| 767 |
.RS 4 |
| 768 |
Print the udev event after the rule processing\&. |
| 769 |
.RE |
| 770 |
.PP |
| 771 |
\fB\-p\fR, \fB\-\-property\fR |
| 772 |
.RS 4 |
| 773 |
Also print the properties of the event\&. |
| 774 |
.RE |
| 775 |
.PP |
| 776 |
\fB\-s\fR, \fB\-\-subsystem\-match=\fR\fB\fIstring[/string]\fR\fR |
| 777 |
.RS 4 |
| 778 |
Filter kernel uevents and udev events by subsystem[/devtype]\&. Only events with a matching subsystem value will pass\&. When this option is specified more than once, then each matching result is ORed, that is, all devices in the specified subsystems are monitored\&. |
| 779 |
.RE |
| 780 |
.PP |
| 781 |
\fB\-t\fR, \fB\-\-tag\-match=\fR\fB\fIstring\fR\fR |
| 782 |
.RS 4 |
| 783 |
Filter udev events by tag\&. Only udev events with a given tag attached will pass\&. When this option is specified more than once, then each matching result is ORed, that is, devices which have one of the specified tags are monitored\&. |
| 784 |
.RE |
| 785 |
.SS "udevadm test [\fIoptions\fR\&...] \fIdevpath\fR|\fIsyspath\fR|\fIid\fR|\fIunit\fR" |
| 786 |
.PP |
| 787 |
Simulate a udev event run for the given device, and print debug output\&. The option |
| 788 |
\fB\-\-json=\fR |
| 789 |
may be useful for parsing the final result\&. See also Example section\&. |
| 790 |
.PP |
| 791 |
\fB\-a\fR, \fB\-\-action=\fR\fB\fIACTION\fR\fR |
| 792 |
.RS 4 |
| 793 |
Type of event to be simulated\&. Possible actions are |
| 794 |
"add", |
| 795 |
"remove", |
| 796 |
"change", |
| 797 |
"move", |
| 798 |
"online", |
| 799 |
"offline", |
| 800 |
"bind", and |
| 801 |
"unbind"\&. Also, the special value |
| 802 |
"help" |
| 803 |
can be used to list the possible actions\&. The default value is |
| 804 |
"add"\&. |
| 805 |
.RE |
| 806 |
.PP |
| 807 |
\fB\-N\fR, \fB\-\-resolve\-names=\fR\fB\fBearly\fR\fR\fB|\fR\fB\fBlate\fR\fR\fB|\fR\fB\fBnever\fR\fR |
| 808 |
.RS 4 |
| 809 |
Specify when |
| 810 |
\fBudevadm\fR |
| 811 |
should resolve names of users and groups specified in udev rules\&. When set to |
| 812 |
\fBearly\fR |
| 813 |
(the default), names will be resolved when the rules are parsed\&. When set to |
| 814 |
\fBlate\fR, names will be resolved during the event being processed\&. When set to |
| 815 |
\fBnever\fR, names will never be resolved and relevant udev rules will be ignored\&. |
| 816 |
.sp |
| 817 |
Added in version 209\&. |
| 818 |
.RE |
| 819 |
.PP |
| 820 |
\fB\-D \fR\fB\fIDIR\fR\fR, \fB\-\-extra\-rules\-dir=\fR\fB\fIDIR\fR\fR |
| 821 |
.RS 4 |
| 822 |
Also load udev rules files from the specified directory\&. This option can be specified multiple times\&. It may be useful for debugging udev rules by copying some udev rules files to a temporary directory, editing them, and specifying the directory with this option\&. Files found in the specified directories have a higher priority than rules files in the default |
| 823 |
udev/rules\&.d |
| 824 |
directories used by |
| 825 |
\fBsystemd\-udevd\fR\&. See |
| 826 |
\fBudev\fR(7) |
| 827 |
for more details about the search paths\&. |
| 828 |
.sp |
| 829 |
Added in version 258\&. |
| 830 |
.RE |
| 831 |
.PP |
| 832 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 833 |
.RS 4 |
| 834 |
Shows verbose logs in processing udev rules\&. |
| 835 |
.sp |
| 836 |
Added in version 258\&. |
| 837 |
.RE |
| 838 |
.PP |
| 839 |
\fB\-\-json=\fR\fB\fIMODE\fR\fR |
| 840 |
.RS 4 |
| 841 |
Shows output formatted as JSON\&. Expects one of |
| 842 |
"short" |
| 843 |
(for the shortest possible output without any redundant whitespace or line breaks), |
| 844 |
"pretty" |
| 845 |
(for a pretty version of the same, with indentation and line breaks) or |
| 846 |
"off" |
| 847 |
(to turn off JSON output, the default)\&. |
| 848 |
.RE |
| 849 |
.SS "udevadm test\-builtin [\fIoptions\fR\&...] \fIcommand\fR \fIdevpath\fR|\fIfile\fR|\fIunit\fR" |
| 850 |
.PP |
| 851 |
Run a built\-in command |
| 852 |
\fICOMMAND\fR |
| 853 |
for device |
| 854 |
\fIDEVPATH\fR, and print debug output\&. |
| 855 |
.PP |
| 856 |
\fB\-a\fR, \fB\-\-action=\fR\fB\fIACTION\fR\fR |
| 857 |
.RS 4 |
| 858 |
Type of event to be simulated\&. Possible actions are |
| 859 |
"add", |
| 860 |
"remove", |
| 861 |
"change", |
| 862 |
"move", |
| 863 |
"online", |
| 864 |
"offline", |
| 865 |
"bind", and |
| 866 |
"unbind"\&. Also, the special value |
| 867 |
"help" |
| 868 |
can be used to list the possible actions\&. The default value is |
| 869 |
"add"\&. |
| 870 |
.sp |
| 871 |
Added in version 250\&. |
| 872 |
.RE |
| 873 |
.SS "udevadm verify [\fIoptions\fR\&...] [\fIfiles\fR\&...]" |
| 874 |
.PP |
| 875 |
Verify syntactic, semantic, and stylistic correctness of udev rules files\&. |
| 876 |
.PP |
| 877 |
Positional arguments can be used to specify one or more files to check\&. Each argument must be an absolute path to a udev rules file or a directory that contains rules files, or a file name of udev rules file (e\&.g\&. |
| 878 |
99\-systemd\&.rules)\&. If a file name is specified, the file will be searched in the |
| 879 |
udev/rules\&.d |
| 880 |
directories that are processed by |
| 881 |
\fBsystemd\-udevd\fR, and searched in the current working directory if not found\&. If no files are specified, the udev rules are read from the files located in the same |
| 882 |
udev/rules\&.d |
| 883 |
directories that are processed by |
| 884 |
\fBsystemd\-udevd\fR\&. See |
| 885 |
\fBudev\fR(7) |
| 886 |
for more details about the search paths\&. |
| 887 |
.PP |
| 888 |
The exit status is |
| 889 |
\fB0\fR |
| 890 |
if all specified udev rules files are syntactically, semantically, and stylistically correct, and a non\-zero error code otherwise\&. |
| 891 |
.PP |
| 892 |
\fB\-N\fR, \fB\-\-resolve\-names=\fR\fB\fBearly\fR\fR\fB|\fR\fB\fBlate\fR\fR\fB|\fR\fB\fBnever\fR\fR |
| 893 |
.RS 4 |
| 894 |
Specify when |
| 895 |
\fBudevadm\fR |
| 896 |
should resolve names of users and groups specified in udev rules\&. When set to |
| 897 |
\fBearly\fR |
| 898 |
(the default), names will be resolved when the rules are parsed\&. When set to |
| 899 |
\fBlate\fR, names will not be verified, as |
| 900 |
\fBsystemd\-udevd\fR |
| 901 |
resolves names during each event being processed\&. When set to |
| 902 |
\fBnever\fR, names will never be resolved and relevant rules will be ignored\&. |
| 903 |
.sp |
| 904 |
Added in version 254\&. |
| 905 |
.RE |
| 906 |
.PP |
| 907 |
\fB\-\-root=\fR\fB\fIPATH\fR\fR |
| 908 |
.RS 4 |
| 909 |
When looking for udev rules files located in the |
| 910 |
udev/rules\&.d |
| 911 |
directories, operate on files underneath the specified root path |
| 912 |
\fIPATH\fR\&. When a file name is specified, and it is not found in the |
| 913 |
udev/rules\&.d |
| 914 |
directories, the file will be searched in the specified root path |
| 915 |
\fIPATH\fR, rather than the current working directory\&. |
| 916 |
.sp |
| 917 |
Added in version 254\&. |
| 918 |
.RE |
| 919 |
.PP |
| 920 |
\fB\-\-no\-summary\fR |
| 921 |
.RS 4 |
| 922 |
Do not show summary\&. |
| 923 |
.sp |
| 924 |
Added in version 254\&. |
| 925 |
.RE |
| 926 |
.PP |
| 927 |
\fB\-\-no\-style\fR |
| 928 |
.RS 4 |
| 929 |
Ignore style issues\&. When specified, even if style issues are found in udev rules files, the exit status is |
| 930 |
\fB0\fR |
| 931 |
if no syntactic or semantic errors are found\&. |
| 932 |
.sp |
| 933 |
Added in version 254\&. |
| 934 |
.RE |
| 935 |
.SS "udevadm cat [\fIoptions\fR\&...] [\fIfile\fR\&...]" |
| 936 |
.PP |
| 937 |
Show udev rules files or udev\&.conf\&. |
| 938 |
.PP |
| 939 |
Positional arguments can be used to specify one or more files to show\&. Each argument must be an absolute path to a udev rules file or a directory that contains rules files, or a file name of udev rules file (e\&.g\&. |
| 940 |
99\-systemd\&.rules)\&. If a file name is specified, the file will be searched in the |
| 941 |
udev/rules\&.d |
| 942 |
directories that are processed by |
| 943 |
\fBsystemd\-udevd\fR, and searched in the current working directory if not found\&. If no files are specified, the udev rules are read from the files located in the same |
| 944 |
udev/rules\&.d |
| 945 |
directories that are processed by |
| 946 |
\fBsystemd\-udevd\fR\&. See |
| 947 |
\fBudev\fR(7) |
| 948 |
for more details about the search paths\&. |
| 949 |
.PP |
| 950 |
\fB\-\-root=\fR\fB\fIPATH\fR\fR |
| 951 |
.RS 4 |
| 952 |
When looking for udev rules files located in the |
| 953 |
udev/rules\&.d |
| 954 |
directories, operate on files underneath the specified root path |
| 955 |
\fIPATH\fR\&. When a file name is specified, and it is not found in the |
| 956 |
udev/rules\&.d |
| 957 |
directories, the file will be searched in the specified root path |
| 958 |
\fIPATH\fR, rather than the current working directory\&. |
| 959 |
.sp |
| 960 |
Added in version 258\&. |
| 961 |
.RE |
| 962 |
.PP |
| 963 |
\fB\-\-tldr\fR |
| 964 |
.RS 4 |
| 965 |
Only print the "interesting" parts of the configuration files, skipping comments and empty lines and section headers followed only by comments and empty lines\&. |
| 966 |
.sp |
| 967 |
Added in version 258\&. |
| 968 |
.RE |
| 969 |
.PP |
| 970 |
\fB\-\-config\fR |
| 971 |
.RS 4 |
| 972 |
Shows |
| 973 |
\fBudev.conf\fR(5) |
| 974 |
files, rather than udev rules files\&. When specified, no udev rules file cannot be specified\&. |
| 975 |
.sp |
| 976 |
Added in version 258\&. |
| 977 |
.RE |
| 978 |
.SS "udevadm wait [\fIoptions\fR\&...] \fIdevpath|syspath\fR\&..." |
| 979 |
.PP |
| 980 |
Wait for devices or device symlinks being created and initialized by |
| 981 |
\fBsystemd\-udevd\fR\&. Each device path must start with |
| 982 |
"/dev/" |
| 983 |
or |
| 984 |
"/sys/", e\&.g\&. |
| 985 |
"/dev/sda", |
| 986 |
"/dev/disk/by\-path/pci\-0000:3c:00\&.0\-nvme\-1\-part1", |
| 987 |
"/sys/devices/pci0000:00/0000:00:1f\&.6/net/eth0", or |
| 988 |
"/sys/class/net/eth0"\&. This can take multiple devices\&. This may be useful for waiting for devices being processed by |
| 989 |
\fBsystemd\-udevd\fR |
| 990 |
after e\&.g\&. partitioning or formatting the devices\&. |
| 991 |
.PP |
| 992 |
\fB\-t\fR, \fB\-\-timeout=\fR\fB\fISECONDS\fR\fR |
| 993 |
.RS 4 |
| 994 |
Maximum number of seconds to wait for the specified devices or device symlinks being created, initialized, or removed\&. The default value is |
| 995 |
"infinity"\&. |
| 996 |
.sp |
| 997 |
Added in version 251\&. |
| 998 |
.RE |
| 999 |
.PP |
| 1000 |
\fB\-\-initialized=\fR\fB\fIBOOL\fR\fR |
| 1001 |
.RS 4 |
| 1002 |
Check if |
| 1003 |
\fBsystemd\-udevd\fR |
| 1004 |
initialized devices\&. Defaults to true\&. When false, the command only checks if the specified devices exist\&. Set false to this setting if there is no udev rules for the specified devices, as the devices will never be considered as initialized in that case\&. See Initialized Devices section below for more details\&. |
| 1005 |
.sp |
| 1006 |
Added in version 251\&. |
| 1007 |
.RE |
| 1008 |
.PP |
| 1009 |
\fB\-\-removed\fR |
| 1010 |
.RS 4 |
| 1011 |
When specified, the command wait for devices being removed instead of created or initialized\&. If this is specified, |
| 1012 |
\fB\-\-initialized=\fR |
| 1013 |
will be ignored\&. |
| 1014 |
.sp |
| 1015 |
Added in version 251\&. |
| 1016 |
.RE |
| 1017 |
.PP |
| 1018 |
\fB\-\-settle\fR |
| 1019 |
.RS 4 |
| 1020 |
When specified, also watches the udev event queue, and wait for all queued events being processed by |
| 1021 |
\fBsystemd\-udevd\fR\&. |
| 1022 |
.sp |
| 1023 |
Added in version 251\&. |
| 1024 |
.RE |
| 1025 |
.SS "udevadm lock [\fIoptions\fR\&...] \fIcommand\fR\&..." |
| 1026 |
.PP |
| 1027 |
\fBudevadm lock\fR |
| 1028 |
takes an (advisory) exclusive lock on a block device (or all specified devices), as per |
| 1029 |
\m[blue]\fBLocking Block Device Access\fR\m[]\&\s-2\u[2]\d\s+2 |
| 1030 |
and invokes a program with the locks taken\&. When the invoked program exits the locks are automatically released and its return value is propagated as exit code of |
| 1031 |
\fBudevadm lock\fR\&. |
| 1032 |
.PP |
| 1033 |
This tool is in particular useful to ensure that |
| 1034 |
\fBsystemd-udevd.service\fR(8) |
| 1035 |
does not probe a block device while changes are made to it, for example partitions created or file systems formatted\&. Note that many tools that interface with block devices natively support taking relevant locks, see for example |
| 1036 |
\fBsfdisk\fR(8)\*(Aqs |
| 1037 |
\fB\-\-lock\fR |
| 1038 |
switch\&. |
| 1039 |
.PP |
| 1040 |
The command expects at least one block device specified via |
| 1041 |
\fB\-\-device=\fR |
| 1042 |
or |
| 1043 |
\fB\-\-backing=\fR, and a command line to execute as arguments\&. |
| 1044 |
.PP |
| 1045 |
\fB\-\-device=\fR\fB\fIDEVICE\fR\fR, \fB\-d \fR\fB\fIDEVICE\fR\fR |
| 1046 |
.RS 4 |
| 1047 |
Takes a path to a device node of the device to lock\&. This switch may be used multiple times (and in combination with |
| 1048 |
\fB\-\-backing=\fR) in order to lock multiple devices\&. If a partition block device node is specified the containing "whole" block device is automatically determined and used for the lock, as per the specification\&. If multiple devices are specified, they are deduplicated, sorted by the major/minor of their device nodes and then locked in order\&. |
| 1049 |
.sp |
| 1050 |
This switch must be used at least once, to specify at least one device to lock\&. (Alternatively, use |
| 1051 |
\fB\-\-backing=\fR, see below\&.) |
| 1052 |
.sp |
| 1053 |
Added in version 251\&. |
| 1054 |
.RE |
| 1055 |
.PP |
| 1056 |
\fB\-\-backing=\fR\fB\fIPATH\fR\fR, \fB\-b \fR\fB\fIPATH\fR\fR |
| 1057 |
.RS 4 |
| 1058 |
If a path to a device node is specified, identical to |
| 1059 |
\fB\-\-device=\fR\&. However, this switch alternatively accepts a path to a regular file or directory, in which case the block device of the file system the file/directory resides on is automatically determined and used as if it was specified with |
| 1060 |
\fB\-\-device=\fR\&. |
| 1061 |
.sp |
| 1062 |
Added in version 251\&. |
| 1063 |
.RE |
| 1064 |
.PP |
| 1065 |
\fB\-\-timeout=\fR\fB\fISECS\fR\fR, \fB\-t \fR\fB\fISECS\fR\fR |
| 1066 |
.RS 4 |
| 1067 |
Specifies how long to wait at most until all locks can be taken\&. Takes a value in seconds, or in the usual supported time units, see |
| 1068 |
\fBsystemd.time\fR(7)\&. If specified as zero the lock is attempted and if not successful the invocation will immediately fail\&. If passed as |
| 1069 |
"infinity" |
| 1070 |
(the default) the invocation will wait indefinitely until the lock can be acquired\&. If the lock cannot be taken in the specified time the specified command will not be executed and the invocation will fail\&. |
| 1071 |
.sp |
| 1072 |
Added in version 251\&. |
| 1073 |
.RE |
| 1074 |
.PP |
| 1075 |
\fB\-\-print\fR, \fB\-p\fR |
| 1076 |
.RS 4 |
| 1077 |
Instead of locking the specified devices and executing a command, just print the device paths that would be locked, and execute no command\&. This command is useful to determine the "whole" block device in case a partition block device is specified\&. The devices will be sorted by their device node major number as primary ordering key and the minor number as secondary ordering key (i\&.e\&. they are shown in the order they\*(Aqd be locked)\&. Note that the number of lines printed here can be less than the number of |
| 1078 |
\fB\-\-device=\fR |
| 1079 |
and |
| 1080 |
\fB\-\-backing=\fR |
| 1081 |
switches specified in case these resolve to the same "whole" devices\&. |
| 1082 |
.sp |
| 1083 |
Added in version 251\&. |
| 1084 |
.RE |
| 1085 |
.SH "INITIALIZED DEVICES" |
| 1086 |
.PP |
| 1087 |
Initialized devices are those for which at least one udev rule already completed execution \(en for any action but |
| 1088 |
"remove" |
| 1089 |
\(em that set a property or other device setting (and thus has an entry in the udev device database)\&. Devices are no longer considered initialized if a |
| 1090 |
"remove" |
| 1091 |
action is seen for them (which removes their entry in the udev device database)\&. Note that devices that have no udev rules are never considered initialized, but might still be announced via the sd\-device API (or similar)\&. |
| 1092 |
.SH "EXAMPLE" |
| 1093 |
.PP |
| 1094 |
\fBExample\ \&1.\ \&Format a File System\fR |
| 1095 |
.PP |
| 1096 |
Take a lock on the backing block device while creating a file system, to ensure that |
| 1097 |
\fBsystemd\-udevd\fR |
| 1098 |
does not probe or announce the new superblock before it is comprehensively written: |
| 1099 |
.sp |
| 1100 |
.if n \{\ |
| 1101 |
.RS 4 |
| 1102 |
.\} |
| 1103 |
.nf |
| 1104 |
# udevadm lock \-\-device=/dev/sda1 mkfs\&.ext4 /dev/sda1 |
| 1105 |
.fi |
| 1106 |
.if n \{\ |
| 1107 |
.RE |
| 1108 |
.\} |
| 1109 |
.PP |
| 1110 |
\fBExample\ \&2.\ \&Format a RAID File System\fR |
| 1111 |
.PP |
| 1112 |
Similar, but take locks on multiple devices at once: |
| 1113 |
.sp |
| 1114 |
.if n \{\ |
| 1115 |
.RS 4 |
| 1116 |
.\} |
| 1117 |
.nf |
| 1118 |
# udevadm lock \-\-device=/dev/sda1 \-\-device=/dev/sdb1 mkfs\&.btrfs /dev/sda1 /dev/sdb1 |
| 1119 |
.fi |
| 1120 |
.if n \{\ |
| 1121 |
.RE |
| 1122 |
.\} |
| 1123 |
.PP |
| 1124 |
\fBExample\ \&3.\ \&Copy in a File System\fR |
| 1125 |
.PP |
| 1126 |
Take a lock on the backing block device while copying in a prepared file system image, to ensure that |
| 1127 |
\fBsystemd\-udevd\fR |
| 1128 |
does not probe or announce the new superblock before it is fully written: |
| 1129 |
.sp |
| 1130 |
.if n \{\ |
| 1131 |
.RS 4 |
| 1132 |
.\} |
| 1133 |
.nf |
| 1134 |
# udevadm lock \-d /dev/sda1 dd if=fs\&.raw of=/dev/sda1 |
| 1135 |
.fi |
| 1136 |
.if n \{\ |
| 1137 |
.RE |
| 1138 |
.\} |
| 1139 |
.PP |
| 1140 |
\fBExample\ \&4.\ \&Predict Network Interface Renaming\fR |
| 1141 |
.PP |
| 1142 |
To predict a network interface name, |
| 1143 |
\fBudevadm test\fR |
| 1144 |
can be used: |
| 1145 |
.sp |
| 1146 |
.if n \{\ |
| 1147 |
.RS 4 |
| 1148 |
.\} |
| 1149 |
.nf |
| 1150 |
$ udevadm test /sys/class/net/wlan0 \-\-json=pretty 2>/dev/null | jq \&.networkInterface\&.name |
| 1151 |
"wlp59s0" |
| 1152 |
.fi |
| 1153 |
.if n \{\ |
| 1154 |
.RE |
| 1155 |
.\} |
| 1156 |
.PP |
| 1157 |
\fBExample\ \&5.\ \&Predict Symbolic links of a Device Node\fR |
| 1158 |
.PP |
| 1159 |
To predict symbolic links to a device node, |
| 1160 |
\fBudevadm test\fR |
| 1161 |
can be used: |
| 1162 |
.sp |
| 1163 |
.if n \{\ |
| 1164 |
.RS 4 |
| 1165 |
.\} |
| 1166 |
.nf |
| 1167 |
$ udevadm test /dev/nvme0n1p1 \-\-json=pretty 2>/dev/null | jq \&.node\&.symlinks |
| 1168 |
[ |
| 1169 |
"/dev/disk/by\-diskseq/1\-part1", |
| 1170 |
"/dev/disk/by\-id/nvme\-WDC_PC_SN720_SDAQNTW\-512G\-1001_192290802247\-part1", |
| 1171 |
"/dev/disk/by\-id/nvme\-WDC_PC_SN720_SDAQNTW\-512G\-1001_192290802247_1\-part1", |
| 1172 |
"/dev/disk/by\-id/nvme\-eui\&.1922908022470001001b448b44ccb9d6\-part1", |
| 1173 |
"/dev/disk/by\-path/pci\-0000:3c:00\&.0\-nvme\-1\-part/by\-partnum/1", |
| 1174 |
"/dev/disk/by\-path/pci\-0000:3c:00\&.0\-nvme\-1\-part1" |
| 1175 |
] |
| 1176 |
$ udevadm test /dev/input/event3 \-\-json=pretty 2>/dev/null | jq \&.node\&.symlinks |
| 1177 |
[ |
| 1178 |
"/dev/input/by\-path/platform\-i8042\-serio\-0\-event\-kbd" |
| 1179 |
] |
| 1180 |
.fi |
| 1181 |
.if n \{\ |
| 1182 |
.RE |
| 1183 |
.\} |
| 1184 |
.SH "SEE ALSO" |
| 1185 |
.PP |
| 1186 |
\fBudev\fR(7), \fBsystemd-udevd.service\fR(8), \fBudev.conf\fR(5) |
| 1187 |
.SH "NOTES" |
| 1188 |
.IP " 1." 4 |
| 1189 |
jq |
| 1190 |
.RS 4 |
| 1191 |
\%https://jqlang.github.io/jq/manual/ |
| 1192 |
.RE |
| 1193 |
.IP " 2." 4 |
| 1194 |
Locking Block Device Access |
| 1195 |
.RS 4 |
| 1196 |
\%https://systemd.io/BLOCK_DEVICE_LOCKING |
| 1197 |
.RE |