From dad9cc7a179efa966154cc5b945f2f6c4da7f477 Mon Sep 17 00:00:00 2001 From: Cecil Hugh Watson Date: Sat, 29 Nov 2008 22:03:49 -0800 Subject: Updated udev to latest (130). --- abs/core-testing/udev/00-load-blacklist.rules | 1 - abs/core-testing/udev/51-arch.rules | 191 -------------------------- abs/core-testing/udev/PKGBUILD | 100 +++++++------- abs/core-testing/udev/arch-udev-rules.patch | 149 ++++++++++---------- abs/core-testing/udev/cdrom-rules.patch | 8 -- abs/core-testing/udev/load-modules.sh | 78 +++++++---- abs/core-testing/udev/migrate-udev | 29 ---- abs/core-testing/udev/mod-blacklist.sh | 47 ------- abs/core-testing/udev/readme-udev-arch.txt | 12 +- abs/core-testing/udev/udev.install | 20 ++- abs/core-testing/udev/usb_id-fix.patch | 107 --------------- 11 files changed, 196 insertions(+), 546 deletions(-) delete mode 100644 abs/core-testing/udev/00-load-blacklist.rules delete mode 100644 abs/core-testing/udev/51-arch.rules delete mode 100644 abs/core-testing/udev/cdrom-rules.patch delete mode 100644 abs/core-testing/udev/migrate-udev delete mode 100755 abs/core-testing/udev/mod-blacklist.sh delete mode 100644 abs/core-testing/udev/usb_id-fix.patch diff --git a/abs/core-testing/udev/00-load-blacklist.rules b/abs/core-testing/udev/00-load-blacklist.rules deleted file mode 100644 index b1a5faf..0000000 --- a/abs/core-testing/udev/00-load-blacklist.rules +++ /dev/null @@ -1 +0,0 @@ -IMPORT{program} = "/lib/udev/mod-blacklist.sh" diff --git a/abs/core-testing/udev/51-arch.rules b/abs/core-testing/udev/51-arch.rules deleted file mode 100644 index b06be93..0000000 --- a/abs/core-testing/udev/51-arch.rules +++ /dev/null @@ -1,191 +0,0 @@ -# Udev rules for Archlinux by Tobias Powalowski -# 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 -##################################### -# 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}" - -# SCSI addon modules -SUBSYSTEM=="scsi", ATTRS{type}=="[07]", RUN+="/lib/udev/load-modules.sh sd_mod" -SUBSYSTEM=="scsi", ATTRS{type}=="14", RUN+="/lib/udev/load-modules.sh sd_mod" -SUBSYSTEM=="scsi", ATTRS{type}=="[45]", RUN+="/lib/udev/load-modules.sh sr_mod" -SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}=="Onstream", ATTRS{model}!="ADR*", RUN+="/lib/udev/load-modules.sh osst" -SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}=="Onstream", ATTRS{model}=="ADR*", RUN+="/lib/udev/load-modules.sh st" -SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}!="Onstream", RUN+="/lib/udev/load-modules.sh st" - -# 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}=="PNP0b00", RUN+="/lib/udev/load-modules.sh rtc_cmos" -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 -##################################### - -##################################### -# 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" -KERNEL=="controlC[0-9]*", NAME="snd/%k" -KERNEL=="hw[CD0-9]*", NAME="snd/%k" -KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k" -KERNEL=="midi[CD0-9]*", NAME="snd/%k" -KERNEL=="timer", NAME="snd/%k" -KERNEL=="seq", NAME="snd/%k" -# 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" - -# CAPI devices -KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="uucp" -KERNEL=="capi*", NAME="capi/%n", GROUP="uucp" - -# IEEE1394 (firewire) devices -KERNEL=="raw1394", NAME="%k", GROUP="video" - -# kbd devices -KERNEL=="kbd", MODE="0664" - -####################################### -# Permissions and Symlinks - end -####################################### diff --git a/abs/core-testing/udev/PKGBUILD b/abs/core-testing/udev/PKGBUILD index 7c71a08..53250cc 100644 --- a/abs/core-testing/udev/PKGBUILD +++ b/abs/core-testing/udev/PKGBUILD @@ -1,15 +1,17 @@ -# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $ +# $Id: PKGBUILD 14541 2008-10-08 07:37:32Z tpowa $ +# Maintainer: Aaron Griffin # Maintainer: Tobias Powalowski # Maintainer: Thomas Bächler pkgname=udev -pkgver=119 -pkgrel=10 +pkgver=130 +pkgrel=1 pkgdesc="The userspace dev tools (udev)" arch=(i686 x86_64) url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" license=('GPL') groups=('base') depends=('glibc' 'coreutils' 'util-linux') +makedepends=('kernel26') #needed to build framebuffer blacklist install=udev.install backup=(etc/udev/udev.conf etc/scsi_id.config @@ -17,66 +19,68 @@ backup=(etc/udev/udev.conf etc/modprobe.d/framebuffer_blacklist) conflicts=('pcmcia-cs' 'hotplug') replaces=('devfsd') +# older initscripts versions required start_udev +conflicts=('initscripts<2008.02') 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 - cdrom-rules.patch cdsymlinks.sh root-link.sh readme-udev-arch.txt arch-udev-rules.patch) -md5sums=('dd299c16371c9e14e52d79744bccf4c0' - '49434a593918c822077bc3af765f1aff' - 'a68a519d1ed8cbbd2f45c23eb32ea218' - '082e76ef9053495a5cade321817467cd' - '945f6d30ab458189b3c17f8e6722da1f' - '5de33ba31ce52ab4da47fe3ddd3c19ea' + 81-arch.rules load-modules.sh resolve-modalias.c cdsymlinks.sh root-link.sh + arch-udev-rules.patch readme-udev-arch.txt) +md5sums=('eaaac3c45b8c87d81a82fed254ecee25' + '3a955ca8e2122a48a223f9d8adf87b70' + 'f4951f61438d69894b728212dac7318b' + 'fca04a608009069beb786e26338a783b' '8424b78e9dd772e75b4ef90814807815' '2d6dc6842464f107bccc68cd505a6c31' - '780db5316a762dc5cdcf52027ab8a8eb' - 'fab7fa68aa35f0595c0b2bd88c4dbfd9') + 'beb8ebffc3652584363804e41445ba17' + '7fc6d33bb218e752302eef0a80ff0a89') build() { - cd $startdir/src/$pkgname-$pkgver + cd $srcdir/$pkgname-$pkgver + ./configure --prefix="" --mandir=/usr/share/man --includedir=/usr/include make || return 1 - make INSTALL=/bin/install DESTDIR=$startdir/pkg install \ - EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id extras/path_id extras/rule_generator" + make DESTDIR=$startdir/pkg install + + # Fix pkgconfig path + install -d -m755 $pkgdir/usr/lib + mv $pkgdir/lib/pkgconfig $pkgdir/usr/lib + + # Non-stock rules still go in /etc + install -D -m644 $srcdir/81-arch.rules $pkgdir/etc/udev/rules.d/81-arch.rules - install -D -m755 extras/path_id/path_id $startdir/pkg/sbin/path_id - 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 our module loading subsystem - install -D -m755 $startdir/src/load-modules.sh $startdir/pkg/lib/udev/load-modules.sh + install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh + install -d -m755 $pkgdir/bin + gcc -Wall $CFLAGS -o $pkgdir/bin/resolve-modalias $srcdir/resolve-modalias.c # install cdsymlinks.sh - install -D -m755 $startdir/src/cdsymlinks.sh $startdir/pkg/lib/udev/cdsymlinks.sh + install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh # install root-link.sh - install -D -m755 $startdir/src/root-link.sh $startdir/pkg/lib/udev/root-link.sh + install -D -m755 $srcdir/root-link.sh $pkgdir/lib/udev/root-link.sh + # install instructions - install -D -m644 $startdir/src/readme-udev-arch.txt $startdir/pkg/etc/udev/readme-udev-arch.txt + # NOTE: We should delete this file + install -D -m644 $srcdir/readme-udev-arch.txt $pkgdir/usr/share/udev/readme-udev-arch.txt + # add devices dir - mkdir $startdir/pkg/lib/udev/devices - # 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 + mkdir $pkgdir/lib/udev/devices + # disable error logging to prevent startup failures printed to vc on boot + sed -i -e 's|udev_log="err"|udev_log="0"|g' $pkgdir/etc/udev/udev.conf # install additional rules files - install -D -m 644 $startdir/src/$pkgname-$pkgver/etc/udev/packages/40-pilot-links.rules $startdir/pkg/etc/udev/rules.d/ - install -D -m 644 $startdir/src/$pkgname-$pkgver/etc/udev/packages/64-device-mapper.rules $startdir/pkg/etc/udev/rules.d/ - install -D -m 644 $startdir/src/$pkgname-$pkgver/etc/udev/packages/64-md-raid.rules $startdir/pkg/etc/udev/rules.d/ - # fix 60-cdrom_id.rules - cd $startdir/pkg/etc/udev/rules.d/ - patch -Np0 -i $startdir/src/cdrom-rules.patch || return 1 - # fix standard udev rules to fit to arch - patch -Np0 -i $startdir/src/arch-udev-rules.patch || return 1 - # fix program paths in rules files - for i in vol_id cdrom_id ata_id scsi_id path_id edd_id usb_id; do - sed -i -e "s#$i#/lib/udev/$i#g" $startdir/pkg/etc/udev/rules.d/* + for rule in $srcdir/$pkgname-$pkgver/rules/packages/*.rules; do + install -D -m 644 $rule $pkgdir/lib/udev/rules.d/ done - # 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 - mv $startdir/pkg/etc/udev/rules.d/75-persistent-net-generator.rules \ - $startdir/pkg/etc/udev/rules.d/75-persistent-net-generator.rules.optional - mv $startdir/pkg/etc/udev/rules.d/75-cd-aliases-generator.rules \ - $startdir/pkg/etc/udev/rules.d/75-cd-aliases-generator.rules.optional + # fix standard udev rules to fit to arch + cd $pkgdir/lib/udev/rules.d/ + patch -Np1 -i $srcdir/arch-udev-rules.patch || return 1 + + # disable persistent cdromsymlinks and network by default + # and move it to /etc/udev/rules.d + mv $pkgdir/lib/udev/rules.d/75-persistent-net-generator.rules \ + $pkgdir/etc/udev/rules.d/75-persistent-net-generator.rules.optional + mv $pkgdir/lib/udev/rules.d/75-cd-aliases-generator.rules \ + $pkgdir/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 - echo "blacklist $mod" >> $startdir/pkg/etc/modprobe.d/framebuffer_blacklist + mkdir -p $pkgdir/etc/modprobe.d/ + for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko' -exec basename {} .ko \;); do + echo "blacklist $mod" >> $pkgdir/etc/modprobe.d/framebuffer_blacklist done } diff --git a/abs/core-testing/udev/arch-udev-rules.patch b/abs/core-testing/udev/arch-udev-rules.patch index fc5ede0..22f9d1b 100644 --- a/abs/core-testing/udev/arch-udev-rules.patch +++ b/abs/core-testing/udev/arch-udev-rules.patch @@ -1,17 +1,61 @@ ---- 50-udev-default.rules.old 2008-03-09 17:52:59.000000000 +0100 -+++ 50-udev-default.rules 2008-03-09 17:09:50.000000000 +0100 +diff -Nur rules.d/60-persistent-storage.rules rules.d.arch/60-persistent-storage.rules +--- rules.d/60-persistent-storage.rules 2008-09-12 15:59:57.000000000 +0200 ++++ rules.d.arch/60-persistent-storage.rules 2008-09-12 16:00:50.000000000 +0200 +@@ -10,7 +10,7 @@ + SUBSYSTEM!="block", GOTO="persistent_storage_end" + + # skip rules for inappropriate block devices +-KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" ++KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|md*", GOTO="persistent_storage_end" + + # 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" +diff -Nur rules.d/80-drivers.rules rules.d.arch/80-drivers.rules +--- rules.d/80-drivers.rules 2008-09-12 15:59:57.000000000 +0200 ++++ rules.d.arch/80-drivers.rules 2008-09-12 16:01:56.000000000 +0200 +@@ -2,16 +2,17 @@ + + ACTION!="add", GOTO="drivers_end" + +-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)'" +-SUBSYSTEM=="tifm", RUN+="/sbin/modprobe --all tifm_sd tifm_ms" +-SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block 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" +-SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe sg" +-SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe ppdev" ++DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/lib/udev/load-modules.sh $env{MODALIAS}" ++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+="/lib/udev/load-modules.sh mmc_block" ++SUBSYSTEM=="i2o", RUN+="/lib/udev/load-modules.sh i2o_block" ++SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/lib/udev/load-modules.sh ide-scsi" ++SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/lib/udev/load-modules.sh sg" ++SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/lib/udev/load-modules.sh ppdev" + + LABEL="drivers_end" + +diff -Nur rules.d/50-udev-default.rules rules.d.arch/50-udev-default.rules +--- rules.d/50-udev-default.rules 2008-09-12 15:59:57.000000000 +0200 ++++ rules.d.arch/50-udev-default.rules 2008-09-12 16:00:50.000000000 +0200 @@ -4,12 +4,17 @@ - KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660", OPTIONS="last_rule" - KERNEL=="ptmx", GROUP="tty", MODE="0666", OPTIONS="last_rule" - KERNEL=="tty", GROUP="tty", MODE="0666", OPTIONS="last_rule" --KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", OPTIONS="last_rule" --KERNEL=="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*", GROUP="tty", OPTIONS="last_rule" -+KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", NAME="vc/%n", SYMLINK+="%k" OPTIONS="last_rule" -+KERNEL=="vcs", GROUP="tty", NAME="vcc/0", OPTIONS="last_rule" -+KERNEL=="vcs[0-9]*", GROUP="tty", NAME="vcc/%n", OPTIONS="last_rule" -+KERNEL=="vcsa", GROUP="tty", NAME="vcc/a0", OPTIONS="last_rule" -+KERNEL=="vcsa[0-9]*", GROUP="tty", NAME="vcc/a%n", OPTIONS="last_rule" - KERNEL=="console", MODE="0600", OPTIONS="last_rule" + KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660", OPTIONS+="last_rule" + KERNEL=="ptmx", GROUP="tty", MODE="0666", OPTIONS+="last_rule" + KERNEL=="tty", GROUP="tty", MODE="0666", OPTIONS+="last_rule" +-KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", OPTIONS+="last_rule" +-KERNEL=="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*", GROUP="tty", OPTIONS+="last_rule" ++KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", NAME="vc/%n", SYMLINK+="%k" OPTIONS+="last_rule" ++KERNEL=="vcs", GROUP="tty", NAME="vcc/0", OPTIONS+="last_rule" ++KERNEL=="vcs[0-9]*", GROUP="tty", NAME="vcc/%n", OPTIONS+="last_rule" ++KERNEL=="vcsa", GROUP="tty", NAME="vcc/a0", OPTIONS+="last_rule" ++KERNEL=="vcsa[0-9]*", GROUP="tty", NAME="vcc/a%n", OPTIONS+="last_rule" + KERNEL=="console", MODE="0600", OPTIONS+="last_rule" # serial KERNEL=="tty[A-Z]*|pppox*|ircomm*|noz*", GROUP="uucp" @@ -20,17 +64,15 @@ KERNEL=="ppp", MODE="0600", OPTIONS+="ignore_remove" KERNEL=="mwave", NAME="modems/mwave", GROUP="uucp" KERNEL=="hvc*|hvsi*", GROUP="uucp" -@@ -20,8 +25,7 @@ - KERNEL=="null|zero|full|random|urandom", MODE="0666" - KERNEL=="null", SYMLINK+="XOR" - KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" --KERNEL=="ram0", SYMLINK+="ramdisk" --KERNEL=="ram1", SYMLINK+="ram" +@@ -21,6 +26,7 @@ + KERNEL=="mem|kmem|port|nvram", GROUP="kmem", MODE="0640" + KERNEL=="ram0", SYMLINK+="ramdisk" + KERNEL=="ram1", SYMLINK+="ram" +KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k" # input KERNEL=="mouse*|mice|event*", NAME="input/%k", MODE="0640" -@@ -30,23 +34,30 @@ +@@ -29,20 +35,25 @@ # video4linux KERNEL=="vbi0", SYMLINK+="vbi" @@ -45,11 +87,10 @@ # graphics -KERNEL=="agpgart", MODE="0600" -KERNEL=="card[0-9]*", NAME="dri/%k", MODE="0666" -+### xorg resets those permissions, adjust your xorg.conf! +-KERNEL=="fb0", SYMLINK+="fb" +KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k", GROUP="video", MODE="0600" +KERNEL=="card[0-9]*", NAME="dri/%k", GROUP="video", MODE="0666" +KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" - KERNEL=="fb0", SYMLINK+="fb" # DVB video -SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c" @@ -62,27 +103,19 @@ +KERNEL=="video1394*", NAME="video1394/%n", GROUP="video" # firmware class requests --SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" -+SUBSYSTEM=="firmware", ACTION=="add", ENV{FIRMWARE}=="?*", RUN+="firmware.sh" - - # libusb device nodes - SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" -@@ -59,23 +70,20 @@ - KERNEL=="irlpt[0-9]*", GROUP="lp" - - # block, tapes, block-releated --SUBSYSTEM=="block", GROUP="disk", MODE="0640" --SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" -+SUBSYSTEM=="block", GROUP="disk" + SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" +@@ -62,19 +73,19 @@ + SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" -KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions" --KERNEL=="fd[0-9]", GROUP="floppy" --KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k" +KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions", GROUP="floppy" -+KERNEL=="fd[0-9]*", NAME="fd%n", SYMLINK+="floppy/%n fd%nu1440 fd%nu720 fd%nh1200 fd%nu360", GROUP="floppy" + KERNEL=="fd[0-9]", GROUP="floppy" +-KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k" ++KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k" KERNEL=="sch[0-9]*", GROUP="disk" -KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0640" ++KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0660" KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="disk" KERNEL=="pg[0-9]*", GROUP="disk" KERNEL=="pt[0-9]*|npt[0-9]*", GROUP="disk" @@ -91,12 +124,12 @@ SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" -KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k" -KERNEL=="pktcdvd", NAME="pktcdvd/control" -+KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k", GROUP="optical", MODE="0660" ++KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k", GROUP="optical", MODE="0660" +KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="optical", MODE="0660" KERNEL=="qft0", SYMLINK+="ftape" SUBSYSTEM=="bsg", NAME="bsg/%k" SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk" -@@ -84,13 +92,13 @@ +@@ -83,13 +94,13 @@ KERNEL=="tun", NAME="net/%k", MODE="0666", OPTIONS+="ignore_remove" # CPU @@ -109,43 +142,7 @@ # miscellaneous KERNEL=="fuse", MODE="0666" -KERNEL=="rtc|rtc0", MODE="0644" -+KERNEL=="rtc*", NAME="misc/%k", SYMLINK+="%k", GROUP="audio", MODE="0664" ++KERNEL=="rtc|rtc0", NAME="misc/%k", SYMLINK+="%k", GROUP="audio", MODE="0664" KERNEL=="rtc0", SYMLINK+="rtc" KERNEL=="auer[0-9]*", NAME="usb/%k" KERNEL=="hw_random", NAME="hwrng", SYMLINK+="%k" ---- 60-persistent-storage.rules.old 2008-03-09 17:52:59.000000000 +0100 -+++ 60-persistent-storage.rules 2008-03-09 15:05:13.000000000 +0100 -@@ -3,11 +3,13 @@ - # persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} - # scheme based on "Linux persistent device names", 2004, Hannes Reinecke - --ACTION!="add|change", GOTO="persistent_storage_end" -+# needed like this!!! -+ACTION!="add|change", GOTO="persistent_storage_end" - SUBSYSTEM!="block", GOTO="persistent_storage_end" - - # skip rules for inappropriate block devices --KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" -+# don't add dm-*!!! -+KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|md*", GOTO="persistent_storage_end" - - # 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-03-15 00:05:02.000000000 +0100 -+++ 80-drivers.rules 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}" --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)'" --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+="/sbin/modprobe tifm_sd" -+SUBSYSTEM=="tifm", RUN+="/sbin/modprobe tifm_ms" -+SUBSYSTEM=="memstick", RUN+="/sbin/modprobe ms_block" -+SUBSYSTEM=="memstick", RUN+="/sbin/modprobe 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" diff --git a/abs/core-testing/udev/cdrom-rules.patch b/abs/core-testing/udev/cdrom-rules.patch deleted file mode 100644 index 9b3518a..0000000 --- a/abs/core-testing/udev/cdrom-rules.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- 60-cdrom_id.rules.old 2006-09-07 09:57:04.000000000 +0200 -+++ 60-cdrom_id.rules 2006-09-07 11:29:31.000000000 +0200 -@@ -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" diff --git a/abs/core-testing/udev/load-modules.sh b/abs/core-testing/udev/load-modules.sh index 861b942..a42d376 100755 --- a/abs/core-testing/udev/load-modules.sh +++ b/abs/core-testing/udev/load-modules.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/bin/bash # Implement blacklisting for udev-loaded modules [ $# -ne 1 ] && exit 1 @@ -7,20 +7,22 @@ # grab modules from rc.conf BLACKLIST="${MOD_BLACKLIST[@]}" +MODPROBE="/sbin/modprobe" +LOGGER="/usr/bin/logger" +RESOLVEALIAS="/bin/resolve-modalias" +USEBLACKLIST="--use-blacklist" if [ -f /proc/cmdline ]; then for cmd in $(cat /proc/cmdline); do case $cmd in - *=*) eval $cmd ;; + disablemodules=*) eval $cmd ;; + load_modules=off) exit ;; esac done #parse cmdline entries of the form "disablemodules=x,y,z" if [ -n "$disablemodules" ]; then BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')" fi - if [ "$load_modules" == "off" ]; then - MOD_AUTOLOAD="no" - fi fi #MODULES entries in rc.conf that begin with ! are blacklisted @@ -30,31 +32,49 @@ for mod in ${MODULES[@]}; do fi done - if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ]; then - if [ -n "$BLACKLIST" ]; then - depmods="$(/sbin/modprobe -i --show-depends $1)" - if [ $? -ne 0 ]; then - /usr/bin/logger -p info "cannot find module $1" - exit 1 - fi - - #sanitize our module names - depmods="$(echo "$depmods" | sed \ - -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \ - -e 's|-|_|g')" - - for mod in $depmods; do - if echo $BLACKLIST | /bin/grep "\<$mod\>" 2>&1 >/dev/null; then - /usr/bin/logger -p info "udev load-modules: $1 is blacklisted" - exit 1 - fi - done + if [ -n "${BLACKLIST}" ]; then + # If an alias name is on the blacklist, load no modules for this device + if echo "${BLACKLIST}" | /bin/grep -q -e " $1 " -e "^$1 " -e " $1\$"; then + $LOGGER -p info -t "$(basename $0)" "Not loading module alias '$1' because it is blacklisted" + exit fi - /sbin/modprobe $1 -else - #/usr/bin/logger -p info \ - echo \ - "udev load-modules: autoloading is disabled, not loading $1" + #sanitize the blacklist + BLACKLIST="$(echo "$BLACKLIST" | sed -e 's|-|_|g')" + # Try to find all modules for the alias + mods=$($RESOLVEALIAS /lib/modules/$(uname -r)/modules.alias $1) + # If no modules could be found, try if the alias name is a module name + # In that case, omit the --use-blacklist parameter to imitate normal modprobe behaviour + [ -z "${mods}" ] && $MODPROBE -qni $1 && mods="$1" && USEBLACKLIST="" + [ -z "${mods}" ] && $LOGGER -p info -t "$(basename $0)" "'$1' is not a valid module or alias name" + for mod in ${mods}; do + # Find the module and all its dependencies + deps="$($MODPROBE -i --show-depends ${mod})" + [ $? -ne 0 ] && continue + + #sanitize the module names + deps="$(echo "$deps" | sed \ + -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" \ + -e 's|-|_|g')" + + # If the module or any of its dependencies is blacklisted, don't load it + for dep in $deps; do + if echo "${BLACKLIST}" | /bin/grep -q -e " ${dep} " -e "^${dep} " -e " ${dep}\$"; then + if [ "${dep}" = "${mod}" ]; then + $LOGGER -p info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because it is blacklisted" + else + $LOGGER -p info -t "$(basename $0)" "Not loading module '${mod}' for alias '$1' because its dependency '${dep}' is blacklisted" + fi + continue 2 + fi + done + # modprobe usually uses the "blacklist" statements from modprobe.conf only to blacklist all aliases + # of a module, but not the module itself. We use --use-blacklist here so that modprobe also blacklists + # module names if we resolved alias names manually above + $MODPROBE $USEBLACKLIST ${mod} + done + else + $MODPROBE $1 + fi fi # vim: set et ts=4: diff --git a/abs/core-testing/udev/migrate-udev b/abs/core-testing/udev/migrate-udev deleted file mode 100644 index a7a24c9..0000000 --- a/abs/core-testing/udev/migrate-udev +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# This script will create static system-critical device nodes in your /dev -# tree so the initscripts can get by without devfs/udev long enough to start -# up devfs/udev. - -STARTDIR=`pwd` -TMPDIR=`mktemp -d` -ROOT=/ -[ "$1" != "" ] && ROOT=$1 - -mount --bind $ROOT $TMPDIR -cd $TMPDIR - -echo -n "creating device nodes: " -rm -f dev/console -rm -f dev/null -rm -f dev/zero -mknod dev/console c 5 1 -echo -n "console " -mknod -m 666 dev/null c 1 3 -echo -n "null " -mknod -m 666 dev/zero c 1 5 -echo -n "zero " -echo - -cd $STARTDIR -umount $TMPDIR -rm -rf $TMPDIR diff --git a/abs/core-testing/udev/mod-blacklist.sh b/abs/core-testing/udev/mod-blacklist.sh deleted file mode 100755 index 264192a..0000000 --- a/abs/core-testing/udev/mod-blacklist.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/bash -# Export a combined blacklist of all modules -# for use by the load-modules script -# -# NOTE: we only need bash because of rc.conf, but this -# is a one-time use script, so we're good - -. /etc/rc.conf - -# grab modules from rc.conf -BLACKLIST="${MOD_BLACKLIST[@]}" - -if [ -f /proc/cmdline ]; then - for cmd in $(cat /proc/cmdline); do - case $cmd in - *=*) eval $cmd ;; - esac - done - #parse cmdline entries of the form "disablemodules=x,y,z" - if [ -n "$disablemodules" ]; then - BLACKLIST="$BLACKLIST $(echo $disablemodules | sed 's|,| |g')" - fi - if [ "$load_modules" == "off" ]; then - MOD_AUTOLOAD="no" - fi -fi - -# blacklist framebuffer modules -DRIVER_DIR="/lib/modules/$(uname -r)/kernel/drivers/" -for x in $DRIVER_DIR/video/*/*fb*; do - BLACKLIST="$BLACKLIST $(basename $x .ko)" -done -for x in $DRIVER_DIR/video/*fb*; do - BLACKLIST="$BLACKLIST $(basename $x .ko)" -done - -#MODULES entries in rc.conf that begin with ! are blacklisted -for mod in ${MODULES[@]}; do - if [ "${mod}" != "${mod#!}" ]; then - BLACKLIST="$BLACKLIST ${mod#!}" - fi -done - -echo "MOD_AUTOLOAD=\"$MOD_AUTOLOAD\"" -echo "BLACKLIST=\"$BLACKLIST\"" - -# vim: set et ts=4: diff --git a/abs/core-testing/udev/readme-udev-arch.txt b/abs/core-testing/udev/readme-udev-arch.txt index ac4a693..e903a6b 100644 --- a/abs/core-testing/udev/readme-udev-arch.txt +++ b/abs/core-testing/udev/readme-udev-arch.txt @@ -1,7 +1,7 @@ ========================== Cold/Hotplugging with Udev ========================== -Version 1.1.5 +Version 1.1.6 written by Tobias Powalowski --------------- @@ -48,6 +48,8 @@ written by Tobias Powalowski 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 @@ written by Tobias Powalowski - 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 @@ is only used in mkinitrd now. - 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 @@ is only used in mkinitrd now. --- 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 @@ if you change your CD/DVD device, you have to check the 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. diff --git a/abs/core-testing/udev/udev.install b/abs/core-testing/udev/udev.install index 19d3546..bb8b166 100644 --- a/abs/core-testing/udev/udev.install +++ b/abs/core-testing/udev/udev.install @@ -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 @@ -17,6 +12,21 @@ if [ "$(vercmp $2 100)" -lt 0 ]; then fi } +post_install() { + # If a ramfs is mounted, we still need to make sure that /dev/{console,null,zero} exist + # The Archlinux installer bind-mounts /dev to /mnt/dev, thus making the real /dev invisible + ROOTDIR="" + [ "$(stat -c %D /)" != "$(stat -c %D /dev)" ] && ROOTDIR=$(mktemp -d /tmp/udevinstall.XXXXXX) + [ -n "${ROOTDIR}" ] && mount --bind / ${ROOTDIR} + [ -c ${ROOTDIR}/dev/console ] || mknod -m600 ${ROOTDIR}/dev/console c 5 1 + [ -c ${ROOTDIR}/dev/null ] || mknod -m644 ${ROOTDIR}/dev/null c 1 3 + [ -c ${ROOTDIR}/dev/zero ] || mknod -m644 ${ROOTDIR}/dev/zero c 1 5 + if [ -n "${ROOTDIR}" ]; then + umount ${ROOTDIR} + rmdir ${ROOTDIR} + fi +} + op=$1 shift $op $* diff --git a/abs/core-testing/udev/usb_id-fix.patch b/abs/core-testing/udev/usb_id-fix.patch deleted file mode 100644 index 35fb2e1..0000000 --- a/abs/core-testing/udev/usb_id-fix.patch +++ /dev/null @@ -1,107 +0,0 @@ -From: Kay Sievers -Date: Mon, 15 Oct 2007 18:38:20 +0000 (+0200) -Subject: usb_id: fail if vendor/product can not be retrieved -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=963033472f8d2aab0bf77147b916de8f3b0b5450 - -usb_id: fail if vendor/product can not be retrieved - -Thanks to Daniel Drake for identifying the bug. ---- - -diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c -index d36a27b..5fb030d 100644 ---- a/extras/usb_id/usb_id.c -+++ b/extras/usb_id/usb_id.c -@@ -1,7 +1,5 @@ - /* -- * usb_id.c -- * -- * Identify an USB (block) device -+ * usb_id - identify an USB device - * - * Copyright (c) 2005 SUSE Linux Products GmbH, Germany - * -@@ -224,8 +222,6 @@ static int usb_id(const char *devpath) - struct sysfs_device *dev; - struct sysfs_device *dev_interface; - struct sysfs_device *dev_usb; -- const char *scsi_model, *scsi_vendor, *scsi_type, *scsi_rev; -- const char *usb_model = NULL, *usb_vendor = NULL, *usb_rev, *usb_serial; - const char *if_class, *if_subclass; - int if_class_num; - int protocol = 0; -@@ -271,6 +267,7 @@ static int usb_id(const char *devpath) - /* mass storage */ - if (protocol == 6 && !use_usb_info) { - struct sysfs_device *dev_scsi; -+ const char *scsi_model, *scsi_vendor, *scsi_type, *scsi_rev; - int host, bus, target, lun; - - /* get scsi device */ -@@ -321,40 +318,50 @@ static int usb_id(const char *devpath) - } - - fallback: -- /* Fallback to USB vendor & device */ -+ /* fallback to USB vendor & device */ - if (vendor_str[0] == '\0') { -+ const char *usb_vendor = NULL; -+ - if (!use_num_info) -- if (!(usb_vendor = sysfs_attr_get_value(dev_usb->devpath, "manufacturer"))) -- dbg("No USB vendor string found, using idVendor"); -+ usb_vendor = sysfs_attr_get_value(dev_usb->devpath, "manufacturer"); -+ -+ if (!usb_vendor) -+ usb_vendor = sysfs_attr_get_value(dev_usb->devpath, "idVendor"); - - if (!usb_vendor) { -- if (!(usb_vendor = sysfs_attr_get_value(dev_usb->devpath, "idVendor"))) { -- dbg("No USB vendor information available\n"); -- sprintf(vendor_str,"0000"); -- } -+ info("No USB vendor information available"); -+ return 1; - } -- set_str(vendor_str,usb_vendor, sizeof(vendor_str) - 1); -+ set_str(vendor_str, usb_vendor, sizeof(vendor_str)-1); - } -- -+ - if (model_str[0] == '\0') { -+ const char *usb_model = NULL; -+ - if (!use_num_info) -- if (!(usb_model = sysfs_attr_get_value(dev_usb->devpath, "product"))) -- dbg("No USB model string found, using idProduct"); -- -+ usb_model = sysfs_attr_get_value(dev_usb->devpath, "product"); -+ -+ if (!usb_model) -+ usb_model = sysfs_attr_get_value(dev_usb->devpath, "idProduct"); -+ - if (!usb_model) { -- if (!(usb_model = sysfs_attr_get_value(dev_usb->devpath, "idProduct"))) -- dbg("No USB model information available\n"); sprintf(model_str,"0000"); -+ dbg("No USB model information available"); -+ return 1; - } -- set_str(model_str, usb_model, sizeof(model_str) - 1); -+ set_str(model_str, usb_model, sizeof(model_str)-1); - } - - if (revision_str[0] == '\0') { -+ const char *usb_rev; -+ - usb_rev = sysfs_attr_get_value(dev_usb->devpath, "bcdDevice"); - if (usb_rev) - set_str(revision_str, usb_rev, sizeof(revision_str)-1); - } - - if (serial_str[0] == '\0') { -+ const char *usb_serial; -+ - usb_serial = sysfs_attr_get_value(dev_usb->devpath, "serial"); - if (usb_serial) - set_str(serial_str, usb_serial, sizeof(serial_str)-1); - -- cgit v0.12