114f0742eSAlex Hornung.\" 214f0742eSAlex Hornung.\" Copyright (c) 2009 314f0742eSAlex Hornung.\" The DragonFly Project. All rights reserved. 414f0742eSAlex Hornung.\" 514f0742eSAlex Hornung.\" Redistribution and use in source and binary forms, with or without 614f0742eSAlex Hornung.\" modification, are permitted provided that the following conditions 714f0742eSAlex Hornung.\" are met: 814f0742eSAlex Hornung.\" 914f0742eSAlex Hornung.\" 1. Redistributions of source code must retain the above copyright 1014f0742eSAlex Hornung.\" notice, this list of conditions and the following disclaimer. 1114f0742eSAlex Hornung.\" 2. Redistributions in binary form must reproduce the above copyright 1214f0742eSAlex Hornung.\" notice, this list of conditions and the following disclaimer in 1314f0742eSAlex Hornung.\" the documentation and/or other materials provided with the 1414f0742eSAlex Hornung.\" distribution. 1514f0742eSAlex Hornung.\" 3. Neither the name of The DragonFly Project nor the names of its 1614f0742eSAlex Hornung.\" contributors may be used to endorse or promote products derived 1714f0742eSAlex Hornung.\" from this software without specific, prior written permission. 1814f0742eSAlex Hornung.\" 1914f0742eSAlex Hornung.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2014f0742eSAlex Hornung.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2114f0742eSAlex Hornung.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 2214f0742eSAlex Hornung.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 2314f0742eSAlex Hornung.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2414f0742eSAlex Hornung.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 2514f0742eSAlex Hornung.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2614f0742eSAlex Hornung.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2714f0742eSAlex Hornung.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2814f0742eSAlex Hornung.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2914f0742eSAlex Hornung.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3014f0742eSAlex Hornung.\" SUCH DAMAGE. 3114f0742eSAlex Hornung.\" 32b374f6d5SMatthias Schmidt.Dd August 25, 2009 3314f0742eSAlex Hornung.Dt DEVFSCTL 8 34fb5b3747SSascha Wildner.Os 3514f0742eSAlex Hornung.Sh NAME 3614f0742eSAlex Hornung.Nm devfsctl 3714f0742eSAlex Hornung.Nd manipulate devfs rules 3814f0742eSAlex Hornung.Sh SYNOPSIS 3914f0742eSAlex Hornung.Nm 4014f0742eSAlex Hornung.Fl a 4114f0742eSAlex Hornung.Fl f Ar file 4214f0742eSAlex Hornung.Op Fl m Ar mount_point 4314f0742eSAlex Hornung.Nm 4414f0742eSAlex Hornung.Fl d 4514f0742eSAlex Hornung.Fl f Ar file 4614f0742eSAlex Hornung.Nm 4714f0742eSAlex Hornung.Fl c 4814f0742eSAlex Hornung.Op Fl m Ar mount_point 4914f0742eSAlex Hornung.Nm 5014f0742eSAlex Hornung.Fl r 5114f0742eSAlex Hornung.Op Fl m Ar mount_point 5214f0742eSAlex Hornung.Nm 5314f0742eSAlex Hornung.Fl h 5414f0742eSAlex Hornung.Sh DESCRIPTION 5514f0742eSAlex HornungThe 5614f0742eSAlex Hornung.Nm 5714f0742eSAlex Hornungprovides an interface to manipulate the in-kernel 5814f0742eSAlex Hornung.Xr devfs 5 5914f0742eSAlex Hornungruleset. 6014f0742eSAlex Hornung.Pp 6114f0742eSAlex HornungThe options are as follows: 6214f0742eSAlex Hornung.Bl -tag -width indent 6314f0742eSAlex Hornung.It Fl a 6414f0742eSAlex HornungLoad the ruleset specified by 6514f0742eSAlex Hornung.Fl f 6614f0742eSAlex Hornungand apply it. 6714f0742eSAlex HornungIt will not overwrite currently applied rules, 6814f0742eSAlex Hornungbut just append the new ones. 6914f0742eSAlex Hornung.It Fl c 7014f0742eSAlex HornungClear the current ruleset. 7114f0742eSAlex HornungThis does not reset the device nodes, but only clear out all stored rules 7214f0742eSAlex Hornungso that they are not applied to new nodes. 7314f0742eSAlex HornungIt is therefore recommended to use this command in conjunction with 7414f0742eSAlex Hornung.Fl r . 7514f0742eSAlex Hornung.It Fl d 7614f0742eSAlex HornungReads ruleset specified by 7714f0742eSAlex Hornung.Fl f 7814f0742eSAlex Hornungand then dumps its contents to stdout. 7914f0742eSAlex HornungThe rules will not be applied. 801de3c21dSSascha WildnerThis option cannot be used in conjunction with any other option. 8114f0742eSAlex HornungIt is useful for checking the correct syntax and order of the specified ruleset 8214f0742eSAlex Hornungand will show the final interpretation as it would be applied. 8314f0742eSAlex Hornung.It Fl f Ar file 8414f0742eSAlex HornungSpecifies the file containing the ruleset to be loaded. 8514f0742eSAlex HornungThis option is a requirement for 8614f0742eSAlex Hornung.Fl a 8714f0742eSAlex Hornungand 8814f0742eSAlex Hornung.Fl d . 8914f0742eSAlex Hornung.It Fl h 9014f0742eSAlex HornungShows a usage message with a short description of 9114f0742eSAlex Hornung.Nm Ap s 9214f0742eSAlex Hornungoptions. 9314f0742eSAlex Hornung.It Fl m Ar mount_point 9414f0742eSAlex HornungSpecifies the mount point to which the loaded rules shall apply. 9514f0742eSAlex HornungIf this option is not specified, the rules will apply to all 9614f0742eSAlex Hornung.Xr devfs 5 9714f0742eSAlex Hornungmountpoints. 9814f0742eSAlex HornungThe 9914f0742eSAlex Hornung.Ar mount_point 10014f0742eSAlex Hornungargument does not accept wildcards and must be an absolute path. 10114f0742eSAlex Hornung.It Fl r 10214f0742eSAlex HornungReset all 10314f0742eSAlex Hornung.Xr devfs 5 10414f0742eSAlex Hornungnodes to their original status. 10514f0742eSAlex HornungThis does not clear the current ruleset and it is hence recommended 10614f0742eSAlex Hornungto use this command together with 10714f0742eSAlex Hornung.Fl c . 10814f0742eSAlex Hornung.El 10914f0742eSAlex Hornung.Sh RULE SYNTAX 11014f0742eSAlex HornungRules are specified one rule per line, with whitespace separated values. 11114f0742eSAlex HornungEmpty lines and lines beginning with a 11214f0742eSAlex Hornung.Dq # 11314f0742eSAlex Hornungare ignored. 11414f0742eSAlex HornungOnce applied, the rules are in effect for existing device nodes as well 11514f0742eSAlex Hornungas future ones. 11614f0742eSAlex HornungRules are applied in the order specified, thus later rules will override 11714f0742eSAlex Hornungprior ones. 11814f0742eSAlex Hornung.Pp 11914f0742eSAlex HornungNames used in 12014f0742eSAlex Hornung.Xr devfs 5 12114f0742eSAlex Hornungrules can be either device names (? and * wildcards are allowed), device 12214f0742eSAlex Hornungtypes or existing groups. 12314f0742eSAlex HornungGroups are referenced in rules by prefixing them with 12414f0742eSAlex Hornung.Sq @ . 12514f0742eSAlex HornungA device type is one of the following list of special names: 12614f0742eSAlex Hornung.Pp 12714f0742eSAlex Hornung.Bl -tag -offset indent -width ".Li D_DISK" -compact 12814f0742eSAlex Hornung.It Li D_DISK 12914f0742eSAlex Hornungdisk devices/slices/partitions 13014f0742eSAlex Hornung.It Li D_TAPE 13114f0742eSAlex Hornungtape devices 13214f0742eSAlex Hornung.It Li D_MEM 13314f0742eSAlex Hornung(kernel) memory devices 13414f0742eSAlex Hornung.It Li D_TTY 13514f0742eSAlex Hornungtty devices 13614f0742eSAlex Hornung.El 13714f0742eSAlex Hornung.Pp 13814f0742eSAlex HornungRule lines are of the following format: 13914f0742eSAlex Hornung.Bd -literal -offset indent 14014f0742eSAlex Hornung.Ic action Cm argument ... 14114f0742eSAlex Hornung.Ed 14214f0742eSAlex Hornung.Pp 14314f0742eSAlex HornungValid actions are 14414f0742eSAlex Hornung.Ic group , 14514f0742eSAlex Hornung.Ic include , 14614f0742eSAlex Hornung.Ic hide , 14714f0742eSAlex Hornung.Ic jail , 14814f0742eSAlex Hornung.Ic link , 14914f0742eSAlex Hornung.Ic perm 15014f0742eSAlex Hornungand 15114f0742eSAlex Hornung.Ic show : 15214f0742eSAlex Hornung.Bl -tag -width indent -offset indent 15314f0742eSAlex Hornung.It Ic group Ar group_name Ar name ... 15414f0742eSAlex HornungThis will group the specified names into a group of the specified 15514f0742eSAlex Hornung.Ar group_name . 15614f0742eSAlex Hornung.It Ic include Ar file 15714f0742eSAlex HornungIncludes the specified rule file and processes its rules. 15814f0742eSAlex Hornung.It Ic hide Ar name 15914f0742eSAlex HornungThis will hide the device node(s) specified by 16014f0742eSAlex Hornung.Ar name . 16114f0742eSAlex HornungA hidden node will not appear in directory listings and all operations on 16214f0742eSAlex Hornungit will fail, except if it is open already. 16314f0742eSAlex HornungBy default, everything except 16414f0742eSAlex Hornung.Xr pty 4 16514f0742eSAlex Hornungnodes is shown. 16614f0742eSAlex Hornung.It Ic jail Ar yes|no 16714f0742eSAlex HornungA 16814f0742eSAlex Hornung.Sq Ar yes 16914f0742eSAlex Hornungargument will cause all following rules to only apply to mounts of 17014f0742eSAlex Hornung.Xr devfs 5 17114f0742eSAlex Hornunginside a 17214f0742eSAlex Hornung.Xr jail 8 , 17314f0742eSAlex Hornunguntil a 17414f0742eSAlex Hornung.Dq Ic jail Ar no 17514f0742eSAlex Hornungis reached. 17614f0742eSAlex Hornung.It Ic link Ar device Ar path 17714f0742eSAlex Hornung.Ic link 17814f0742eSAlex Hornungrules will create a link node at the specified 17914f0742eSAlex Hornung.Ar link_path 18014f0742eSAlex Hornungto the given 18114f0742eSAlex Hornung.Ar device . 182*265a1428SSascha WildnerThe path is relative to the mountpoint being operated on (see the 18314f0742eSAlex Hornung.Fl m 18414f0742eSAlex Hornungoption), which is usually 18514f0742eSAlex Hornung.Pa /dev . 18614f0742eSAlex Hornung.Pp 18714f0742eSAlex HornungNote that for 18814f0742eSAlex Hornung.Ic link 18914f0742eSAlex Hornungrules, the 19014f0742eSAlex Hornung.Ar device 19114f0742eSAlex Hornunghas to be a single device node and specifying a device type or group (unless 19214f0742eSAlex Hornungit contains only one node) is not possible. 19314f0742eSAlex Hornung.It Ic perm Ar name Ar user:group Ar mode 19414f0742eSAlex HornungA 19514f0742eSAlex Hornung.Ic perm 19614f0742eSAlex Hornungrule will applies the specified mode (octal, see 19714f0742eSAlex Hornung.Xr chmod 1 ) 19814f0742eSAlex Hornungand ownership (see 19914f0742eSAlex Hornung.Xr chown 2 ) 20014f0742eSAlex Hornungto 20114f0742eSAlex Hornung.Ar name . 20214f0742eSAlex Hornung.It Ic show Ar name 20314f0742eSAlex HornungThis will show previously hidden nodes again. 20414f0742eSAlex Hornung.El 20514f0742eSAlex Hornung.Sh FILES 20614f0742eSAlex Hornung.Bl -tag -width ".Pa /etc/devfs" -compact 207b374f6d5SMatthias Schmidt.It Pa /etc/defaults/devfs.conf 208b374f6d5SMatthias SchmidtGlobal devfs ruleset file 209b374f6d5SMatthias Schmidt.It Pa /etc/devfs.conf 210b374f6d5SMatthias SchmidtLocal devfs ruleset file 21114f0742eSAlex Hornung.El 21214f0742eSAlex Hornung.Sh EXAMPLES 21314f0742eSAlex HornungExamples of valid names: 21414f0742eSAlex Hornung.Bd -literal -offset indent 21514f0742eSAlex Hornungbpf* 21614f0742eSAlex Hornungtun0 21714f0742eSAlex HornungD_DISK 21814f0742eSAlex Hornungserno/*s3 21914f0742eSAlex Hornung@groupA 22014f0742eSAlex Hornung.Ed 22114f0742eSAlex Hornung.Pp 22214f0742eSAlex HornungExamples of valid rules: 22314f0742eSAlex Hornung.Bd -literal -offset indent 22414f0742eSAlex Hornunggroup foo da* ri* 22514f0742eSAlex Hornunggroup foo ad* 22614f0742eSAlex Hornunggroup foo md* 22714f0742eSAlex Hornung 22814f0742eSAlex Hornungperm da0 uucp:dialer 0644 22914f0742eSAlex Hornunglink foo bar 23014f0742eSAlex Hornunghide @foo 23114f0742eSAlex Hornungshow D_DISK 23214f0742eSAlex Hornunggroup g1 a b f g 23314f0742eSAlex Hornunggroup g2 c d 23414f0742eSAlex Hornunggroup g3 @g1 h @g2 i j k D_MEM 23514f0742eSAlex Hornungjail yes 23614f0742eSAlex Hornunghide @g3 23714f0742eSAlex Hornungperm @g3 root:wheel 0644 23814f0742eSAlex Hornungjail no 23914f0742eSAlex Hornunggroup cdrom cd* acd* 24014f0742eSAlex Hornunggroup disks da* 24114f0742eSAlex Hornunggroup disks ad* 24214f0742eSAlex Hornunggroup drives @disks @cdrom 24314f0742eSAlex Hornung 24414f0742eSAlex Hornunggroup test @disks @g2 y 24514f0742eSAlex Hornungshow @drives 24614f0742eSAlex Hornungshow @disks 24714f0742eSAlex Hornungshow @test 24814f0742eSAlex Hornunglink da0 "my drives/my new da0" 24914f0742eSAlex Hornung.Ed 25014f0742eSAlex Hornung.Sh SEE ALSO 25114f0742eSAlex Hornung.Xr devfs 5 , 25214f0742eSAlex Hornung.Xr mount_devfs 8 25314f0742eSAlex Hornung.Sh HISTORY 25414f0742eSAlex HornungThe 25514f0742eSAlex Hornung.Nm 25614f0742eSAlex Hornungutility appeared in 25714f0742eSAlex Hornung.Dx 2.3 . 25814f0742eSAlex Hornung.Sh AUTHORS 25914f0742eSAlex Hornung.An Alex Hornung 260