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