about summary refs log tree commit diff
path: root/doc/mdevd-coldplug.html
blob: 36654eb73e686600bf377e8c3103c7529cc08e3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>mdevd: the mdevd-coldplug program</title>
    <meta name="Description" content="mdevd: the mdevd-coldplug program" />
    <meta name="Keywords" content="mdevd linux administration root utilities devd mdev-s uevent netlink coldplug boot" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">mdevd</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The <tt>mdevd-coldplug</tt> program </h1>

<p>
<tt>mdevd-coldplug</tt> performs a <em>coldplug</em>: it scans
<tt>/sys</tt> for all registered devices a uevent manager would
want to perform actions on, and tells the kernel to generate uevents
for all these devices.
</p>

<h2> Interface </h2>

<pre>
     mdevd-coldplug [ -v <em>verbosity</em> ] [ -s <em>slashsys</em> ] [ -O <em>nlgroup</em> ] [ -b <em>kbufsize</em> ]
</pre>

<ul>
 <li> mdevd-coldplug scans <tt>/sys</tt> for devices. </li>
 <li> For every suitable device it finds, it tells the kernel
to generate an event. If a device manager such as
as <a href="mdevd.html">mdevd</a> is listening to the netlink
at this point, it will pick up the series of events. </li>
 <li> mdevd-coldplug exits when it has finished scanning. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-v</tt>&nbsp;<em>verbosity</em>&nbsp;: be more or less verbose.
Default verbosity is 1. 0 will only print fatal error messages, 3 or more
is seriously verbose debugging. </li>
 <li> <tt>-s</tt>&nbsp;<em>slashsys</em>&nbsp;: assume the sysfs
pseudo-filesystem is mounted on <em>slashsys</em>. Default is <tt>/sys</tt>. </li>
 <li> <tt>-O</tt>&nbsp;<em>nlgroup</em>&nbsp;: synchronous coldplug.
<tt>mdevd-coldplug</tt> will not exit until the last uevent it triggers
has been handled by <a href="mdevd.html">mdevd</a>. <em>nlgroup</em>
needs to be a netlink group that <a href="mdevd.html">mdevd</a> is
rebroadcasting handled events to. Note that this option can only work
if <a href="mdevd.html">mdevd</a> is running with a similar <tt>-O</tt>
option with a compatible value; else, <tt>mdevd-coldplug</tt> will wait
forever. </li>
 <li> <tt>-b</tt>&nbsp;<em>kbufsz</em>&nbsp;: try and reserve a kernel buffer of
<em>kbufsz</em> bytes for the netlink queue. The default is 500 kB;
if you're getting "No buffer space available" errors, try increasing this number.
This option is only meaningful when paired with the <tt>-O</tt> option. </li>
</ul>

<h2> Exit codes </h2>

<ul>
 <li> 0: success </li>
 <li> 111: system call failed </li>
</ul>

<h2> Notes </h2>

<ul>
 <li> mdevd-coldplug is a short-lived program, just like
<tt>mdev -s</tt> or <tt>udevadm trigger</tt>. </li>
</ul>

</body>
</html>