Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 1 | # |
| 2 | # This is a sample mdev.conf |
| 3 | # |
| 4 | |
| 5 | # Provide user, group, and mode information for devices. If a regex matches |
| 6 | # the device name provided by sysfs, use the appropriate user:group and mode |
| 7 | # instead of the default 0:0 660. |
| 8 | # |
| 9 | # Syntax: |
Denys Vlasenko | 5bce135 | 2013-02-27 10:51:41 +0100 | [diff] [blame^] | 10 | # [-][ENVVAR=regex;]...devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] |
| 11 | # [-][ENVVAR=regex;]...@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] |
| 12 | # [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 13 | # |
Denys Vlasenko | ea57f51 | 2012-05-18 11:39:57 +0200 | [diff] [blame] | 14 | # [-]: do not stop on this match, continue reading mdev.conf |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 15 | # =: move, >: move and create a symlink |
Denys Vlasenko | ea57f51 | 2012-05-18 11:39:57 +0200 | [diff] [blame] | 16 | # !: do not create device node |
| 17 | # @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 18 | |
Denys Vlasenko | 44f8d01 | 2009-11-07 18:21:03 +0100 | [diff] [blame] | 19 | # support module loading on hotplug |
| 20 | $MODALIAS=.* root:root 660 @modprobe "$MODALIAS" |
| 21 | |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 22 | # null may already exist; therefore ownership has to be changed with command |
| 23 | null root:root 666 @chmod 666 $MDEV |
| 24 | zero root:root 666 |
| 25 | full root:root 666 |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame] | 26 | random root:root 444 |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 27 | urandom root:root 444 |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame] | 28 | hwrandom root:root 444 |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 29 | grsec root:root 660 |
| 30 | |
| 31 | kmem root:root 640 |
| 32 | mem root:root 640 |
| 33 | port root:root 640 |
| 34 | # console may already exist; therefore ownership has to be changed with command |
| 35 | console root:tty 600 @chmod 600 $MDEV |
| 36 | ptmx root:tty 666 |
| 37 | pty.* root:tty 660 |
| 38 | |
| 39 | # Typical devices |
| 40 | |
| 41 | tty root:tty 666 |
| 42 | tty[0-9]* root:tty 660 |
| 43 | vcsa*[0-9]* root:tty 660 |
| 44 | ttyS[0-9]* root:uucp 660 |
| 45 | |
| 46 | # block devices |
| 47 | ram([0-9]*) root:disk 660 >rd/%1 |
| 48 | loop([0-9]+) root:disk 660 >loop/%1 |
| 49 | sd[a-z].* root:disk 660 */lib/mdev/usbdisk_link |
| 50 | hd[a-z][0-9]* root:disk 660 */lib/mdev/ide_links |
| 51 | md[0-9]* root:disk 660 |
| 52 | sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom |
| 53 | fd[0-9]* root:floppy 660 |
| 54 | |
| 55 | # net devices |
Denys Vlasenko | 5bce135 | 2013-02-27 10:51:41 +0100 | [diff] [blame^] | 56 | SUBSYSTEM=net;.* root:root 600 @nameif |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 57 | tun[0-9]* root:root 600 =net/ |
| 58 | tap[0-9]* root:root 600 =net/ |
| 59 | |
| 60 | # alsa sound devices and audio stuff |
| 61 | pcm.* root:audio 660 =snd/ |
| 62 | control.* root:audio 660 =snd/ |
| 63 | midi.* root:audio 660 =snd/ |
| 64 | seq root:audio 660 =snd/ |
| 65 | timer root:audio 660 =snd/ |
| 66 | |
| 67 | adsp root:audio 660 >sound/ |
| 68 | audio root:audio 660 >sound/ |
| 69 | dsp root:audio 660 >sound/ |
| 70 | mixer root:audio 660 >sound/ |
| 71 | sequencer.* root:audio 660 >sound/ |
| 72 | |
| 73 | # Less typical devices |
| 74 | |
| 75 | # raid controllers |
| 76 | cciss!(.*) root:disk 660 =cciss/%1 |
| 77 | ida!(.*) root:disk 660 =ida/%1 |
| 78 | rd!(.*) root:disk 660 =rd/%1 |
| 79 | |
| 80 | ttyLTM[0-9] root:dialout 660 @ln -sf $MDEV modem |
| 81 | ttySHSF[0-9] root:dialout 660 @ln -sf $MDEV modem |
| 82 | slamr root:dialout 660 @ln -sf $MDEV slamr0 |
| 83 | slusb root:dialout 660 @ln -sf $MDEV slusb0 |
Denys Vlasenko | bf40f56 | 2009-11-07 17:54:44 +0100 | [diff] [blame] | 84 | |
Denys Vlasenko | 6e8e666 | 2009-11-07 04:00:03 +0100 | [diff] [blame] | 85 | fuse root:root 666 |
| 86 | |
| 87 | # dri device |
| 88 | card[0-9] root:video 660 =dri/ |
| 89 | |
| 90 | # misc stuff |
| 91 | agpgart root:root 660 >misc/ |
| 92 | psaux root:root 660 >misc/ |
| 93 | rtc root:root 664 >misc/ |
| 94 | |
| 95 | # input stuff |
| 96 | event[0-9]+ root:root 640 =input/ |
| 97 | mice root:root 640 =input/ |
| 98 | mouse[0-9] root:root 640 =input/ |
| 99 | ts[0-9] root:root 600 =input/ |
| 100 | |
| 101 | # v4l stuff |
| 102 | vbi[0-9] root:video 660 >v4l/ |
| 103 | video[0-9] root:video 660 >v4l/ |
| 104 | |
| 105 | # dvb stuff |
| 106 | dvb.* root:video 660 */lib/mdev/dvbdev |
| 107 | |
| 108 | # load drivers for usb devices |
| 109 | usbdev[0-9].[0-9] root:root 660 */lib/mdev/usbdev |
| 110 | usbdev[0-9].[0-9]_.* root:root 660 |
| 111 | |
| 112 | # zaptel devices |
| 113 | zap(.*) root:dialout 660 =zap/%1 |
| 114 | dahdi!(.*) root:dialout 660 =dahdi/%1 |