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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
<table class="head">
<tr>
<td class="head-ltitle">DEVFS.RULES(5)</td>
<td class="head-vol">File Formats Manual</td>
<td class="head-rtitle">DEVFS.RULES(5)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">devfs.rules</code> —
<span class="Nd">devfs configuration information</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">devfs.rules</code> file provides an easy way
to create and apply <a class="Xr">devfs(8)</a> rules, even for devices that
are not available at boot.</p>
<p class="Pp">For devices available at boot, see
<a class="Xr">devfs.conf(5)</a>.</p>
<p class="Pp">The format of this file is simple. Empty lines and lines beginning
with a hash sign (‘<code class="Li">#</code>’) are ignored. A
line between brackets denotes the start of a ruleset. In the brackets should
be the name of the ruleset and its number, separated by an equal sign.</p>
<p class="Pp">Other lines are rule specifications as documented in
<a class="Xr">devfs(8)</a>, in the section
<a class="Sx" href="#Rule_Specification">Rule Specification</a>. These lines
are prepended with “<code class="Li">rule</code>” and are
passed to <a class="Xr">devfs(8)</a> by the startup scripts of the system.
It is important to put path elements that contain <a class="Xr">glob(3)</a>
special characters between quotes.</p>
<p class="Pp">Rulesets should have a unique name and number.</p>
<p class="Pp">All rules that follow a ruleset declaration belong to that
ruleset, until a new ruleset is started.</p>
<p class="Pp">One custom ruleset has to be enabled in
<span class="Pa">/etc/rc.conf</span>, otherwise it will not be applied to
the <span class="Pa">/dev</span> file system by the default system startup
process. For example, to enable a
“<code class="Li">localrules</code>” ruleset for the
<span class="Pa">/dev</span> file system, you would have to use something
like this in your <span class="Pa">rc.conf</span> file:</p>
<div class="Bd Pp Bd-indent Li">
<pre>devfs_system_ruleset="localrules"</pre>
</div>
<p class="Pp">The rules are loaded at boot via the devfs service. To load
modified rules after the system has booted, run the command:</p>
<div class="Bd Pp Bd-indent Li">
<pre>service devfs restart</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag Bl-compact">
<dt><span class="Pa">/etc/defaults/devfs.rules</span></dt>
<dd>Default <code class="Nm">devfs.rules</code> configuration file.</dd>
<dt><span class="Pa">/etc/devfs.rules</span></dt>
<dd>Local <code class="Nm">devfs.rules</code> configuration file. Rulesets in
here override those in <span class="Pa">/etc/defaults/devfs.rules</span>
with the same ruleset number, otherwise the two files are effectively
merged.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">To make all the partitions of <a class="Xr">da(4)</a> devices
readable and writable by their owner and the
“<code class="Li">usb</code>” group, the following rule may be
used:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent"><code class="Li">[localrules=10]</code></div>
<div class="Bd Bd-indent"><code class="Li">add path 'da*s*' mode 0660 group
usb</code></div>
<p class="Pp">The first line declares and starts a new ruleset, with the name
<var class="Va">localrules</var> and the number 10.</p>
<p class="Pp">To give <a class="Xr">usbconfig(8)</a> and
<a class="Xr">libusb(3)</a> enabled applications permission to all usb
devices for their owner and the “<code class="Li">usb</code>”
group, a similar rule may be used:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent"><code class="Li">add path 'usb/*' mode 0660 group
usb</code></div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">glob(3)</a>, <a class="Xr">devfs(4)</a>,
<a class="Xr">devfs.conf(5)</a>, <a class="Xr">devfs(8)</a>,
<a class="Xr">service(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page was written by <span class="An">Roland
Smith</span>
<<a class="Mt" href="mailto:rsmith@xs4all.nl">rsmith@xs4all.nl</a>>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">December 1, 2020</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|