]> git.proxmox.com Git - systemd.git/blob - man/udevadm.html
Imported Upstream version 208
[systemd.git] / man / udevadm.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>udevadm</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 208</span><hr><div class="refentry"><a name="udevadm"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>udevadm — udev management tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">udevadm</code> [<code class="option">--debug</code>] [<code class="option">--version</code>] [<code class="option">--help</code>]</p></div><div class="cmdsynopsis"><p><code class="command">udevadm info <em class="replaceable"><code>options</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm trigger [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm settle [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm control <em class="replaceable"><code>command</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm monitor [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm hwdb [<span class="optional">options</span>]</code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em></code> </p></div><div class="cmdsynopsis"><p><code class="command">udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em></code> </p></div></div><div class="refsect1"><a name="idm274700826992"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p>udevadm expects a command and command specific options. It
23 controls the runtime behavior of udev, requests kernel events,
24 manages the event queue, and provides simple debugging mechanisms.</p></div><div class="refsect1"><a name="idm274701547008"></a><h2 id="OPTIONS">OPTIONS<a class="headerlink" title="Permalink to this headline" href="#OPTIONS"></a></h2><div class="variablelist"><dl class="variablelist"><dt id="--debug"><span class="term"><code class="option">--debug</code></span><a class="headerlink" title="Permalink to this term" href="#--debug"></a></dt><dd><p>Print debug messages to stderr.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p>Print version number.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div><div class="refsect2"><a name="idm274700775072"></a><h3 id="udevadm info options">udevadm info <em class="replaceable"><code>options</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20info%20options"></a></h3><p>Queries the udev database for device information
25 stored in the udev database. It can also query the properties
26 of a device from its sysfs representation to help creating udev
27 rules that match this device.</p><div class="variablelist"><dl class="variablelist"><dt id="--query=type"><span class="term"><code class="option">--query=<em class="replaceable"><code>type</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--query=type"></a></dt><dd><p>Query the database for specified type of device data. It needs the
28 <code class="option">--path</code> or <code class="option">--name</code> to identify the specified
29 device. Valid queries are:
30 <span class="command"><strong>name</strong></span>, <span class="command"><strong>symlink</strong></span>, <span class="command"><strong>path</strong></span>,
31 <span class="command"><strong>property</strong></span>, <span class="command"><strong>all</strong></span>.</p></dd><dt id="--path=devpath"><span class="term"><code class="option">--path=<em class="replaceable"><code>devpath</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--path=devpath"></a></dt><dd><p>The devpath of the device to query.</p></dd><dt id="--name=file"><span class="term"><code class="option">--name=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--name=file"></a></dt><dd><p>The name of the device node or a symlink to query</p></dd><dt id="--root"><span class="term"><code class="option">--root</code></span><a class="headerlink" title="Permalink to this term" href="#--root"></a></dt><dd><p>Print absolute paths in <span class="command"><strong>name</strong></span> or <span class="command"><strong>symlink</strong></span>
32 query.</p></dd><dt id="--attribute-walk"><span class="term"><code class="option">--attribute-walk</code></span><a class="headerlink" title="Permalink to this term" href="#--attribute-walk"></a></dt><dd><p>Print all sysfs properties of the specified device that can be used
33 in udev rules to match the specified device. It prints all devices
34 along the chain, up to the root of sysfs that can be used in udev rules.</p></dd><dt id="--export"><span class="term"><code class="option">--export</code></span><a class="headerlink" title="Permalink to this term" href="#--export"></a></dt><dd><p>Print output as key/value pairs. Values are enclosed in single quotes.</p></dd><dt id="--export-prefix=name"><span class="term"><code class="option">--export-prefix=<em class="replaceable"><code>name</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--export-prefix=name"></a></dt><dd><p>Add a prefix to the key name of exported values.</p></dd><dt id="--device-id-of-file=file"><span class="term"><code class="option">--device-id-of-file=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--device-id-of-file=file"></a></dt><dd><p>Print major/minor numbers of the underlying device, where the file
35 lives on.</p></dd><dt id="--export-db"><span class="term"><code class="option">--export-db</code></span><a class="headerlink" title="Permalink to this term" href="#--export-db"></a></dt><dd><p>Export the content of the udev database.</p></dd><dt id="--cleanup-db"><span class="term"><code class="option">--cleanup-db</code></span><a class="headerlink" title="Permalink to this term" href="#--cleanup-db"></a></dt><dd><p>Cleanup the udev database.</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version"></a></dt><dd><p>Print version.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274700194000"></a><h3 id="udevadm trigger [options]">udevadm trigger [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20trigger%20%5Boptions%5D"></a></h3><p>Request device events from the kernel. Primarily used to replay events at system coldplug time.</p><div class="variablelist"><dl class="variablelist"><dt id="--verbose"><span class="term"><code class="option">--verbose</code></span><a class="headerlink" title="Permalink to this term" href="#--verbose"></a></dt><dd><p>Print the list of devices which will be triggered.</p></dd><dt id="--dry-run"><span class="term"><code class="option">--dry-run</code></span><a class="headerlink" title="Permalink to this term" href="#--dry-run"></a></dt><dd><p>Do not actually trigger the event.</p></dd><dt id="--type=type"><span class="term"><code class="option">--type=<em class="replaceable"><code>type</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--type=type"></a></dt><dd><p>Trigger a specific type of devices. Valid types are:
36 <span class="command"><strong>devices</strong></span>, <span class="command"><strong>subsystems</strong></span>.
37 The default value is <span class="command"><strong>devices</strong></span>.</p></dd><dt id="--action=action"><span class="term"><code class="option">--action=<em class="replaceable"><code>action</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--action=action"></a></dt><dd><p>Type of event to be triggered. The default value is <span class="command"><strong>change</strong></span>.</p></dd><dt id="--subsystem-match=subsystem"><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>subsystem</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-match=subsystem"></a></dt><dd><p>Trigger events for devices which belong to a matching subsystem. This option
38 can be specified multiple times and supports shell style pattern matching.</p></dd><dt id="--subsystem-nomatch=subsystem"><span class="term"><code class="option">--subsystem-nomatch=<em class="replaceable"><code>subsystem</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-nomatch=subsystem"></a></dt><dd><p>Do not trigger events for devices which belong to a matching subsystem. This option
39 can be specified multiple times and supports shell style pattern matching.</p></dd><dt id="--attr-match=attribute=value"><span class="term"><code class="option">--attr-match=<em class="replaceable"><code>attribute</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--attr-match=attribute=value"></a></dt><dd><p>Trigger events for devices with a matching sysfs attribute. If a value is specified
40 along with the attribute name, the content of the attribute is matched against the given
41 value using shell style pattern matching. If no value is specified, the existence of the
42 sysfs attribute is checked. This option can be specified multiple times.</p></dd><dt id="--attr-nomatch=attribute=value"><span class="term"><code class="option">--attr-nomatch=<em class="replaceable"><code>attribute</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--attr-nomatch=attribute=value"></a></dt><dd><p>Do not trigger events for devices with a matching sysfs attribute. If a value is
43 specified along with the attribute name, the content of the attribute is matched against
44 the given value using shell style pattern matching. If no value is specified, the existence
45 of the sysfs attribute is checked. This option can be specified multiple times.</p></dd><dt id="--property-match=property=value"><span class="term"><code class="option">--property-match=<em class="replaceable"><code>property</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--property-match=property=value"></a></dt><dd><p>Trigger events for devices with a matching property value. This option can be
46 specified multiple times and supports shell style pattern matching.</p></dd><dt id="--tag-match=property"><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>property</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--tag-match=property"></a></dt><dd><p>Trigger events for devices with a matching tag. This option can be
47 specified multiple times.</p></dd><dt id="--sysname-match=name"><span class="term"><code class="option">--sysname-match=<em class="replaceable"><code>name</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--sysname-match=name"></a></dt><dd><p>Trigger events for devices with a matching sys device name. This option can be
48 specified multiple times and supports shell style pattern matching.</p></dd><dt id="--parent-match=syspath"><span class="term"><code class="option">--parent-match=<em class="replaceable"><code>syspath</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--parent-match=syspath"></a></dt><dd><p>Trigger events for all children of a given device.</p></dd></dl></div></div><div class="refsect2"><a name="idm274703879968"></a><h3 id="udevadm settle [options]">udevadm settle [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20settle%20%5Boptions%5D"></a></h3><p>Watches the udev event queue, and exits if all current events are handled.</p><div class="variablelist"><dl class="variablelist"><dt id="--timeout=seconds"><span class="term"><code class="option">--timeout=<em class="replaceable"><code>seconds</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--timeout=seconds"></a></dt><dd><p>Maximum number of seconds to wait for the event queue to become empty.
49 The default value is 120 seconds. A value of 0 will check if the queue is empty
50 and always return immediately.</p></dd><dt id="--seq-start=seqnum"><span class="term"><code class="option">--seq-start=<em class="replaceable"><code>seqnum</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--seq-start=seqnum"></a></dt><dd><p>Wait only for events after the given sequence number.</p></dd><dt id="--seq-end=seqnum"><span class="term"><code class="option">--seq-end=<em class="replaceable"><code>seqnum</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--seq-end=seqnum"></a></dt><dd><p>Wait only for events before the given sequence number.</p></dd><dt id="--exit-if-exists=file"><span class="term"><code class="option">--exit-if-exists=<em class="replaceable"><code>file</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--exit-if-exists=file"></a></dt><dd><p>Stop waiting if file exists.</p></dd><dt id="--quiet"><span class="term"><code class="option">--quiet</code></span><a class="headerlink" title="Permalink to this term" href="#--quiet"></a></dt><dd><p>Do not print any output, like the remaining queue entries when reaching the timeout.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274703859344"></a><h3 id="udevadm control command">udevadm control <em class="replaceable"><code>command</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20control%20command"></a></h3><p>Modify the internal state of the running udev daemon.</p><div class="variablelist"><dl class="variablelist"><dt id="--exit"><span class="term"><code class="option">--exit</code></span><a class="headerlink" title="Permalink to this term" href="#--exit"></a></dt><dd><p>Signal and wait for systemd-udevd to exit.</p></dd><dt id="--log-priority=value"><span class="term"><code class="option">--log-priority=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--log-priority=value"></a></dt><dd><p>Set the internal log level of systemd-udevd. Valid values are the numerical
51 syslog priorities or their textual representations: <code class="option">err</code>,
52 <code class="option">info</code> and <code class="option">debug</code>.</p></dd><dt id="--stop-exec-queue"><span class="term"><code class="option">--stop-exec-queue</code></span><a class="headerlink" title="Permalink to this term" href="#--stop-exec-queue"></a></dt><dd><p>Signal systemd-udevd to stop executing new events. Incoming events
53 will be queued.</p></dd><dt id="--start-exec-queue"><span class="term"><code class="option">--start-exec-queue</code></span><a class="headerlink" title="Permalink to this term" href="#--start-exec-queue"></a></dt><dd><p>Signal systemd-udevd to enable the execution of events.</p></dd><dt id="--reload"><span class="term"><code class="option">--reload</code></span><a class="headerlink" title="Permalink to this term" href="#--reload"></a></dt><dd><p>Signal systemd-udevd to reload the rules files and other databases like the kernel
54 module index. Reloading rules and databases does not apply any changes to already
55 existing devices; the new configuration will only be applied to new events.</p></dd><dt id="--property=KEY=value"><span class="term"><code class="option">--property=<em class="replaceable"><code>KEY</code></em>=<em class="replaceable"><code>value</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--property=KEY=value"></a></dt><dd><p>Set a global property for all events.</p></dd><dt id="--children-max=value"><span class="term"><code class="option">--children-max=</code><em class="replaceable"><code>value</code></em></span><a class="headerlink" title="Permalink to this term" href="#--children-max=value"></a></dt><dd><p>Set the maximum number of events, systemd-udevd will handle at the
56 same time.</p></dd><dt id="--timeout=seconds"><span class="term"><code class="option">--timeout=</code><em class="replaceable"><code>seconds</code></em></span><a class="headerlink" title="Permalink to this term" href="#--timeout=seconds"></a></dt><dd><p>The maximum number of seconds to wait for a reply from systemd-udevd.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702085920"></a><h3 id="udevadm monitor [options]">udevadm monitor [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20monitor%20%5Boptions%5D"></a></h3><p>Listens to the kernel uevents and events sent out by a udev rule
57 and prints the devpath of the event to the console. It can be used to analyze the
58 event timing, by comparing the timestamps of the kernel uevent and the udev event.
59 </p><div class="variablelist"><dl class="variablelist"><dt id="--kernel"><span class="term"><code class="option">--kernel</code></span><a class="headerlink" title="Permalink to this term" href="#--kernel"></a></dt><dd><p>Print the kernel uevents.</p></dd><dt id="--udev"><span class="term"><code class="option">--udev</code></span><a class="headerlink" title="Permalink to this term" href="#--udev"></a></dt><dd><p>Print the udev event after the rule processing.</p></dd><dt id="--property"><span class="term"><code class="option">--property</code></span><a class="headerlink" title="Permalink to this term" href="#--property"></a></dt><dd><p>Also print the properties of the event.</p></dd><dt id="--subsystem-match=string[/string]"><span class="term"><code class="option">--subsystem-match=<em class="replaceable"><code>string[/string]</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem-match=string%5B/string%5D"></a></dt><dd><p>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</p></dd><dt id="--tag-match=string"><span class="term"><code class="option">--tag-match=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--tag-match=string"></a></dt><dd><p>Filter events by property. Only udev events with a given tag attached will pass.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702072928"></a><h3 id="udevadm hwdb [options]">udevadm hwdb [<span class="optional">options</span>]<a class="headerlink" title="Permalink to this headline" href="#udevadm%20hwdb%20%5Boptions%5D"></a></h3><p>Maintain the hardware database index in <code class="filename">/etc/udev/hwdb.bin</code>.</p><div class="variablelist"><dl class="variablelist"><dt id="--update"><span class="term"><code class="option">--update</code></span><a class="headerlink" title="Permalink to this term" href="#--update"></a></dt><dd><p>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
60 /etc/udev/hwdb.d/ and store it in <code class="filename">/etc/udev/hwdb.bin</code>. This should be done after
61 any update to the source files; it will not be called automatically. The running
62 udev daemon will detect a new database on its own and does not need to be
63 notified about it.</p></dd><dt id="--test=string"><span class="term"><code class="option">--test=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--test=string"></a></dt><dd><p>Query the database with a modalias string, and print the
64 retrieved properties.</p></dd><dt id="--root=string"><span class="term"><code class="option">--root=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--root=string"></a></dt><dd><p>Alternative root path in the filesystem for reading and writing files.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702063648"></a><h3 id="udevadm test [options] devpath">udevadm test [<span class="optional">options</span>] <em class="replaceable"><code>devpath</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20test%20%5Boptions%5D%20devpath"></a></h3><p>Simulate a udev event run for the given device, and print debug output.</p><div class="variablelist"><dl class="variablelist"><dt id="--action=string"><span class="term"><code class="option">--action=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--action=string"></a></dt><dd><p>The action string.</p></dd><dt id="--subsystem=string"><span class="term"><code class="option">--subsystem=<em class="replaceable"><code>string</code></em></code></span><a class="headerlink" title="Permalink to this term" href="#--subsystem=string"></a></dt><dd><p>The subsystem string.</p></dd><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div><div class="refsect2"><a name="idm274702055744"></a><h3 id="udevadm test-builtin [options] command devpath">udevadm test-builtin [<span class="optional">options</span>] <em class="replaceable"><code>command</code></em> <em class="replaceable"><code>devpath</code></em><a class="headerlink" title="Permalink to this headline" href="#udevadm%20test-builtin%20%5Boptions%5D%20command%20devpath"></a></h3><p>Run a built-in command for the given device, and print debug output.</p><div class="variablelist"><dl class="variablelist"><dt id="--help"><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#--help"></a></dt><dd><p>Print help text.</p></dd></dl></div></div></div><div class="refsect1"><a name="idm274702051328"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p><a href="udev.html"><span class="citerefentry"><span class="refentrytitle">udev</span>(7)</span></a>
65 <a href="systemd-udevd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-udevd.service</span>(8)</span></a></p></div></div></body></html>