xref: /freebsd/sbin/devfs/devfs.8 (revision 4102e838)
1a1dc2096SDima Dorfman.\"
2a1dc2096SDima Dorfman.\" Copyright (c) 2002 Dima Dorfman.
3a1dc2096SDima Dorfman.\" All rights reserved.
4a1dc2096SDima Dorfman.\"
5a1dc2096SDima Dorfman.\" Redistribution and use in source and binary forms, with or without
6a1dc2096SDima Dorfman.\" modification, are permitted provided that the following conditions
7a1dc2096SDima Dorfman.\" are met:
8a1dc2096SDima Dorfman.\" 1. Redistributions of source code must retain the above copyright
9a1dc2096SDima Dorfman.\"    notice, this list of conditions and the following disclaimer.
10a1dc2096SDima Dorfman.\" 2. Redistributions in binary form must reproduce the above copyright
11a1dc2096SDima Dorfman.\"    notice, this list of conditions and the following disclaimer in the
12a1dc2096SDima Dorfman.\"    documentation and/or other materials provided with the distribution.
13a1dc2096SDima Dorfman.\"
14a1dc2096SDima Dorfman.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15a1dc2096SDima Dorfman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16a1dc2096SDima Dorfman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17a1dc2096SDima Dorfman.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18a1dc2096SDima Dorfman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19a1dc2096SDima Dorfman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20a1dc2096SDima Dorfman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21a1dc2096SDima Dorfman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22a1dc2096SDima Dorfman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23a1dc2096SDima Dorfman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24a1dc2096SDima Dorfman.\" SUCH DAMAGE.
25a1dc2096SDima Dorfman.\"
26a1dc2096SDima Dorfman.\" $FreeBSD$
27a1dc2096SDima Dorfman.\"
28*4102e838SJohn-Mark Gurney.Dd December 1, 2020
297ba06023SRuslan Ermilov.Dt DEVFS 8
30a1dc2096SDima Dorfman.Os
31a1dc2096SDima Dorfman.Sh NAME
32a1dc2096SDima Dorfman.Nm devfs
33a1dc2096SDima Dorfman.Nd "DEVFS control"
34a1dc2096SDima Dorfman.Sh SYNOPSIS
35a1dc2096SDima Dorfman.Nm
36a1dc2096SDima Dorfman.Op Fl m Ar mount-point
377ba06023SRuslan Ermilov.Ar keyword
38a1dc2096SDima Dorfman.Ar argument ...
39a1dc2096SDima Dorfman.Sh DESCRIPTION
40a1dc2096SDima DorfmanThe
41a1dc2096SDima Dorfman.Nm
42a1dc2096SDima Dorfmanutility provides an interface to manipulate properties of
43a1dc2096SDima Dorfman.Xr devfs 5
44a1dc2096SDima Dorfmanmounts.
45a1dc2096SDima Dorfman.Pp
46*4102e838SJohn-Mark GurneyThe rules, by default as configured by
47*4102e838SJohn-Mark Gurney.Pa /etc/rc.conf ,
48*4102e838SJohn-Mark Gurneyare loaded at boot via the devfs
49*4102e838SJohn-Mark Gurney.Xr service 8 .
50*4102e838SJohn-Mark GurneyThe rules can be reloaded by running the command:
51*4102e838SJohn-Mark Gurney.Bd -literal -offset indent
52*4102e838SJohn-Mark Gurneyservice devfs restart
53*4102e838SJohn-Mark Gurney.Ed
54*4102e838SJohn-Mark Gurney.Pp
55d54277a7SSimon L. B. NielsenThe
56d54277a7SSimon L. B. Nielsen.Ar keyword
57d54277a7SSimon L. B. Nielsenargument determines the context for
58a1dc2096SDima Dorfmanthe rest of the arguments.
59a1dc2096SDima DorfmanFor example,
60a1dc2096SDima Dorfmanmost of the commands related to the rule subsystem must be preceded by the
61a1dc2096SDima Dorfman.Cm rule
62a1dc2096SDima Dorfmankeyword.
63a1dc2096SDima DorfmanThe following flags are common to all keywords:
6421c2aa5eSJoel Dahl.Bl -tag -width 15n
65a1dc2096SDima Dorfman.It Fl m Ar mount-point
66a1dc2096SDima DorfmanOperate on
67a1dc2096SDima Dorfman.Ar mount-point ,
68a1dc2096SDima Dorfmanwhich is expected to be a
69a1dc2096SDima Dorfman.Xr devfs 5
70a1dc2096SDima Dorfmanmount.
71a1dc2096SDima DorfmanIf this option is not specified,
72a1dc2096SDima Dorfman.Nm
73a1dc2096SDima Dorfmanoperates on
74a1dc2096SDima Dorfman.Pa /dev .
75a1dc2096SDima Dorfman.El
76014c2ea5SDima Dorfman.Ss Rule Subsystem
77a1dc2096SDima DorfmanThe
78a1dc2096SDima Dorfman.Xr devfs 5
79a1dc2096SDima Dorfmanrule subsystem provides a way for the administrator of a system to control
80a1dc2096SDima Dorfmanthe attributes of DEVFS nodes.
81a1dc2096SDima Dorfman.\" XXX devfs node?  entry?  what?
82a1dc2096SDima DorfmanEach DEVFS mount-point has a
83a1dc2096SDima Dorfman.Dq ruleset ,
84a1dc2096SDima Dorfmanor a list of rules,
85a1dc2096SDima Dorfmanassociated with it.
86a1dc2096SDima DorfmanWhen a device driver creates a new node,
87a1dc2096SDima Dorfmanall the rules in the ruleset associated with each mount-point are applied
88a1dc2096SDima Dorfman(see below) before the node becomes visible to the userland.
89a1dc2096SDima DorfmanThis permits the administrator to change the properties,
90a1dc2096SDima Dorfmanincluding the visibility,
91a1dc2096SDima Dorfmanof certain nodes.
92a1dc2096SDima DorfmanFor example, one might want to hide all disk nodes in a
93a1dc2096SDima Dorfman.Xr jail 2 Ns 's
94a1dc2096SDima Dorfman.Pa /dev .
95a1dc2096SDima Dorfman.Ss Rule Manipulation
96a1dc2096SDima DorfmanRule manipulation commands follow the
97a1dc2096SDima Dorfman.Cm rule
98a1dc2096SDima Dorfmankeyword.
99a1dc2096SDima DorfmanThe following flags are common to all of the rule manipulation commands:
10021c2aa5eSJoel Dahl.Bl -tag -width 15n
101a1dc2096SDima Dorfman.It Fl s Ar ruleset
102a1dc2096SDima DorfmanOperate on the ruleset with the number
103a1dc2096SDima Dorfman.Ar ruleset .
104a1dc2096SDima DorfmanIf this is not specified,
105a1dc2096SDima Dorfmanthe commands operate on the ruleset currently associated with the
106a1dc2096SDima Dorfmanspecified mount-point.
107a1dc2096SDima Dorfman.El
108a1dc2096SDima Dorfman.Pp
109a1dc2096SDima DorfmanThe following commands are recognized:
11021c2aa5eSJoel Dahl.Bl -tag -width 15n
111a1dc2096SDima Dorfman.It Cm rule add Oo Ar rulenum Oc Ar rulespec
112a1dc2096SDima DorfmanAdd the rule described by
113a1dc2096SDima Dorfman.Ar rulespec
114a1dc2096SDima Dorfman(defined below)
115a1dc2096SDima Dorfmanto the ruleset.
116a1dc2096SDima DorfmanThe rule has the number
117a1dc2096SDima Dorfman.Ar rulenum
118a1dc2096SDima Dorfmanif it is explicitly specified;
119a1dc2096SDima Dorfmanotherwise, the rule number is automatically determined by the kernel.
1207ba06023SRuslan Ermilov.It Cm rule apply Ar rulenum | rulespec
121a1dc2096SDima DorfmanApply rule number
122a1dc2096SDima Dorfman.Ar rulenum
123a1dc2096SDima Dorfmanor the rule described by
124a1dc2096SDima Dorfman.Ar rulespec
125a1dc2096SDima Dorfmanto the mount-point.
1267ba06023SRuslan ErmilovRules that are
1277ba06023SRuslan Ermilov.Dq applied
1287ba06023SRuslan Ermilovhave their conditions checked against all nodes
129111c3747SDima Dorfmanin the mount-point and the actions taken if they match.
130a1dc2096SDima Dorfman.It Cm rule applyset
131a1dc2096SDima DorfmanApply all the rules in the ruleset to the mount-point
1327ba06023SRuslan Ermilov(see above for the definition of
1337ba06023SRuslan Ermilov.Dq apply ) .
134a1dc2096SDima Dorfman.It Cm rule del Ar rulenum
135a1dc2096SDima DorfmanDelete rule number
136a1dc2096SDima Dorfman.Ar rulenum
137a1dc2096SDima Dorfmanfrom the ruleset.
138a1dc2096SDima Dorfman.It Cm rule delset
139a1dc2096SDima DorfmanDelete all rules from the ruleset.
140a1dc2096SDima Dorfman.It Cm rule show Op Ar rulenum
141a1dc2096SDima DorfmanDisplay the rule number
142a1dc2096SDima Dorfman.Ar rulenum ,
143a1dc2096SDima Dorfmanor all the rules in the ruleset.
144a1dc2096SDima DorfmanThe output lines (one line per rule) are expected to be valid
145a1dc2096SDima Dorfman.Ar rulespec Ns s .
146a1dc2096SDima Dorfman.It Cm rule showsets
147a1dc2096SDima DorfmanReport the numbers of existing rulesets.
148a1dc2096SDima Dorfman.It Cm ruleset Ar ruleset
149a1dc2096SDima DorfmanSet ruleset number
150a1dc2096SDima Dorfman.Ar ruleset
151a1dc2096SDima Dorfmanas the current ruleset for the mount-point.
152a1dc2096SDima Dorfman.El
153a1dc2096SDima Dorfman.Ss Rule Specification
154a1dc2096SDima DorfmanRules have two parts: the conditions and the actions.
155111c3747SDima DorfmanThe conditions determine which DEVFS nodes the rule matches
156a1dc2096SDima Dorfmanand the actions determine what should be done when a rule matches a node.
157a1dc2096SDima DorfmanFor example, a rule can be written that sets the GID to
1581964f79aSPoul-Henning Kamp.Dq Li operator
1591964f79aSPoul-Henning Kampfor all devices of type tape.
160072af151SDima DorfmanIf the first token of a rule specification is a single dash
1617ba06023SRuslan Ermilov.Pq Sq Fl ,
162072af151SDima Dorfmanrules are read from the standard input and the rest of the specification
163072af151SDima Dorfmanis ignored.
164a1dc2096SDima Dorfman.Pp
165a1dc2096SDima DorfmanThe following conditions are recognized.
166a1dc2096SDima DorfmanConditions are ANDed together when matching a device;
167a1dc2096SDima Dorfmanif OR is desired, multiple rules can be written.
16821c2aa5eSJoel Dahl.Bl -tag -width 15n
169a1dc2096SDima Dorfman.It Cm path Ar pattern
170a1dc2096SDima DorfmanMatches any node with a path that matches
171111c3747SDima Dorfman.Ar pattern ,
172111c3747SDima Dorfmanwhich is interpreted as a
173a1dc2096SDima Dorfman.Xr glob 3 Ns -style
174a1dc2096SDima Dorfmanpattern.
175a1dc2096SDima Dorfman.It Cm type Ar devtype
176a1dc2096SDima DorfmanMatches any node that is of type
177a1dc2096SDima Dorfman.Ar devtype .
178a1dc2096SDima DorfmanValid types are
1797ba06023SRuslan Ermilov.Cm disk , mem , tape
180a1dc2096SDima Dorfmanand
1817ba06023SRuslan Ermilov.Cm tty .
182a1dc2096SDima Dorfman.El
183a1dc2096SDima Dorfman.Pp
184a1dc2096SDima DorfmanThe following actions are recognized.
185a1dc2096SDima DorfmanAlthough there is no explicit delimiter between conditions and actions,
186a1dc2096SDima Dorfmanthey may not be intermixed.
18721c2aa5eSJoel Dahl.Bl -tag -width 15n
188a1dc2096SDima Dorfman.It Cm group Ar gid
189a1dc2096SDima DorfmanSet the GID of the node to
190a1dc2096SDima Dorfman.Ar gid ,
191a1dc2096SDima Dorfmanwhich may be a group name
192a1dc2096SDima Dorfman(looked up in
193a1dc2096SDima Dorfman.Pa /etc/group )
194a1dc2096SDima Dorfmanor number.
195a1dc2096SDima Dorfman.It Cm hide
196a1dc2096SDima DorfmanHide the node.
197a1dc2096SDima DorfmanNodes may later be revived manually with
198111c3747SDima Dorfman.Xr mknod 8
199a1dc2096SDima Dorfmanor with the
200a1dc2096SDima Dorfman.Cm unhide
201a1dc2096SDima Dorfmanaction.
20236ad3f47SJaakko HeinonenHiding a directory node effectively hides all of its child nodes.
203a1dc2096SDima Dorfman.It Cm include Ar ruleset
204a1dc2096SDima DorfmanApply all the rules in ruleset number
205a1dc2096SDima Dorfman.Ar ruleset
206a1dc2096SDima Dorfmanto the node.
207a1dc2096SDima DorfmanThis does not necessarily result in any changes to the node
208a1dc2096SDima Dorfman(e.g., if none of the rules in the included ruleset match).
209ebae8e93SGavin AtkinsonInclude commands in the referenced
210ebae8e93SGavin Atkinson.Ar ruleset
211ebae8e93SGavin Atkinsonare not resolved.
212a1dc2096SDima Dorfman.It Cm mode Ar filemode
213a1dc2096SDima DorfmanSet the file mode to
214a1dc2096SDima Dorfman.Ar filemode ,
2151cf7cec3SDima Dorfmanwhich is interpreted as in
2161cf7cec3SDima Dorfman.Xr chmod 1 .
217a1dc2096SDima Dorfman.It Cm user Ar uid
218a1dc2096SDima DorfmanSet the UID to
219a1dc2096SDima Dorfman.Ar uid ,
220a1dc2096SDima Dorfmanwhich may be a user name
221a1dc2096SDima Dorfman(looked up in
222a1dc2096SDima Dorfman.Pa /etc/passwd )
223a1dc2096SDima Dorfmanor number.
224a1dc2096SDima Dorfman.It Cm unhide
225a1dc2096SDima DorfmanUnhide the node.
22636ad3f47SJaakko HeinonenIf the node resides in a subdirectory,
22736ad3f47SJaakko Heinonenall parent directory nodes must be visible to be able to access the node.
228a1dc2096SDima Dorfman.El
229014c2ea5SDima Dorfman.Sh IMPLEMENTATION NOTES
230111c3747SDima DorfmanRulesets are created by the kernel at the first reference
231a1dc2096SDima Dorfmanand destroyed when the last reference disappears.
232a1dc2096SDima DorfmanE.g., a ruleset is created when a rule is added to it or when it is set
233111c3747SDima Dorfmanas the current ruleset for a mount-point, and
234111c3747SDima Dorfmana ruleset is destroyed when the last rule in it is deleted
235a1dc2096SDima Dorfmanand no other references to it exist
236111c3747SDima Dorfman(i.e., it is not included by any rules and it is not the current ruleset
237a1dc2096SDima Dorfmanfor any mount-point).
238014c2ea5SDima Dorfman.Pp
239a1dc2096SDima DorfmanRuleset number 0 is the default ruleset for all new mount-points.
240a1dc2096SDima DorfmanIt is always empty, cannot be modified or deleted, and does not show up
241a1dc2096SDima Dorfmanin the output of
242a1dc2096SDima Dorfman.Cm showsets .
243014c2ea5SDima Dorfman.Pp
244a1dc2096SDima DorfmanRules and rulesets are unique to the entire system,
245a1dc2096SDima Dorfmannot a particular mount-point.
246a1dc2096SDima DorfmanI.e., a
247a1dc2096SDima Dorfman.Cm showsets
248a1dc2096SDima Dorfmanwill return the same information regardless of the mount-point specified with
249a1dc2096SDima Dorfman.Fl m .
250111c3747SDima DorfmanThe mount-point is only relevant when changing what its current ruleset is
251a1dc2096SDima Dorfmanor when using one of the apply commands.
25255c82bf0SRuslan Ermilov.Sh FILES
25321c2aa5eSJoel Dahl.Bl -tag -width "Pa /usr/share/examples/etc/devfs.conf" -compact
25455c82bf0SRuslan Ermilov.It Pa /etc/defaults/devfs.rules
25522425699SDaniel GerzoDefault
25622425699SDaniel Gerzo.Nm
25722425699SDaniel Gerzoconfiguration file.
25855c82bf0SRuslan Ermilov.It Pa /etc/devfs.rules
25922425699SDaniel GerzoLocal
26022425699SDaniel Gerzo.Nm
261e441cce6SSevan Janiyanconfiguration file.
262e441cce6SSevan JaniyanRulesets in here override those in
263ebae8e93SGavin Atkinson.Pa /etc/defaults/devfs.rules
264ebae8e93SGavin Atkinsonwith the same ruleset number, otherwise the two files are effectively merged.
26522425699SDaniel Gerzo.It Pa /etc/devfs.conf
26622425699SDaniel GerzoBoot-time
26722425699SDaniel Gerzo.Nm
26822425699SDaniel Gerzoconfiguration file.
26922425699SDaniel Gerzo.It Pa /usr/share/examples/etc/devfs.conf
27022425699SDaniel GerzoExample boot-time
27122425699SDaniel Gerzo.Nm
27222425699SDaniel Gerzoconfiguration file.
27355c82bf0SRuslan Ermilov.El
274014c2ea5SDima Dorfman.Sh EXAMPLES
275a1dc2096SDima DorfmanWhen the system boots,
276a1dc2096SDima Dorfmanthe only ruleset that exists is ruleset number 0;
277a1dc2096SDima Dorfmansince the latter may not be modified, we have to create another ruleset
278a1dc2096SDima Dorfmanbefore adding rules.
2797ba06023SRuslan ErmilovNote that since most of the following examples do not specify
280a1dc2096SDima Dorfman.Fl m ,
281a1dc2096SDima Dorfmanthe operations are performed on
282a1dc2096SDima Dorfman.Pa /dev
283a1dc2096SDima Dorfman(this only matters for things that might change the properties of nodes).
284a1dc2096SDima Dorfman.Pp
285a1dc2096SDima DorfmanSpecify that ruleset 10 should be the current ruleset for
286a1dc2096SDima Dorfman.Pa /dev
287309bbfe8SJoel Dahl(if it does not already exist, it is created):
288a1dc2096SDima Dorfman.Pp
289309bbfe8SJoel Dahl.Dl "devfs ruleset 10"
290a1dc2096SDima Dorfman.Pp
291a1dc2096SDima DorfmanAdd a rule that causes all nodes that have a path that matches
2927ba06023SRuslan Ermilov.Dq Li speaker
293a1dc2096SDima Dorfman(this is only
294a1dc2096SDima Dorfman.Pa /dev/speaker )
295a1dc2096SDima Dorfmanto have the file mode 666 (read and write for all).
296a1dc2096SDima DorfmanNote that if any such nodes already exist, their mode will not be changed
297a1dc2096SDima Dorfmanunless this rule (or ruleset) is explicitly applied (see below).
298a1dc2096SDima DorfmanThe mode
299a1dc2096SDima Dorfman.Em will
300a1dc2096SDima Dorfmanbe changed if the node is created
301a1dc2096SDima Dorfman.Em after
302a1dc2096SDima Dorfmanthe rule is added
303a1dc2096SDima Dorfman(e.g., the
304a1dc2096SDima Dorfman.Pa atspeaker
305309bbfe8SJoel Dahlmodule is loaded after the above rule is added):
306a1dc2096SDima Dorfman.Pp
307309bbfe8SJoel Dahl.Dl "devfs rule add path speaker mode 666"
308a1dc2096SDima Dorfman.Pp
309a1dc2096SDima DorfmanApply all the rules in the current ruleset to all the existing nodes.
310309bbfe8SJoel DahlE.g., if the below rule was added after
311a1dc2096SDima Dorfman.Pa /dev/speaker
312a1dc2096SDima Dorfmanwas created,
313111c3747SDima Dorfmanthis command will cause its file mode to be changed to 666
314309bbfe8SJoel Dahlas prescribed by the rule:
315a1dc2096SDima Dorfman.Pp
316309bbfe8SJoel Dahl.Dl "devfs rule applyset"
317a1dc2096SDima Dorfman.Pp
3187ba06023SRuslan ErmilovFor all devices with a path that matches
3197ba06023SRuslan Ermilov.Dq Li snp* ,
32055f77691SPoul-Henning Kampset the file mode to 660 and the GID to
3217ba06023SRuslan Ermilov.Dq Li snoopers .
322a1dc2096SDima DorfmanThis permits users in the
3237ba06023SRuslan Ermilov.Dq Li snoopers
324a1dc2096SDima Dorfmangroup to use the
325a1dc2096SDima Dorfman.Xr snp 4
326309bbfe8SJoel Dahldevices
327309bbfe8SJoel Dahl(quoting the argument to
328309bbfe8SJoel Dahl.Cm path
329309bbfe8SJoel Dahlis often necessary to disable the shell's globbing features):
330a1dc2096SDima Dorfman.Pp
331309bbfe8SJoel Dahl.Dl devfs rule add path "snp*" mode 660 group snoopers
332a1dc2096SDima Dorfman.Pp
333a1dc2096SDima DorfmanAdd a rule to ruleset number 20.
334a1dc2096SDima DorfmanSince this ruleset is not the current ruleset for any mount-points,
335a1dc2096SDima Dorfmanthis rule is never applied automatically (unless ruleset 20 becomes
336309bbfe8SJoel Dahla current ruleset for some mount-point at a later time):
337309bbfe8SJoel Dahl.Pp
338309bbfe8SJoel Dahl.Dl "devfs rule -s 20 add type disk group wheel"
339309bbfe8SJoel Dahl.Pp
340309bbfe8SJoel DahlExplicitly apply all rules in ruleset number 20 to the DEVFS mount on
341309bbfe8SJoel Dahl.Pa /my/jail/dev .
342309bbfe8SJoel DahlIt does not matter that ruleset 20 is not the current ruleset for that
343309bbfe8SJoel Dahlmount-point; the rules are still applied:
344a1dc2096SDima Dorfman.Pp
3457ba06023SRuslan Ermilov.Dl "devfs -m /my/jail/dev rule -s 20 applyset"
346a1dc2096SDima Dorfman.Pp
347309bbfe8SJoel DahlSince the following rule has no conditions, the action
348309bbfe8SJoel Dahl.Pq Cm hide
349309bbfe8SJoel Dahlwill be applied to all nodes:
350a1dc2096SDima Dorfman.Pp
3517ba06023SRuslan Ermilov.Dl "devfs rule apply hide"
352a1dc2096SDima Dorfman.Pp
353309bbfe8SJoel DahlSince hiding all nodes is not very useful, we can undo it.
354309bbfe8SJoel DahlThe following applies
355309bbfe8SJoel Dahl.Cm unhide
356309bbfe8SJoel Dahlto all the nodes,
357309bbfe8SJoel Dahlcausing them to reappear:
358a1dc2096SDima Dorfman.Pp
3597ba06023SRuslan Ermilov.Dl "devfs rule apply unhide"
360072af151SDima Dorfman.Pp
361309bbfe8SJoel DahlAdd all the rules from the file
362309bbfe8SJoel Dahl.Pa my_rules
363309bbfe8SJoel Dahlto ruleset 10:
364072af151SDima Dorfman.Pp
365111c3747SDima Dorfman.Dl "devfs rule -s 10 add - < my_rules"
366072af151SDima Dorfman.Pp
367309bbfe8SJoel DahlThe below copies all the rules from ruleset 20 into ruleset 10.
368072af151SDima DorfmanThe rule numbers are preserved,
369072af151SDima Dorfmanbut ruleset 10 may already have rules with non-conflicting numbers
370072af151SDima Dorfman(these will be preserved).
371309bbfe8SJoel DahlSince
372309bbfe8SJoel Dahl.Cm show
373309bbfe8SJoel Dahloutputs valid rules,
374309bbfe8SJoel Dahlthis feature can be used to copy rulesets:
375309bbfe8SJoel Dahl.Pp
376309bbfe8SJoel Dahl.Dl "devfs rule -s 20 show | devfs rule -s 10 add -"
377a1dc2096SDima Dorfman.Sh SEE ALSO
378d54277a7SSimon L. B. Nielsen.Xr chmod 1 ,
379a1dc2096SDima Dorfman.Xr jail 2 ,
380a1dc2096SDima Dorfman.Xr glob 3 ,
381a1dc2096SDima Dorfman.Xr devfs 5 ,
38222425699SDaniel Gerzo.Xr devfs.conf 5 ,
38322425699SDaniel Gerzo.Xr devfs.rules 5 ,
384a1dc2096SDima Dorfman.Xr chown 8 ,
385a1dc2096SDima Dorfman.Xr jail 8 ,
386*4102e838SJohn-Mark Gurney.Xr mknod 8 ,
387*4102e838SJohn-Mark Gurney.Xr service 8
388e441cce6SSevan Janiyan.Sh HISTORY
389e441cce6SSevan JaniyanThe
390e441cce6SSevan Janiyan.Nm
391e441cce6SSevan Janiyanutility first appeared in
392e441cce6SSevan Janiyan.Fx 5.0 .
393a1dc2096SDima Dorfman.Sh AUTHORS
394a1dc2096SDima Dorfman.An Dima Dorfman
395