|
Lines 269-281
Link Here
|
| 269 |
.Pa /dev |
269 |
.Pa /dev |
| 270 |
(this only matters for things that might change the properties of nodes). |
270 |
(this only matters for things that might change the properties of nodes). |
| 271 |
.Pp |
271 |
.Pp |
| 272 |
.Dl "devfs ruleset 10" |
|
|
| 273 |
.Pp |
| 274 |
Specify that ruleset 10 should be the current ruleset for |
272 |
Specify that ruleset 10 should be the current ruleset for |
| 275 |
.Pa /dev |
273 |
.Pa /dev |
| 276 |
(if it does not already exist, it is created). |
274 |
(if it does not already exist, it is created). |
| 277 |
.Pp |
275 |
.Pp |
| 278 |
.Dl "devfs rule add path speaker mode 666" |
276 |
.Dl "devfs ruleset 10" |
| 279 |
.Pp |
277 |
.Pp |
| 280 |
Add a rule that causes all nodes that have a path that matches |
278 |
Add a rule that causes all nodes that have a path that matches |
| 281 |
.Dq Li speaker |
279 |
.Dq Li speaker |
|
Lines 293-299
Link Here
|
| 293 |
.Pa atspeaker |
291 |
.Pa atspeaker |
| 294 |
module is loaded after the above rule is added). |
292 |
module is loaded after the above rule is added). |
| 295 |
.Pp |
293 |
.Pp |
| 296 |
.Dl "devfs rule applyset" |
294 |
.Dl "devfs rule add path speaker mode 666" |
| 297 |
.Pp |
295 |
.Pp |
| 298 |
Apply all the rules in the current ruleset to all the existing nodes. |
296 |
Apply all the rules in the current ruleset to all the existing nodes. |
| 299 |
E.g., if the above rule was added after |
297 |
E.g., if the above rule was added after |
|
Lines 302-308
Link Here
|
| 302 |
this command will cause its file mode to be changed to 666 |
300 |
this command will cause its file mode to be changed to 666 |
| 303 |
as prescribed by the rule. |
301 |
as prescribed by the rule. |
| 304 |
.Pp |
302 |
.Pp |
| 305 |
.Dl devfs rule add path "snp*" mode 660 group snoopers |
303 |
.Dl "devfs rule applyset" |
| 306 |
.Pp |
304 |
.Pp |
| 307 |
(Quoting the argument to |
305 |
(Quoting the argument to |
| 308 |
.Cm path |
306 |
.Cm path |
|
Lines 317-323
Link Here
|
| 317 |
.Xr snp 4 |
315 |
.Xr snp 4 |
| 318 |
devices. |
316 |
devices. |
| 319 |
.Pp |
317 |
.Pp |
| 320 |
.Dl "devfs rule -s 20 add type disk group wheel" |
318 |
.Dl devfs rule add path "snp*" mode 660 group snoopers |
| 321 |
.Pp |
319 |
.Pp |
| 322 |
Add a rule to ruleset number 20. |
320 |
Add a rule to ruleset number 20. |
| 323 |
Since this ruleset is not the current ruleset for any mount-points, |
321 |
Since this ruleset is not the current ruleset for any mount-points, |
|
Lines 325-358
Link Here
|
| 325 |
a current ruleset for some mount-point at a later time). |
323 |
a current ruleset for some mount-point at a later time). |
| 326 |
However, it can be applied explicitly, as such: |
324 |
However, it can be applied explicitly, as such: |
| 327 |
.Pp |
325 |
.Pp |
| 328 |
.Dl "devfs -m /my/jail/dev rule -s 20 applyset" |
326 |
.Dl "devfs rule -s 20 add type disk group wheel" |
| 329 |
.Pp |
327 |
.Pp |
| 330 |
This will apply all rules in ruleset number 20 to the DEVFS mount on |
328 |
This will apply all rules in ruleset number 20 to the DEVFS mount on |
| 331 |
.Pa /my/jail/dev . |
329 |
.Pa /my/jail/dev . |
| 332 |
It does not matter that ruleset 20 is not the current ruleset for that |
330 |
It does not matter that ruleset 20 is not the current ruleset for that |
| 333 |
mount-point; the rules are still applied. |
331 |
mount-point; the rules are still applied. |
| 334 |
.Pp |
332 |
.Pp |
| 335 |
.Dl "devfs rule apply hide" |
333 |
.Dl "devfs -m /my/jail/dev rule -s 20 applyset" |
| 336 |
.Pp |
334 |
.Pp |
| 337 |
Since this rule has no conditions, the action |
335 |
Since this rule has no conditions, the action |
| 338 |
.Pq Cm hide |
336 |
.Pq Cm hide |
| 339 |
will be applied to all nodes. |
337 |
will be applied to all nodes. |
| 340 |
Since hiding all nodes is not very useful, we can undo it: |
338 |
Since hiding all nodes is not very useful, we can undo it: |
| 341 |
.Pp |
339 |
.Pp |
| 342 |
.Dl "devfs rule apply unhide" |
340 |
.Dl "devfs rule apply hide" |
| 343 |
.Pp |
341 |
.Pp |
| 344 |
which applies |
342 |
which applies |
| 345 |
.Cm unhide |
343 |
.Cm unhide |
| 346 |
to all the nodes, |
344 |
to all the nodes, |
| 347 |
causing them to reappear. |
345 |
causing them to reappear. |
| 348 |
.Pp |
346 |
.Pp |
| 349 |
.Dl "devfs rule -s 10 add - < my_rules" |
347 |
.Dl "devfs rule apply unhide" |
| 350 |
.Pp |
348 |
.Pp |
| 351 |
Add all the rules from the file |
349 |
Add all the rules from the file |
| 352 |
.Pa my_rules |
350 |
.Pa my_rules |
| 353 |
to ruleset 10. |
351 |
to ruleset 10. |
| 354 |
.Pp |
352 |
.Pp |
| 355 |
.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" |
353 |
.Dl "devfs rule -s 10 add - < my_rules" |
| 356 |
.Pp |
354 |
.Pp |
| 357 |
Since |
355 |
Since |
| 358 |
.Cm show |
356 |
.Cm show |
|
Lines 362-367
Link Here
|
| 362 |
The rule numbers are preserved, |
360 |
The rule numbers are preserved, |
| 363 |
but ruleset 10 may already have rules with non-conflicting numbers |
361 |
but ruleset 10 may already have rules with non-conflicting numbers |
| 364 |
(these will be preserved). |
362 |
(these will be preserved). |
|
|
363 |
.Pp |
| 364 |
.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" |
| 365 |
.Sh SEE ALSO |
365 |
.Sh SEE ALSO |
| 366 |
.Xr chmod 1 , |
366 |
.Xr chmod 1 , |
| 367 |
.Xr jail 2 , |
367 |
.Xr jail 2 , |