# Copyright (c) 2012, Piotr Karbowski # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without modification, are # # permitted provided that the following conditions are met: # # # # * Redistributions of source code must retain the above copyright notice, this list # # of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, this list # # of conditions and the following disclaimer in the documentation and/or other # # materials provided with the distribution. # # * Neither the name of the Piotr Karbowski nor the names of its contributors may be # # used to endorse or promote products derived from this software without specific # # prior written permission. # # # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY # # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL # # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US # # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Syntax: # [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] # [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] # [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...] # # [-]: do not stop on this match, continue reading mdev.conf # =: move, >: move and create a symlink # !: do not create device node # @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases # support module loading on hotplug $MODALIAS=.* root:root 660 @modprobe -b "$MODALIAS" # null may already exist; therefore ownership has to be changed with command null root:root 666 @chmod 666 $MDEV zero root:root 666 full root:root 666 random root:root 444 urandom root:root 444 hwrandom root:root 444 grsec root:root 660 # Kernel-based Virtual Machine. kmem root:root 640 mem root:root 640 port root:root 640 # console may already exist; therefore ownership has to be changed with command console root:tty 600 @chmod 600 $MDEV ptmx root:tty 666 pty.* root:tty 660 # Typical devices tty root:tty 666 tty[0-9]* root:tty 660 vcsa*[0-9]* root:tty 660 ttyS[0-9]* root:uucp 660 # block devices ram([0-9]*) root:disk 660 >rd/%1 loop([0-9]+) root:disk 660 >loop/%1 sd[a-z].* root:disk 660 */etc/mdev/storage-device vd[a-z].* root:disk 660 */etc/mdev/storage-device hd[a-z].* root:disk 660 */etc/mdev/storage-device md[0-9]* root:disk 660 */etc/mdev/storage-device dm-[0-9]* root:disk 660 */etc/mdev/storage-device mmcblk[0-9].* root:disk 660 */etc/mdev/storage-device sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom fd[0-9]* root:floppy 660 # Run settle-nics every time new NIC appear. # If you don't want to auto-populate /etc/mactab with NICs, run 'settle-nis' without '--write-mactab' param. -SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/etc/mdev/settle-nics --write-mactab net/tun[0-9]* root:root 660 net/tap[0-9]* root:root 600 # alsa sound devices and audio stuff SUBSYSTEM=sound;.* root:audio 660 adsp root:audio 660 >sound/ audio root:audio 660 >sound/ dsp root:audio 660 >sound/ mixer root:audio 660 >sound/ sequencer.* root:audio 660 >sound/ # raid controllers cciss!(.*) root:disk 660 =cciss/%1 ida!(.*) root:disk 660 =ida/%1 rd!(.*) root:disk 660 =rd/%1 fuse root:root 666 card[0-9] root:video 660 =dri/ agpgart root:root 660 >misc/ psaux root:root 660 >misc/ rtc root:root 664 >misc/ # input stuff #SUBSYSTEM=input;.* root:root 600 # v4l stuff vbi[0-9] root:video 660 >v4l/ video[0-9] root:video 660 >v4l/ # dvb stuff dvb.* root:video 660 # Don't create old usbdev* devices. usbdev[0-9].[0-9]* root:root 660 ! # Stop creating x:x:x:x which looks like /dev/dm-* [0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 ! # /dev/cpu support. microcode root:root 600 =cpu/ cpu([0-9]+) root:root 600 =cpu/%1/cpuid msr([0-9]+) root:root 600 =cpu/%1/msr # Populate /dev/bus/usb. SUBSYSTEM=usb;DEVTYPE=usb_device;.* root:root 660 */etc/mdev/proc-bus-usb