[arch-commits] Commit in udev/trunk (6 files)
Tobias Powalowski
tpowa at archlinux.org
Sun Aug 31 12:54:46 UTC 2008
Date: Sunday, August 31, 2008 @ 08:54:46
Author: tpowa
Revision: 10765
' removed migrate_udev
removed start_udev
updated readme-udev-arch.txt
removed cdrom-rules.patch
changed 80-drivers.rules to work with module blacklisting
removed unneeded lines from 51-arch.rules
renamed 51-arch.rules to 81-arch.rules to not interfere with standard rules
'
Added:
udev/trunk/81-arch.rules
Modified:
udev/trunk/PKGBUILD
udev/trunk/arch-udev-rules.patch
udev/trunk/cdrom-rules.patch
udev/trunk/readme-udev-arch.txt
udev/trunk/udev.install
-----------------------+
81-arch.rules | 176 ++++++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 40 ++++------
arch-udev-rules.patch | 24 +++---
cdrom-rules.patch | 6 -
readme-udev-arch.txt | 12 +--
udev.install | 5 -
6 files changed, 216 insertions(+), 47 deletions(-)
Added: 81-arch.rules
===================================================================
--- 81-arch.rules (rev 0)
+++ 81-arch.rules 2008-08-31 12:54:46 UTC (rev 10765)
@@ -0,0 +1,176 @@
+# Udev rules for Archlinux by Tobias Powalowski <tpowa at archlinux.org>
+# do not edit this file, it will be overwritten on update
+#
+# This ruleset should provide a DevFS-compatible device tree.
+#
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %k the kernel name for the device.
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute.
+# %% the '%' char itself.
+#
+# 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.
+# global stuff
+#
+
+#####################################
+###### Hotplug rules - begin
+# Only additional modules,
+# which are not detectable,
+# are loaded here!
+#####################################
+# check if the device has already been claimed by a driver
+ACTION!="add", GOTO="drivers_end"
+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/lib/udev/load-modules.sh $env{MODALIAS}"
+
+# SOUND addon modules
+SUBSYSTEM=="sound", RUN+="/lib/udev/load-modules.sh snd-pcm-oss"
+SUBSYSTEM=="sound", RUN+="/lib/udev/load-modules.sh snd-seq-oss"
+
+#PNP addon modules
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP0800", RUN+="/lib/udev/load-modules.sh pcspkr"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="*PNP0510*", RUN+="/lib/udev/load-modules.sh irtty-sir"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="*PNP0511*", RUN+="/lib/udev/load-modules.sh irtty-sir"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNPb02f", RUN+="/lib/udev/load-modules.sh analog"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP0501", RUN+="/lib/udev/load-modules.sh ppp-generic"
+
+# PARPORT addon modules
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh lp"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", ATTRS{id}=="PNP040*", RUN+="/lib/udev/load-modules.sh ppdev"
+
+# fix ide cdrom detection on old proliant servers
+SUBSYSTEM=="pci", ENV{MODALIAS}=="pci:v00000E11d00000001sv00000000sd00000000bc06sc02i00", RUN+="/lib/udev/load-modules.sh ide-generic"
+
+LABEL="drivers_end"
+#####################################
+##### Hotplug rules - end
+#####################################
+
+#####################################
+###### CD/DVD symlinks - begin
+#####################################
+ACTION=="add", SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", IMPORT="cdrom_id --export $tempnode"
+ACTION=="add", SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", IMPORT="cdrom_id --export $tempnode"
+ACTION=="add", SUBSYSTEMS=="scsi", KERNEL=="scd[a-z]", IMPORT="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*", SYMLINK+="cd/cdrom-%b"
+ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cd/cdrw-%b"
+ENV{ID_CDROM_DVD}=="?*", SYMLINK+="cd/dvd-%b"
+ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="cd/dvd-%b"
+ACTION=="add", SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", RUN+="cdsymlinks.sh"
+ACTION=="add", SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", RUN+="cdsymlinks.sh"
+ACTION=="add", SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="5", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="hd[a-z]", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="sr[0-9]*", RUN+="cdsymlinks.sh"
+ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="sg[0-9]*", RUN+="cdsymlinks.sh"
+#####################################
+###### CD/DVD symlinks - end
+#####################################
+
+#####################################
+# Additional Archlinux
+# Permissions and Symlinks - begin
+#####################################
+# fix /dev/root symlink
+SUBSYSTEM=="block", RUN+="root-link.sh"
+
+# permissions for IDE CD devices
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", GROUP="optical"
+
+# permissions for SCSI CD devices
+SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", SYMLINK+="scd%n", GROUP="optical"
+SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="5", GROUP="optical"
+
+# permissions for removable devices like cardreaders or sticks
+KERNEL=="sd*", ATTRS{scsi_level}=="0", ATTRS{type}=="0", GROUP="storage"
+
+# permissions for firewire external drives
+KERNEL=="sd*", ATTRS{scsi_level}=="5", GROUP="storage"
+
+# permissions for usb to scsi external adapters
+KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="7", GROUP="storage"
+
+# permissions for ide storage like pcmcia card readers
+ACTION!="add", GOTO="pcmcia_end"
+SUBSYSTEM!="block", GOTO="pcmcia_end"
+KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
+KERNEL=="hd*", IMPORT{parent}=="ID_*"
+KERNEL=="hd*", ENV{ID_TYPE}=="generic", GROUP="storage"
+LABEL="pcmcia_end"
+
+# permissions for SCSI scanners
+SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="6", GROUP="scanner"
+
+# md block devices
+KERNEL=="md[0-9]*", NAME="md%n", SYMLINK+="md/%n"
+
+# video devices
+SUBSYSTEM=="video4linux", GROUP="video"
+### xorg resets those permissions, adjust your xorg.conf!
+KERNEL=="nvidia*", GROUP="video"
+KERNEL=="3dfx*", GROUP="video"
+
+# i2c devices
+KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k"
+
+# loop devices
+KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k"
+
+# misc
+KERNEL=="nvram", NAME="misc/%k", SYMLINK+="%k", GROUP="kmem", MODE="0640"
+KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k"
+KERNEL=="uinput", NAME="misc/%k", SYMLINK+="%k"
+KERNEL=="sgi_fetchop", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666"
+
+# sound devices
+# alsa devices
+SUBSYSTEM=="sound", GROUP="audio"
+# oss devices
+KERNEL=="audio*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="dmmidi*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="admmidi*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="dsp*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="adsp*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="midi*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="amidi*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="mixer*", NAME="sound/%k", SYMLINK+="%k"
+KERNEL=="sequencer*", NAME="sound/%k", SYMLINK+="%k"
+
+# USB devices
+KERNEL=="hiddev*", NAME="usb/%k"
+KERNEL=="legousbtower*", NAME="usb/%k", MODE="0666"
+KERNEL=="dabusb*", NAME="usb/%k"
+
+# 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"
+### ! disabled seems to break device creation !
+# KERNEL=="tap*", NAME="netlink/%k"
+
+# IEEE1394 (firewire) devices
+KERNEL=="raw1394", NAME="%k", GROUP="video"
+
+# kbd devices
+KERNEL=="kbd", MODE="0664"
+
+#######################################
+# Permissions and Symlinks - end
+#######################################
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2008-08-31 12:53:21 UTC (rev 10764)
+++ PKGBUILD 2008-08-31 12:54:46 UTC (rev 10765)
@@ -2,8 +2,8 @@
# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
# Maintainer: Thomas Bächler <thomas at archlinux.org>
pkgname=udev
-pkgver=126
-pkgrel=2
+pkgver=127
+pkgrel=1
pkgdesc="The userspace dev tools (udev)"
arch=(i686 x86_64)
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
@@ -20,17 +20,12 @@
replaces=('devfsd')
options=(!makeflags)
source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgname-$pkgver.tar.bz2
- migrate-udev start_udev 51-arch.rules load-modules.sh
- cdsymlinks.sh root-link.sh readme-udev-arch.txt arch-udev-rules.patch)
-md5sums=('502964d8623b81b6565c727dd28024de'
- '49434a593918c822077bc3af765f1aff'
- 'a68a519d1ed8cbbd2f45c23eb32ea218'
- '082e76ef9053495a5cade321817467cd'
- '945f6d30ab458189b3c17f8e6722da1f'
- '8424b78e9dd772e75b4ef90814807815'
- '2d6dc6842464f107bccc68cd505a6c31'
- '780db5316a762dc5cdcf52027ab8a8eb'
- 'c43a736b66edadadd9b91b8af1aa2d1c')
+ 81-arch.rules
+ load-modules.sh
+ cdsymlinks.sh
+ root-link.sh
+ readme-udev-arch.txt
+ arch-udev-rules.patch)
build() {
cd $startdir/src/$pkgname-$pkgver
@@ -38,9 +33,7 @@
make || return 1
make DESTDIR=$startdir/pkg install
- install -D -m755 $startdir/src/start_udev $startdir/pkg/etc/start_udev
- install -D -m755 $startdir/src/migrate-udev $startdir/pkg/sbin/migrate-udev
- install -D -m644 $startdir/src/51-arch.rules $startdir/pkg/etc/udev/rules.d/51-arch.rules
+ install -D -m644 $startdir/src/81-arch.rules $startdir/pkg/lib/udev/rules.d/81-arch.rules
# install our module loading subsystem
install -D -m755 $startdir/src/load-modules.sh $startdir/pkg/lib/udev/load-modules.sh
# install cdsymlinks.sh
@@ -54,21 +47,20 @@
# disable error loggin to prevent startup failures printed to vc on boot
sed -i -e 's|udev_log="err"|udev_log="0"|g' $startdir/pkg/etc/udev/udev.conf
# install additional rules files
- for rule in $startdir/src/$pkgname-$pkgver/rules/packages/*; do
+ for rule in $startdir/src/$pkgname-$pkgver/rules/packages/*.rules; do
install -D -m 644 $rule $startdir/pkg/lib/udev/rules.d/
done
- # fix 60-cdrom_id.rules
- cd $startdir/pkg/lib/udev/rules.d/
- #patch -Np0 -i $startdir/src/cdrom-rules.patch || return 1
# fix standard udev rules to fit to arch
+ cd $startdir/pkg/lib/udev/rules.d/
patch -Np0 -i $startdir/src/arch-udev-rules.patch || return 1
# fix modprobe rules to use the load-modules.sh
- sed -i -e "s#/sbin/modprobe#/lib/udev/load-modules.sh#g" $startdir/pkg/etc/udev/rules.d/*
- # disable persistent cdromsymlinks and network by default
+ sed -i -e "s#/sbin/modprobe#/lib/udev/load-modules.sh#g" $startdir/pkg/lib/udev/rules.d/*
+ # disable persistent cdromsymlinks and network by default
+ # and move it to /etc/udev/rules.d
mv $startdir/pkg/lib/udev/rules.d/75-persistent-net-generator.rules \
- $startdir/pkg/lib/udev/rules.d/75-persistent-net-generator.rules.optional
+ $startdir/pkg/etc/udev/rules.d/75-persistent-net-generator.rules.optional
mv $startdir/pkg/lib/udev/rules.d/75-cd-aliases-generator.rules \
- $startdir/pkg/lib/udev/rules.d/75-cd-aliases-generator.rules.optional
+ $startdir/pkg/etc/udev/rules.d/75-cd-aliases-generator.rules.optional
# create framebuffer blacklist
mkdir -p $startdir/pkg/etc/modprobe.d/
for mod in $(find /lib/modules/ -name '*fb*.ko' -exec basename {} .ko \;); do
Modified: arch-udev-rules.patch
===================================================================
--- arch-udev-rules.patch 2008-08-31 12:53:21 UTC (rev 10764)
+++ arch-udev-rules.patch 2008-08-31 12:54:46 UTC (rev 10765)
@@ -9,20 +9,24 @@
# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
---- 80-drivers.rules 2008-07-24 09:55:12.000000000 -0500
-+++ 80-drivers.rules.arch 2008-08-28 00:46:39.000000000 -0500
-@@ -2,9 +2,9 @@
-
+--- 80-drivers.rules 2008-03-15 00:05:02.000000000 +0100
++++ 80-drivers.rules.arch 2008-03-21 21:44:28.000000000 +0100
+@@ -3,10 +3,11 @@
ACTION!="add", GOTO="drivers_end"
--DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe $env{MODALIAS}"
-+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/lib/udev/load-modules.sh $env{MODALIAS}"
- SUBSYSTEM=="pnp", DRIVER!="?*", ENV{MODALIAS}!="?*", \
+ DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe $env{MODALIAS}"
+-SUBSYSTEM=="pnp", DRIVER!="?*", ENV{MODALIAS}!="?*", \
- RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
-+ RUN{ignore_error}+="/bin/sh -c 'while read id; do /lib/udev/load-modules.sh pnp:d$$id; /lib/udev/load-modules.sh pnp:c$$id ; done < /sys$devpath/id'"
- SUBSYSTEM=="tifm", RUN+="/sbin/modprobe --all tifm_sd tifm_ms"
- SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block mspro_block"
+-SUBSYSTEM=="tifm", RUN+="/sbin/modprobe --all tifm_sd tifm_ms"
+-SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block mspro_block"
++SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", DRIVER!="?*", RUN{ignore_error}+="/bin/sh -c 'while read id; do /lib/udev/load-modules.sh pnp:d$$id; /lib/udev/load-modules.sh pnp:c$$id ; done < /sys$devpath/id'"
++SUBSYSTEM=="tifm", RUN+="/lib/udev/load-modules.sh tifm_sd"
++SUBSYSTEM=="tifm", RUN+="/lib/udev/load-modules.sh tifm_ms"
++SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh ms_block"
++SUBSYSTEM=="memstick", RUN+="/lib/udev/load-modules.sh mspro_block"
SUBSYSTEM=="mmc", RUN+="/sbin/modprobe mmc_block"
+ SUBSYSTEM=="i2o", RUN+="/sbin/modprobe i2o_block"
+ SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/sbin/modprobe ide-scsi"
--- 50-udev-default.rules 2008-07-30 06:20:21.000000000 -0500
+++ 50-udev-default.rules.arch 2008-08-29 18:22:41.000000000 -0500
@@ -4,12 +4,17 @@
Modified: cdrom-rules.patch
===================================================================
--- cdrom-rules.patch 2008-08-31 12:53:21 UTC (rev 10764)
+++ cdrom-rules.patch 2008-08-31 12:54:46 UTC (rev 10765)
@@ -3,6 +3,6 @@
@@ -1,3 +1,4 @@
# import optical drive properties
--KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
-+KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
-+KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="path_id %p"
+-ACTION=="add|change", KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
++ACTION=="add|change", KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
++ACTION=="add|change", KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", IMPORT{program}="path_id %p"
Modified: readme-udev-arch.txt
===================================================================
--- readme-udev-arch.txt 2008-08-31 12:53:21 UTC (rev 10764)
+++ readme-udev-arch.txt 2008-08-31 12:54:46 UTC (rev 10765)
@@ -1,7 +1,7 @@
==========================
Cold/Hotplugging with Udev
==========================
-Version 1.1.5
+Version 1.1.6
written by Tobias Powalowski <tpowa at archlinux.org>
---------------
@@ -48,6 +48,8 @@
in most cases it will be empty.
--- snap Changelog Udev 098
- optional udev >= 099 Persistent rules generator for network and cd/dvd devices was added.
+- default udev rules are installed to /lib/udev/rules.d/, they can be overriden by placing
+ own rules files to /etc/udev/rules.d/ .
---------------
* How it works:
@@ -57,7 +59,7 @@
- Udev loads the modules simultaneously, which is much faster,
but can cause some troubles with multiple network/sound/etc devices
(see below).
-- To reload your rules please use /etc/start_udev.
+- To reload your rules please use '/sbin/udevadm trigger'.
======================
* Autoloading modules:
@@ -113,7 +115,7 @@
- To enable this feature copy in /etc/udev/rules.d
75-cd-aliases-generator.rules.optinal
to 75-cd-aliases-generator.rules
- Also disable this part in /etc/udev/rules.d/40-arch.rules by putting a # in front:
+ Also disable this part in /lib/udev/rules.d/81-arch.rules by putting a # in front:
--- snip
ACTION=="add", SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", RUN+="/lib/udev/cdsymlinks.sh"
ACTION=="add", SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", ATTRS{type}=="5", RUN+="/lib/udev/cdsymlinks.sh"
@@ -124,7 +126,7 @@
--- snap
- To get the same device name for CD/DVD symlinks each time you boot,
- a rule will be generated during bootup or by executing /etc/start_udev.
+ a rule will be generated during bootup or by executing '/sbin/udevadm trigger'.
- Examples: dvd, cdrom ,cdrw etc.
- If you want to change those links,
modify '/etc/udev/rules.d/70-peristent-cd.rules' to your needs.
@@ -142,7 +144,7 @@
75-persistent-net-generator.rules.optional
to 75-persistent-net-generator.rules
- To get the same network device name each time you boot,
- a rule will be generated during bootup or by executing /etc/start_udev.
+ a rule will be generated during bootup or by executing '/sbin/udevadm trigger'.
- Examples: eth0, eth1, wlan0 etc.
- If you want to change those names,
modify '/etc/udev/rules.d/70-peristent-net.rules' to your needs.
Modified: udev.install
===================================================================
--- udev.install 2008-08-31 12:53:21 UTC (rev 10764)
+++ udev.install 2008-08-31 12:54:46 UTC (rev 10765)
@@ -1,9 +1,4 @@
# arg 1: the new package version
-post_install() {
- sbin/migrate-udev `pwd`
-}
-
-# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
if [ "$(vercmp $2 100)" -lt 0 ]; then
More information about the arch-commits
mailing list