User Tools

Site Tools


system:udev

UDEV: Userspace DevFS

Information Gathering

To get information about what udev is doing, use:

udevmonitor

for even more information, the '-v' flag is useful:

udevmonitor -v

Samples Of Custom Rules

changing permissions of device files

This sets the permissions of the file /dev/nvram to 0660:

KERNEL=="nvram", NAME="%k", GROUP="nvram", MODE="0660"

renaming network interfaces

I found two methods, this is my own one:

ACTION=="add", BUS=="pci", DRIVERS=="3c59x", NAME:="3com%n"

another one, found in Gentoo Linux:

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:0a:e4:2e:c5:26", NAME="e1000"

Running Scripts

These two start/stop chipcardd2 according to reader insertion/removal:

ACTION=="add", SUBSYSTEM=="usb", ENV{PRODUCT}=="c4b/300/100", RUN="/etc/init.d/chipcardd2 --quiet start"
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="c4b/300/100", RUN="/etc/init.d/chipcardd2 --quiet stop"
system/udev.txt · Last modified: 2006/12/04 22:16 by 127.0.0.1