udev: updated to version 096

This commit is contained in:
Matt Housh 2006-08-03 13:43:56 +00:00
parent 499e2338f2
commit b47c8117c5
10 changed files with 133 additions and 832 deletions

View File

@ -1,46 +1,48 @@
drwxr-xr-x root/root dev/
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/dev.d/
drwxr-xr-x root/root etc/dev.d/default/
drwxr-xr-x root/root etc/dev.d/net/
-rwxr-xr-x root/root etc/dev.d/net/hotplug.dev
drwxr-xr-x root/root etc/hotplug.d/
drwxr-xr-x root/root etc/hotplug.d/default/
lrwxrwxrwx root/root etc/hotplug.d/default/10-udev.hotplug -> /sbin/udevsend
-rw-r--r-- root/root etc/scsi_id.config
drwxr-xr-x root/root etc/udev/
drwxr-xr-x root/root etc/udev/rules.d/
-rw-r--r-- root/root etc/udev/rules.d/50-udev.rules
-rw-r--r-- root/root etc/udev/rules.d/05-udev-early.rules
-rw-r--r-- root/root etc/udev/rules.d/25-lfs.rules
-rw-r--r-- root/root etc/udev/rules.d/26-modprobe.rules
-rw-r--r-- root/root etc/udev/rules.d/27-firmware.rules
-rw-r--r-- root/root etc/udev/rules.d/60-persistent-storage.rules
-rw-r--r-- root/root etc/udev/rules.d/81-cdrom.rules
-rw-r--r-- root/root etc/udev/udev.conf
drwxr-xr-x root/root lib/
lrwxrwxrwx root/root lib/libvolume_id.so.0 -> libvolume_id.so.0.62.0
-rwxr-xr-x root/root lib/libvolume_id.so.0.62.0
drwxr-xr-x root/root lib/firmware/
lrwxrwxrwx root/root lib/libvolume_id.so.0 -> libvolume_id.so.0.66.0
-rwxr-xr-x root/root lib/libvolume_id.so.0.66.0
drwxr-xr-x root/root lib/udev/
-rwxr-xr-x root/root lib/udev/ata_id
-rwxr-xr-x root/root lib/udev/cdrom_id
-rwxr-xr-x root/root lib/udev/cdsymlinks
-rwxr-xr-x root/root lib/udev/create_floppy_devices
drwxr-xr-x root/root lib/udev/devices/
crw------- root/root lib/udev/devices/console (5, 1)
lrwxrwxrwx root/root lib/udev/devices/core -> /proc/kcore
lrwxrwxrwx root/root lib/udev/devices/fd -> /proc/self/fd
crw-rw-rw- root/root lib/udev/devices/null (1, 3)
drwxr-xr-x root/root lib/udev/devices/pts/
drwxr-xr-x root/root lib/udev/devices/shm/
lrwxrwxrwx root/root lib/udev/devices/stderr -> /proc/self/fd/2
lrwxrwxrwx root/root lib/udev/devices/stdin -> /proc/self/fd/0
lrwxrwxrwx root/root lib/udev/devices/stdout -> /proc/self/fd/1
crw-rw-rw- root/root lib/udev/devices/zero (1, 5)
-rwxr-xr-x root/root lib/udev/firmware_helper
-rwxr-xr-x root/root lib/udev/udev_run_devd
-rwxr-xr-x root/root lib/udev/udev_run_hotplugd
-rwxr-xr-x root/root lib/udev/edd_id
-rwxr-xr-x root/root lib/udev/firmware.sh
-rwxr-xr-x root/root lib/udev/path_id
-rwxr-xr-x root/root lib/udev/scsi_id
-rwxr-xr-x root/root lib/udev/usb_id
-rwxr-xr-x root/root lib/udev/vol_id
drwxr-xr-x root/root sbin/
-rwxr-xr-x root/root sbin/ata_id
-rwxr-xr-x root/root sbin/cdrom_id
-rwxr-xr-x root/root sbin/create_floppy_devices
-rwxr-xr-x root/root sbin/firmware_helper
-rwxr-xr-x root/root sbin/path_id
-rwxr-xr-x root/root sbin/scsi_id
lrwxrwxrwx root/root sbin/scsi_id -> /lib/udev/scsi_id
-rwxr-xr-x root/root sbin/start_udev
-rwxr-xr-x root/root sbin/udev
-rwxr-xr-x root/root sbin/udevcontrol
-rwxr-xr-x root/root sbin/udevd
-rwxr-xr-x root/root sbin/udevsend
-rwxr-xr-x root/root sbin/udevsettle
-rwxr-xr-x root/root sbin/udevstart
-rwxr-xr-x root/root sbin/udevtrigger
-rwxr-xr-x root/root sbin/usb_id
-rwxr-xr-x root/root sbin/vol_id
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/udevinfo
@ -49,7 +51,7 @@ drwxr-xr-x root/root usr/include/
-rw-r--r-- root/root usr/include/libvolume_id.h
drwxr-xr-x root/root usr/lib/
-rwxr-xr-x root/root usr/lib/libvolume_id.a
lrwxrwxrwx root/root usr/lib/libvolume_id.so -> /lib/libvolume_id.so.0.62.0
lrwxrwxrwx root/root usr/lib/libvolume_id.so -> /lib/libvolume_id.so.0.66.0
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/libvolume_id.pc
drwxr-xr-x root/root usr/man/
@ -58,14 +60,13 @@ drwxr-xr-x root/root usr/man/man7/
drwxr-xr-x root/root usr/man/man8/
-rw-r--r-- root/root usr/man/man8/ata_id.8.gz
-rw-r--r-- root/root usr/man/man8/cdrom_id.8.gz
-rw-r--r-- root/root usr/man/man8/edd_id.8.gz
-rw-r--r-- root/root usr/man/man8/scsi_id.8.gz
lrwxrwxrwx root/root usr/man/man8/udevcontrol.8.gz -> udevd.8.gz
-rw-r--r-- root/root usr/man/man8/udevd.8.gz
-rw-r--r-- root/root usr/man/man8/udevinfo.8.gz
-rw-r--r-- root/root usr/man/man8/udevmonitor.8.gz
-rw-r--r-- root/root usr/man/man8/udevsend.8.gz
-rw-r--r-- root/root usr/man/man8/udevsettle.8.gz
-rw-r--r-- root/root usr/man/man8/udevstart.8.gz
-rw-r--r-- root/root usr/man/man8/udevtest.8.gz
-rw-r--r-- root/root usr/man/man8/udevtrigger.8.gz
-rw-r--r-- root/root usr/man/man8/vol_id.8.gz

View File

@ -1,3 +1,5 @@
a7d745a3f3b8e222b6957aefec1cdd2f start_udev
4151022ea7b4dcfaa768c1b7bf2ab9e5 udev-091.tar.bz2
7d25125f0fd94546b676c3195237656b udev.rules
c0da74341672681c9bd924439ea4e84d cdrom.rules
6c4a8bd7aef573838305e212ffb9bc6a cdsymlinks
00a1035b4c7c289ce2f2cb5040dc611e start_udev
f4effef7807ce1dc91ab581686ef197b udev-096.tar.bz2
6ef52d52f45ca91daea3cfa840d1083b udev-config-20060715.tar.bz2

View File

@ -1,41 +1,38 @@
# Description: Userspace device management daemon
# URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
# Maintainer: Matt Housh, jaeger at morpheus dot net
# Depends on: hotplug
name=udev
version=091
version=096
release=1
source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$name-$version.tar.bz2 \
udev.rules start_udev)
source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$name-$version.tar.bz2
http://www.linuxfromscratch.org/lfs/downloads/development/udev-config-20060715.tar.bz2
start_udev cdrom.rules cdsymlinks)
build() {
cd $name-$version
sed -i -e 's/$(OPTIMIZATION)//' Makefile
make \
USE_KLIBC=false \
USE_LOG=true \
DEBUG=false \
EXTRAS="extras/scsi_id extras/volume_id extras/ata_id extras/run_directory extras/usb_id extras/floppy extras/cdrom_id extras/firmware" \
udevdir="/dev" \
mandir="/usr/man" \
DESTDIR=$PKG all install
# udev, udevsend, udevstart need to be installed manually now
install -m 0755 udev{,send,start} $PKG/sbin/
# man pages
install -m 0644 udev{send,start}.8 $PKG/usr/man/man8/
install -m 0644 $SRC/udev.rules \
$PKG/etc/udev/rules.d/50-udev.rules
install -D -m 0755 $SRC/start_udev $PKG/sbin/start_udev
install extras/path_id/path_id extras/floppy/create_floppy_devices \
extras/firmware/firmware_helper $PKG/sbin/
mv $PKG/lib/udev/*_id $PKG/sbin/
mkdir -p $PKG/etc/hotplug.d/default
ln -s /sbin/udevsend $PKG/etc/hotplug.d/default/10-udev.hotplug
mkdir -p $PKG/etc/dev.d/{default,net}
install extras/run_directory/dev.d/net/hotplug.dev $PKG/etc/dev.d/net/
mkdir -p $PKG/lib/udev/devices
mknod -m 0666 $PKG/lib/udev/devices/null c 1 3
mknod -m 0666 $PKG/lib/udev/devices/zero c 1 5
mknod -m 0600 $PKG/lib/udev/devices/console c 5 1
cd udev-$version
make all install \
EXTRAS="extras/ata_id \
extras/cdrom_id \
extras/edd_id \
extras/firmware \
extras/floppy \
extras/path_id \
extras/scsi_id \
extras/usb_id \
extras/volume_id" \
DESTDIR=$PKG mandir="/usr/man"
mkdir -p $PKG/lib/{firmware,udev/devices/{pts,shm}}
mknod -m 600 $PKG/lib/udev/devices/console c 5 1
mknod -m 666 $PKG/lib/udev/devices/null c 1 3
mknod -m 666 $PKG/lib/udev/devices/zero c 1 5
ln -s /proc/self/fd $PKG/lib/udev/devices/fd
ln -s /proc/self/fd/0 $PKG/lib/udev/devices/stdin
ln -s /proc/self/fd/1 $PKG/lib/udev/devices/stdout
ln -s /proc/self/fd/2 $PKG/lib/udev/devices/stderr
ln -s /proc/kcore $PKG/lib/udev/devices/core
cp $SRC/udev-config-20060715/*.rules $PKG/etc/udev/rules.d/
install -m 0755 $SRC/start_udev $PKG/sbin
install -m 0755 $SRC/cdsymlinks $PKG/lib/udev/
cat $SRC/cdrom.rules >> $PKG/etc/udev/rules.d/81-cdrom.rules
}

View File

@ -1,51 +0,0 @@
README for udev
The information formerly in this README is now available in the
devfs_to_udev_README file located in this directory.
This version of the udev port uses a modified gentoo start_udev
script and a slightly modified gentoo udev.rules file. The reason
for this is simply that I wish to spend less time maintaining
them and the gentoo people are doing a great job there. The
previous crux rules file is available in this directory as
crux-udev.rules but isn't installed with the port.
------------------------------------------------------------------
*IMPORTANT* - I don't intend to support the devfs-style names
forever. I've already removed the ide-devfs and scsi-devfs scripts
from the udev port. You'll need to edit your fstab and such to
reflect this if you use the devfs-style names. Eventally this
will also affect logins as /etc/inittab and /etc/securetty use
devfs-style vc/* notation, which needs to be changed to tty*. This
release contains legacy vc/* symlinks but this will change in the
future.
------------------------------------------------------------------
As a side note, I recommend a slightly different /etc/rc setup
than the original README. The appropriate sections look like this:
--------------------------------
# Start udev
/bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys
/sbin/start_udev
--------------------------------
--------------------------------
# Mount local filesystems
/bin/mount -n -o remount,rw /
/bin/umount /sys /proc
/bin/rm -f /etc/mtab*
/bin/mount -a -O no_netdev
--------------------------------
This depends on your system having lines for /sys and /proc in
the fstab file, unlike the original README, but it cleans up
mount/mtab info. For reference, I use the following lines in
/etc/fstab:
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0

18
udev/cdrom.rules Normal file
View File

@ -0,0 +1,18 @@
ACTION=="add", BUS=="ide", KERNEL=="hd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
ACTION=="add", BUS=="scsi", KERNEL=="sr[0-9]*", IMPORT="/lib/udev/cdrom_id --export $tempnode"
ACTION=="add", BUS=="scsi", KERNEL=="scd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
ENV{ID_CDROM}=="?*", SYMLINK+="cdrom-%b"
ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw-%b"
ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd-%b"
ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="dvd-%b"
ACTION=="add", BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}=="1", SYSFS{media}=="cdrom*", RUN+="/lib/udev/cdsymlinks"
ACTION=="add", BUS=="scsi", KERNEL=="sr[0-9]*", SYSFS{type}=="5", RUN+="/lib/udev/cdsymlinks"
ACTION=="add", BUS=="scsi", KERNEL=="sg[0-9]*", SYSFS{type}=="5", RUN+="/lib/udev/cdsymlinks"
ACTION=="remove", BUS=="block", KERNEL=="hd[a-z]", RUN+="/lib/udev/cdsymlinks"
ACTION=="remove", BUS=="block", KERNEL=="sr[0-9]*", RUN+="/lib/udev/cdsymlinks"
ACTION=="remove", BUS=="block", KERNEL=="sg[0-9]*", RUN+="/lib/udev/cdsymlinks"

41
udev/cdsymlinks Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh
for i in /dev/cdrom-*
do
if [ -L $i ]
then
[ "$CD_NUM" = "" ] && ln -s $i /dev/cdrom
[ "$CD_NUM" = "" ] && CD_NUM="-1"
[ ! "$CD_NUM" = "" ] && CD_NUM="$((CD_NUM+1))" && ln -s $i /dev/cdrom$CD_NUM
fi
done
for i in /dev/cdrw-*
do
if [ -L $i ]
then
[ "$CDRW_NUM" = "" ] && ln -s $i /dev/cdrw
[ "$CDRW_NUM" = "" ] && CDRW_NUM="-1"
[ ! "$CDRW_NUM" = "" ] && CDRW_NUM="$((CDRW_NUM+1))" && ln -s $i /dev/cdrw$CDRW_NUM
fi
done
for i in /dev/dvd-*
do
if [ -L $i ]
then
[ "$DVD_NUM" = "" ] && ln -s $i /dev/dvd
[ "$DVD_NUM" = "" ] && DVD_NUM="-1"
[ ! "$DVD_NUM" = "" ] && DVD_NUM="$((DVD_NUM+1))" && ln -s $i /dev/dvd$DVD_NUM
fi
done
for i in /dev/dvdrw-*
do
if [ -L $i ]
then
[ "$DVDRW_NUM" = "" ] && ln -s $i /dev/dvdrw
[ "$DVDRW_NUM" = "" ] && DVDRW_NUM="-1"
[ ! "$DVDRW_NUM" = "" ] && DVDRW_NUM="$((DVDRW_NUM+1))" && ln -s $i /dev/dvdrw$DVDRW_NUM
fi
done

View File

@ -1,157 +0,0 @@
# /etc/udev/rules/50-udev.rules - crux udev device naming rules
# block devices get assigned to the "disk" group
SUBSYSTEM=="block", GROUP="disk"
# useful cdrom symlinks
BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
BUS=="scsi", KERNEL=="scd[0-9]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
ENV{ID_CDROM}=="?*", SYMLINK+="cdrom%e"
ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%e"
ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd%e"
ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+=dvdrw%e"
# devfs-style symlinks as well (ide-devfs.sh returns 3 items, we only want the first 2)
BUS=="ide", KERNEL=="hd*", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK+="%c{1} %c{2}"
# scsi-devfs.sh returns 5, we care about 3 and 5
BUS=="scsi", KERNEL=="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%k", SYMLINK+="%c{3} %c{5}"
# persistent device links in /dev/disk
KERNEL=="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode"
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="dist/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
KERNEL=="sd*[!0-9]", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/usb_id -x"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -s %p -d %N"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -a -s %p -d %N"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
# floppy devices
KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK="%k"
# loop devices
KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
# md devices
KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK="%k"
# DRI devices (LSB spec)
KERNEL=="card*", NAME="dri/card%n", GROUP="video", MODE="0666"
# nvidia/3dfx video devices
KERNEL=="nvidia*", NAME="%k", GROUP="video"
KERNEL=="3dfx*", NAME="%k", GROUP="video"
# sound devices get assigned to the "audio" group
SUBSYSTEM=="sound", GROUP="audio"
# ALSA sound devices
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
# OSS sound devices
KERNEL=="adsp", NAME="sound/%k", SYMLINK="%k"
KERNEL=="adsp[0-9]*", NAME="sound/%k", SYMLINK="%k"
KERNEL=="audio", NAME="sound/%k", SYMLINK="%k"
KERNEL=="audio[0-9]*", NAME="sound/%k", SYMLINK="%k"
KERNEL=="dsp", NAME="sound/%k", SYMLINK="%k"
KERNEL=="dsp[0-9]*", NAME="sound/%k", SYMLINK="%k"
KERNEL=="mixer", NAME="sound/%k", SYMLINK="%k"
KERNEL=="mixer[0-9]*", NAME="sound/%k", SYMLINK="%k"
KERNEL=="sequencer", NAME="sound/%k", SYMLINK="%k"
KERNEL=="sequencer[0-9]*", NAME="sound/%k", SYMLINK="%k"
# input devices
KERNEL=="mice", NAME="input/%k", MODE="0644"
KERNEL=="mouse*", NAME="input/%k", MODE="0644"
KERNEL=="event*", NAME="input/%k", MODE="0600"
KERNEL=="js*", NAME="input/%k", MODE="0644"
KERNEL=="ts*", NAME="input/%k", MODE="0600"
# USB devices
KERNEL=="hiddev*", NAME="usb/%k"
KERNEL=="auer*", NAME="usb/%k"
KERNEL=="legousbtower*", NAME="usb/%k"
KERNEL=="dabusb*", NAME="usb/%k"
BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
# CAPI devices
KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
KERNEL=="capi*", NAME="capi/%n"
# network devices
KERNEL=="tun", NAME="net/%k"
# raw devices
KERNEL=="raw[0-9]*", NAME="raw/%k"
# framebuffer devices
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK="%k", GROUP="video"
# V4L devices
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK="video%n", GROUP="video"
KERNEL=="radio[0-9]*", NAME="v4l/radeo%n", SYMLINK="radeo%n", GROUP="video"
KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK="vbi%n", GROUP="video"
KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", SYMLINK="vtx%n", GROUP="video"
# DVB devices
KERNEL=="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c", GROUP="video", MODE="0660"
# I2C devices
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
# misc devices
KERNEL=="agpgart", NAME="misc/%k", SYMLINK="%k", MODE="0664"
KERNEL=="psaux", NAME="misc/%k", SYMLINK="%k", MODE="0664"
KERNEL=="rtc", NAME="misc/%k", SYMLINK="%k", MODE="0664"
KERNEL=="inotify", NAME="misc/%k", SYMLINK="%k", MODE="0664"
# tty devices
KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600"
KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666"
KERNEL=="tty[0-9]*", NAME="vc/%n", SYMLINK="%k", GROUP="tty"
KERNEL=="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k", GROUP="tty"
KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", GROUP="tty", MODE="0600"
# mem devices
KERNEL=="random", NAME="%k", MODE="0666"
KERNEL=="urandom", NAME="%k", MODE="0444"
KERNEL=="mem", NAME="%k", MODE="0640"
KERNEL=="kmem", NAME="%k", MODE="0640"
KERNEL=="port", NAME="%k", MODE="0640"
KERNEL=="full", NAME="%k", MODE="0666"
KERNEL=="null", NAME="%k", MODE="0666"
KERNEL=="zero", NAME="%k", MODE="0666"
# pty devices
KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666"
KERNEL=="pty[p-za-f][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k", GROUP="tty"
KERNEL=="tty[p-za-f][0-9a-f]*", NAME="pty/s%n", SYMLINK="%k", GROUP="tty"
# emulate dev.d and hotplug.d
ENV{UDEVD_EVENT}=="1", RUN+="/lib/udev/udev_run_hotplugd"
RUN+="/lib/udev/udev_run_devd"

View File

@ -1,88 +0,0 @@
*** Use the README instead, this file is outdated. ***
README for udev
TITLE: Replace devfs with udev
CRUX VERSION: 1.3+
AUTHOR: CRUX ML members
CATEGORY: filesystem
SYNOPSIS: What to do to get udev running
HINT:
* install hotplug and udev ports (and optionally coldplug)
(and their dependencies) from CLC
* Kernel config:
* disable devfs support
* enable hotplug support
* enable tmpfs support
* (optional) add coldplug to the SERVICES array in /etc/rc.conf
* make the following changes in /etc/rc & /etc/rc.single:
(remember that "-" means the line gets removed,
and "+" means the lines gets added. ;-))
* /etc/rc diff:
- # Start device management daemon
- /sbin/devfsd /dev
+ # Start udev
+ /bin/mount -t sysfs none /sys
+ /bin/mount -t proc none /proc
+ /sbin/start_udev
*** NOTE ***
Han Boetes suggests this as a better way to mount the sysfs
and proc filesystems to avoid problems with improperly unmounted
filesystems being unfixable when their devices are missing due
to a failed udev start:
if ! /bin/mount -t sysfs none /sys; then
/bin/mount -n -t sysfs none /sys
fi
if ! /bin/mount -t proc none /proc; then
/bin/mount -n -t proc none /proc
fi
************
* /etc/rc.single diff:
- # Start device management daemon
- /sbin/devfsd /dev
+ # Start udev
+ /bin/mount -t sysfs none /sys
+ /bin/mount -t proc none /proc
+ /sbin/start_udev
*** see NOTE above ***
* comment or remove the following fstab entries:
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
* add the additional fstab entries (if needed):
(these are in the default fstab, commented)
none /proc/bus/usb usbfs defaults 0 0
none /dev/pts devpts defaults 0 0
* reboot and cross fingers
_________________________________________________________________
If you want to allow users to access the sound and video devices
(nvidia, dri, etc.), add an 'audio' group and a 'video' group to
the system. CRUX's udev install sets the appropriate group
permissions, so just add the user to the 'audio' and 'video'
groups (and log out/back in).
_________________________________________________________________

View File

@ -1,170 +1,17 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#!/bin/sh
# modified for crux 12.20.2005 (jaeger)
# mount /dev as a tmpfs
/bin/mount -n -t tmpfs udev /dev
udev_version() {
local version=0
# unset hotplugger
echo > /proc/sys/kernel/hotplug
if [[ -x /sbin/udev ]] ; then
version=$(/sbin/udev -V)
# We need it without a leading '0', else bash do the wrong thing
version=${version##0}
# Older udevs will print nothing
[[ -z ${version} ]] && version=0
fi
# populate /dev with static nodes and directories
/bin/cp -a /lib/udev/devices/* /dev/
echo "${version}"
}
# launch udev daemon
/sbin/udevd --daemon
# This works for 2.6.15 kernels or greater
trigger_events() {
list=""
# if you want real coldplug (with all modules being loaded for all
# devices in the system), uncomment out the next line.
#list="$list $(echo /sys/bus/*/devices/*/uevent)"
list="$list $(echo /sys/class/*/*/uevent)"
list="$list $(echo /sys/block/*/uevent /sys/block/*/*/uevent)"
for i in $list; do
case "$i" in
*/device/uevent)
# skip followed device symlinks
continue
;;
*/class/mem/*|*/class/tty/*)
first="$first $i"
;;
*/block/md*)
last="$last $i"
;;
*/*)
default="$default $i"
;;
esac
done
# trigger the sorted events
for i in $first $default $last; do
echo "add" > "$i"
done
}
populate_udev() {
# populate /dev with devices already found by the kernel
#if [ "$(get_KV)" -gt "$(KV_to_int '2.6.14')" ] ; then
#ebegin "Populating /dev with existing devices through uevents"
#trigger_events
#eend 0
#else
echo "Populating /dev with existing devices with udevstart..."
/sbin/udevstart
#fi
# loop until everything is finished
# there's gotta be a better way...
echo "Letting udev process events..."
loop=0
while test -d /dev/.udev/queue; do
sleep 0.1;
test "$loop" -gt 300 && break
loop=$(($loop + 1))
done
#einfo "loop = $loop"
return 0
}
seed_dev() {
# Seed /dev with some things that we know we need
echo "Seeding /dev with needed nodes..."
# copy over any persistant things
cp --preserve=all --recursive --update /lib/udev/devices/* /dev
# Not provided by sysfs but needed
ln -snf /proc/self/fd /dev/fd
ln -snf fd/0 /dev/stdin
ln -snf fd/1 /dev/stdout
ln -snf fd/2 /dev/stderr
[[ -e /proc/kcore ]] && ln -snf /proc/kcore /dev/core
# Create problematic directories
mkdir -p /dev/{pts,shm}
}
main() {
# Setup temporary storage for /dev
#echo "Mounting /dev for udev"
#if [[ ${RC_USE_FSTAB} == "yes" ]] ; then
#mntcmd=$(get_mount_fstab /dev)
#else
#unset mntcmd
#fi
#if [[ -n ${mntcmd} ]] ; then
#try mount -n ${mntcmd}
#else
#if egrep -qs tmpfs /proc/filesystems ; then
mntcmd="tmpfs"
#else
#mntcmd="ramfs"
#fi
# many video drivers require exec access in /dev #92921
mount -n -t ${mntcmd} udev /dev -o exec,nosuid,mode=0755
#fi
#eend $?
# Selinux lovin; /selinux should be mounted by selinux-patched init
#if [[ -x /sbin/restorecon && -c /selinux/null ]] ; then
#restorecon /dev &> /selinux/null
#fi
# Actually get udev rolling
#if [[ ${RC_DEVICE_TARBALL} == "yes" && \
#-s /lib/udev-state/devices.tar.bz2 ]] ; then
#ebegin "Populating /dev with saved device nodes"
#try tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev
#eend $?
#fi
seed_dev
# Setup hotplugging (if possible)
echo -n "Setting up hotplug agent... "
if [[ -e /proc/sys/kernel/hotplug ]] ; then
#if [ "$(get_KV)" -gt "$(KV_to_int '2.6.14')" ] ; then
#einfo " Using netlink for hotplug events..."
#echo "" > /proc/sys/kernel/hotplug
if [[ $(udev_version) -ge "48" ]] ; then
echo "/sbin/udevsend"
echo "/sbin/udevsend" > /proc/sys/kernel/hotplug
elif [[ -x /sbin/hotplug ]] ; then
echo "/sbin/hotplug"
else
echo "/sbin/udev"
echo "/sbin/udev" > /proc/sys/kernel/hotplug
fi
fi
#eend 0
echo "Starting udevd..."
/sbin/udevd --daemon
#eend $?
populate_udev
# Create nodes that udev can't
echo "Finalizing udev configuration..."
[[ -x /sbin/dmsetup ]] && /sbin/dmsetup mknodes &>/dev/null
[[ -x /sbin/lvm ]] && \
/sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null
[[ -x /sbin/evms_activate ]] && /sbin/evms_activate -q &>/dev/null
#eend 0
# Same thing as /dev/.devfsd
touch /dev/.udev
}
main
# vim:ts=4
# coldplug devices and wait for the queue to be processed
/sbin/udevtrigger
/sbin/udevsettle

View File

@ -1,309 +0,0 @@
# /etc/udev/rules/50-udev.rules: device naming rules for udev
#
# Gentoo specific rules
#
# There are a number of modifiers that are allowed to be used in some of the
# fields. See the udev man page for a full description of them.
#
# Try not to modify this file, if you wish to change things, create a new rule
# file that can be run before this one.
#
# console
KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule"
KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcs*", NAME="%k", GROUP="tty", OPTIONS="last_rule"
KERNEL=="vcsa*", NAME="%k", GROUP="tty", OPTIONS="last_rule"
KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666", OPTIONS="last_rule"
KERNEL=="tty[0-9]", NAME="%k", GROUP="tty", SYMLINK="vc/%n", OPTIONS="last_rule"
KERNEL=="tty[0-9][0-9]", NAME="%k", GROUP="tty", SYMLINK="vc/%n", OPTIONS="last_rule"
KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600"
KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666"
# tty devices
KERNEL=="ttyS[0-9]*", NAME="%k", SYMLINK="tts/%n", GROUP="tty"
KERNEL=="ttyUSB[0-9]*", NAME="%k", SYMLINK="tts/USB%n", GROUP="tty", MODE="0660"
KERNEL=="ippp0", NAME="%k", GROUP="tty"
KERNEL=="isdn*" NAME="%k", GROUP="tty"
KERNEL=="dcbri*", NAME="%k", GROUP="tty"
KERNEL=="ircomm*", NAME="%k", GROUP="tty"
# all block devices
SUBSYSTEM=="block", GROUP="disk"
# cdrom symlinks and other good cdrom naming
BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
BUS=="scsi", KERNEL=="scd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
BUS=="scsi", KERNEL=="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="disk"
ENV{ID_CDROM}=="?*", SYMLINK+="cdrom%e", GROUP="disk"
ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%e"
ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd%e"
ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="dvdrw%e"
# disk devices
KERNEL=="sd*", NAME="%k", GROUP="disk"
KERNEL=="dasd*", NAME="%k", GROUP="disk"
KERNEL=="ataraid*", NAME="%k", GROUP="disk"
# compaq smart array
KERNEL=="cciss*", PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
KERNEL=="ida*", PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
# mylex
KERNEL=="rd*", PROGRAM="raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
# dri devices
KERNEL=="card*", NAME="dri/card%n", GROUP="video"
KERNEL=="nvidia*", NAME="%k", GROUP="video"
KERNEL=="3dfx*", NAME="%k", GROUP="video"
# alsa devices
SUBSYSTEM=="sound", GROUP="audio"
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hw[CD0-9]*", NAME="snd/%k"
KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
# capi devices
KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout"
KERNEL=="capi*", NAME="capi/%n", GROUP="dialout"
# cpu devices
KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
KERNEL=="microcode", NAME="cpu/microcode"
# dm devices (ignore them)
KERNEL=="dm-[0-9]*", OPTIONS="ignore_device"
# create a symlink named after the device map name
# note devmap_name comes with extras/multipath
#KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c"
KERNEL=="device-mapper", NAME="mapper/control"
# fb devices
KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video"
# floppy devices
KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy"
# i2c devices
KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k"
# input devices
KERNEL=="mice", NAME="input/%k", MODE="0644"
KERNEL=="mouse*", NAME="input/%k", MODE="0644"
KERNEL=="event*", NAME="input/%k", MODE="0600"
KERNEL=="js*", NAME="input/%k", MODE="664"
KERNEL=="ts*", NAME="input/%k", MODE="0600"
# loop devices
KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k", GROUP="disk"
# md block devices
KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK+="%k", GROUP="disk"
# aoe char devices,
SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220"
SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440"
SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220"
# misc devices
KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k"
KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k"
KERNEL=="rtc", NAME="misc/%k", SYMLINK+="%k", MODE="0664"
KERNEL=="uinput", NAME="misc/%k", SYMLINK+="%k"
KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666"
# netlink devices
KERNEL=="route", NAME="netlink/%k"
KERNEL=="skip", NAME="netlink/%k"
KERNEL=="usersock", NAME="netlink/%k"
KERNEL=="fwmonitor", NAME="netlink/%k"
KERNEL=="tcpdiag", NAME="netlink/%k"
KERNEL=="nflog", NAME="netlink/%k"
KERNEL=="xfrm", NAME="netlink/%k"
KERNEL=="arpd", NAME="netlink/%k"
KERNEL=="route6", NAME="netlink/%k"
KERNEL=="ip6_fw", NAME="netlink/%k"
KERNEL=="dnrtmsg", NAME="netlink/%k"
KERNEL=="tap*", NAME="netlink/%k"
# network devices
KERNEL=="tun", NAME="net/%k", MODE="0600"
# ramdisk devices
KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k"
# IEEE1394 (firewire) devices (must be before raw devices below)
KERNEL=="raw1394", NAME="%k", GROUP="video"
KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="video"
KERNEL=="video1394*", NAME="video1394/%n", GROUP="video"
# raw devices
KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk"
KERNEL=="ram*", NAME="%k", GROUP="disk"
# sound devices
KERNEL=="adsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="adsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="audio", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="audio[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="dsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="dsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="mixer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="mixer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="sequencer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
KERNEL=="sequencer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
# memory devices
KERNEL=="random", NAME="%k", MODE="0666"
KERNEL=="urandom", NAME="%k", MODE="0444"
KERNEL=="mem", NAME="%k", MODE="0640"
KERNEL=="kmem", NAME="%k", MODE="0640"
KERNEL=="port", NAME="%k", MODE="0640"
KERNEL=="full", NAME="%k", MODE="0666"
KERNEL=="null", NAME="%k", MODE="0666"
KERNEL=="zero", NAME="%k", MODE="0666"
# usb devices
KERNEL=="hiddev*", NAME="usb/%k"
KERNEL=="auer*", NAME="usb/%k"
KERNEL=="legousbtower*", NAME="usb/%k", GROUP="usb"
KERNEL=="dabusb*", NAME="usb/%k"
BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp"
# v4l devices
KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video"
KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video"
KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video"
KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video"
# dvb devices
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
# Asterisk Zaptel devices
KERNEL=="zapctl", NAME="zap/ctl"
KERNEL=="zaptimer", NAME="zap/timer"
KERNEL=="zapchannel", NAME="zap/channel"
KERNEL=="zappseudo", NAME="zap/pseudo"
KERNEL=="zap[0-9]*", NAME="zap/%n"
# pilot/palm devices
KERNEL=="pilot", NAME="%k", GROUP="uucp"
# jaz devices
KERNEL=="jaz*", NAME="%k", GROUP="disk"
# zip devices
KERNEL=="pocketzip*", NAME="%k", GROUP="disk"
KERNEL=="zip*", NAME="%k", GROUP="disk"
# ls120 devices
KERNEL=="ls120", NAME="%k", GROUP="disk"
# lp devices
KERNEL=="lp*", NAME="%k", GROUP="lp"
KERNEL=="irlpt", NAME="%k", GROUP="lp"
KERNEL=="usblp", NAME="%k", GROUP="lp"
KERNEL=="lp*", NAME="%k", GROUP="lp"
KERNEL=="parport*", NAME="%k", GROUP="lp"
# tape devices
KERNEL=="ht*", NAME="%k", GROUP="tape"
KERNEL=="nht*", NAME="%k", GROUP="tape"
KERNEL=="pt*", NAME="%k", GROUP="tape"
KERNEL=="npt*", NAME="%k", GROUP="tape"
KERNEL=="st*", NAME="%k", GROUP="tape"
KERNEL=="nst*", NAME="%k", GROUP="tape"
KERNEL=="osst*", NAME="%k", GROUP="tape"
KERNEL=="nosst*", NAME="%k", GROUP="tape"
# diskonkey devices
KERNEL=="diskonkey*", NAME="%k", GROUP="disk"
# rem_ide devices
KERNEL=="microdrive*", NAME="%k", GROUP="disk"
# kbd devices
KERNEL=="kbd", NAME="%k", MODE="0664"
# Sony Vaio Jogdial sonypi device
KERNEL=="sonypi", NAME="%k", MODE="0666"
# packet devices
KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrw", MODE="0660"
KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="cdrw", MODE="0660"
# infiniband devices
KERNEL=="umad*", NAME="infiniband/%k"
KERNEL=="issm*", NAME="infiniband/%k"
# tpm devices
KERNEL=="tpm*", NAME="%k", OWNER="tss", GROUP="tss", MODE="0600"
#######################################
# Persistant block device stuff - begin
#######################################
# Skip all of this if we are not adding a block device
ACTION!="add", GOTO="persistent_end"
SUBSYSTEM!="block", GOTO="persistent_end"
KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end"
# skip accessing removable ide devices, cause the ide drivers are horrible broken
BUS=="ide", SYSFS{removable}="1", GOTO="no_volume_id"
BUS=="ide", SYSFS{../removable}="1", GOTO="no_volume_id"
# persistent disk device links /dev/disk/
KERNEL=="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode"
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
KERNEL=="sd*[!0-9]", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/usb_id -x"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -s %p -d %N"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -a -s %p -d %N"
KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*"
KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
# Skip id for ram / loop / fd
KERNEL=="ram*", GOTO="no_volume_id"
KERNEL=="loop*", GOTO="no_volume_id"
KERNEL=="fd*", GOTO="no_volume_id"
KERNEL=="*[!0-9]", ENV{ID_TYPE}=="?*", IMPORT="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
# volume-label/uuid
KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="no_volume_id"
KERNEL=="sr*", GOTO="no_volume_id"
KERNEL=="*[0-9]", IMPORT="/sbin/vol_id --export $tempnode"
KERNEL=="*[0-9]", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
KERNEL=="*[0-9]", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
LABEL="no_volume_id"
LABEL="persistent_end"
#####################################
# Persistant block device stuff - end
#####################################
# usbfs-like device nodes
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644"
# be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems
# run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart
ENV{UDEVD_EVENT}=="1", RUN+="/lib/udev/udev_run_hotplugd $env{SUBSYSTEM}"
# always run /etc/dev.d/ stuff for now.
RUN+="/lib/udev/udev_run_devd $env{SUBSYSTEM}"
# debugging monitor
RUN+="socket:/org/kernel/udev/monitor"