summaryrefslogtreecommitdiffstats
path: root/abs/core/udev
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/udev')
-rw-r--r--abs/core/udev/00-load-blacklist.rules1
-rw-r--r--abs/core/udev/81-arch.rules (renamed from abs/core/udev/51-arch.rules)24
-rw-r--r--abs/core/udev/PKGBUILD110
-rw-r--r--abs/core/udev/__changelog1
-rw-r--r--abs/core/udev/arch-udev-rules.patch177
-rw-r--r--abs/core/udev/cdrom-rules.patch8
-rwxr-xr-xabs/core/udev/load-modules.sh78
-rw-r--r--abs/core/udev/migrate-udev29
-rwxr-xr-xabs/core/udev/mod-blacklist.sh47
-rw-r--r--abs/core/udev/mount-usb51
-rw-r--r--abs/core/udev/readme-udev-arch.txt12
-rw-r--r--abs/core/udev/resolve-modalias.c62
-rw-r--r--abs/core/udev/udev-ntfs-3g.patch217
-rw-r--r--abs/core/udev/udev.install20
-rw-r--r--abs/core/udev/usb-storage.rules4
-rw-r--r--abs/core/udev/usb_id-fix.patch107
16 files changed, 553 insertions, 395 deletions
diff --git a/abs/core/udev/00-load-blacklist.rules b/abs/core/udev/00-load-blacklist.rules
deleted file mode 100644
index b1a5faf..0000000
--- a/abs/core/udev/00-load-blacklist.rules
+++ /dev/null
@@ -1 +0,0 @@
-IMPORT{program} = "/lib/udev/mod-blacklist.sh"
diff --git a/abs/core/udev/51-arch.rules b/abs/core/udev/81-arch.rules
index b06be93..933cbc4 100644
--- a/abs/core/udev/51-arch.rules
+++ b/abs/core/udev/81-arch.rules
@@ -23,18 +23,12 @@
#####################################
###### 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}"
-
-# 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"
@@ -42,7 +36,6 @@ 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"
@@ -81,6 +74,7 @@ ACTION=="remove", SUBSYSTEMS=="block", KERNEL=="sg[0-9]*", RUN+="cdsymlinks.sh"
#####################################
#####################################
+# Additional Archlinux
# Permissions and Symlinks - begin
#####################################
# fix /dev/root symlink
@@ -139,12 +133,6 @@ 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"
@@ -176,10 +164,6 @@ 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"
diff --git a/abs/core/udev/PKGBUILD b/abs/core/udev/PKGBUILD
index 7c71a08..c22b10b 100644
--- a/abs/core/udev/PKGBUILD
+++ b/abs/core/udev/PKGBUILD
@@ -1,15 +1,17 @@
-# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
+# $Id: PKGBUILD 22190 2008-12-22 18:25:11Z tpowa $
+# Maintainer: Aaron Griffin <aaron@archlinux.org>
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Maintainer: Thomas Bächler <thomas@archlinux.org>
pkgname=udev
-pkgver=119
-pkgrel=10
+pkgver=135
+pkgrel=7
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,78 @@ 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 usb-storage.rules udev-ntfs-3g.patch mount-usb)
+md5sums=('661b9df34e1304dad10f595d95b472bb'
+ '3a955ca8e2122a48a223f9d8adf87b70'
+ 'f4951f61438d69894b728212dac7318b'
+ 'fca04a608009069beb786e26338a783b'
'8424b78e9dd772e75b4ef90814807815'
'2d6dc6842464f107bccc68cd505a6c31'
- '780db5316a762dc5cdcf52027ab8a8eb'
- 'fab7fa68aa35f0595c0b2bd88c4dbfd9')
+ 'ae216c26a6a5cae4a3ef9c0e1f7bfaa6'
+ '7fc6d33bb218e752302eef0a80ff0a89'
+ '11eaec41b77746f50975d4ef834c8f83')
build() {
- cd $startdir/src/$pkgname-$pkgver
+ cd $srcdir/$pkgname-$pkgver
+ patch -p1 < ../udev-ntfs-3g.patch || return 1
+ ./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 -m644 $srcdir/usb-storage.rules $pkgdir/etc/udev/rules.d/usb-storage.rules
+
+ # Scripts needed
+ mkdir $pkgdir/etc/udev/scripts
+ install -D -m744 $srcdir/mount-usb $pkgdir/etc/udev/scripts
- 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
+
+ # remove the md-raid rules which are now provided by the mdadm package
+ rm -f $pkgdir/lib/udev/rules.d/64-md-raid.rules
+
+ # 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/udev/__changelog b/abs/core/udev/__changelog
new file mode 100644
index 0000000..7e00323
--- /dev/null
+++ b/abs/core/udev/__changelog
@@ -0,0 +1 @@
+Added usb-storage.rule and script to un/mount USB drives.
diff --git a/abs/core/udev/arch-udev-rules.patch b/abs/core/udev/arch-udev-rules.patch
index fc5ede0..b672731 100644
--- a/abs/core/udev/arch-udev-rules.patch
+++ b/abs/core/udev/arch-udev-rules.patch
@@ -1,17 +1,58 @@
---- 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*|btibm*", GOTO="persistent_storage_end"
++KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|md*|btibm*", 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,14 +2,16 @@
+
+ ACTION!="add", GOTO="drivers_end"
+
+-DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe $env{MODALIAS}"
+-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=="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,69 +61,49 @@
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 @@
-
- # video4linux
+@@ -36,13 +36,18 @@
+ KERNEL=="vtx*|vbi*", GROUP="video"
+ KERNEL=="winradio*", GROUP="video"
KERNEL=="vbi0", SYMLINK+="vbi"
-+KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="%k", GROUP="video"
- KERNEL=="radio0", SYMLINK+="radio"
+-KERNEL=="radio0", SYMLINK+="radio"
++KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="%k"
++KERNEL=="radio0", SYMLINK+="video"
+KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video"
KERNEL=="video0", SYMLINK+="video"
-+KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="%k", GROUP="video"
++KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="%k"
+KERNEL=="vtx0", SYMLINK+="vtx"
-+KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", SYMLINK+="%k", GROUP="video"
++KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", SYMLINK+="%k"
# graphics
--KERNEL=="agpgart", MODE="0600"
+-KERNEL=="agpgart", MODE="0600", GROUP="video"
-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"
-+SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
-
- # Firewire
--KERNEL=="dv1394*", SYMLINK+="dv1394/%n"
--KERNEL=="video1394*", NAME="video1394/%n"
-+KERNEL=="dv1394*", SYMLINK+="dv1394/%n", GROUP="video"
-+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"
-
+ KERNEL=="pmu", GROUP="video"
+ KERNEL=="nvidia*|nvidiactl*", GROUP="video"
+ SUBSYSTEM=="graphics", GROUP="video"
+@@ -62,19 +73,19 @@
# block, tapes, block-releated
--SUBSYSTEM=="block", GROUP="disk", MODE="0640"
--SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
-+SUBSYSTEM=="block", GROUP="disk"
- 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"
+ SUBSYSTEM=="block", GROUP="disk"
+ SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
-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 +112,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 +130,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 <hare@suse.de>
-
--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/udev/cdrom-rules.patch b/abs/core/udev/cdrom-rules.patch
deleted file mode 100644
index 9b3518a..0000000
--- a/abs/core/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/udev/load-modules.sh b/abs/core/udev/load-modules.sh
index 861b942..a42d376 100755
--- a/abs/core/udev/load-modules.sh
+++ b/abs/core/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/udev/migrate-udev b/abs/core/udev/migrate-udev
deleted file mode 100644
index a7a24c9..0000000
--- a/abs/core/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/udev/mod-blacklist.sh b/abs/core/udev/mod-blacklist.sh
deleted file mode 100755
index 264192a..0000000
--- a/abs/core/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/udev/mount-usb b/abs/core/udev/mount-usb
new file mode 100644
index 0000000..2d3b3f5
--- /dev/null
+++ b/abs/core/udev/mount-usb
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+
+DIR=/media
+DEVICE=$2
+LABEL=`/lib/udev/vol_id -L /dev/$DEVICE`
+FS=`/lib/udev/vol_id -t /dev/$DEVICE`
+
+
+mount_device () {
+ if [ "$LABEL" == "" ];
+ then
+ mkdir -p $DIR/usb-$DEVICE
+ case $FS in
+ vfat) /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/usb-$DEVICE
+ ;;
+ *) /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/usb-$DEVICE
+ ;;
+ esac
+ else
+ mkdir -p $DIR/$LABEL
+ echo $LABEL >$DIR/.$DEVICE
+ case $FS in
+ vfat) /bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/$DEVICE $DIR/$LABEL
+ ;;
+ *) /bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/$DEVICE $DIR/$LABEL
+ ;;
+ esac
+ fi
+}
+
+umount_device () {
+ if [ -e $DIR/usb-$DEVICE ];
+ then
+ umount -l $DIR/usb-$DEVICE
+ rmdir $DIR/usb-$DEVICE;
+ else
+ ULABEL=`cat $DIR/.$DEVICE`
+ umount -l $DIR/$ULABEL
+ rmdir $DIR/$ULABEL
+ rm $DIR/.$DEVICE;
+ fi
+}
+
+case $1 in
+ mount) mount_device
+ ;;
+ umount) umount_device
+ ;;
+ *) echo "Usage: mount-usb mount/umount sdxY"
+esac
diff --git a/abs/core/udev/readme-udev-arch.txt b/abs/core/udev/readme-udev-arch.txt
index ac4a693..e903a6b 100644
--- a/abs/core/udev/readme-udev-arch.txt
+++ b/abs/core/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 <tpowa@archlinux.org>
---------------
@@ -48,6 +48,8 @@ written by Tobias Powalowski <tpowa@archlinux.org>
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 <tpowa@archlinux.org>
- 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/udev/resolve-modalias.c b/abs/core/udev/resolve-modalias.c
new file mode 100644
index 0000000..d1680b1
--- /dev/null
+++ b/abs/core/udev/resolve-modalias.c
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <fnmatch.h>
+#include <string.h>
+#include <malloc.h>
+
+static char *getline(FILE *file) {
+ static size_t size = 1024;
+ static char *buf = NULL;
+ static unsigned int i = 0, r = 0;;
+
+ if(buf == NULL)
+ buf = (char*)malloc(size);
+
+ if(i) {
+ memmove(buf, buf+i, size-i);
+ r -= i;
+ i = 0;
+ }
+
+ while(1) {
+ if(i == size) {
+ size *= 2;
+ buf = (char*)realloc(buf, size);
+ }
+
+ if(i==r)
+ r += fread(buf+i, 1, size-i, file);
+
+ if(i==r && i == 0) {
+ free(buf);
+ buf = NULL;
+ r = 0;
+ return NULL;
+ }
+
+ if(i==r || buf[i] == '\n') {
+ buf[i++] = '\0';
+ return buf;
+ }
+ i++;
+ }
+}
+
+int main(int argc, char *argv[]) {
+ FILE *f=fopen(argv[1], "r");
+ char *line, *pattern, *module;
+ char *pos1, *pos2;
+
+ while((line=getline(f))!=NULL) {
+ if(!strncmp(line, "alias", strlen("alias"))) {
+ pos1 = index(line, ' ');
+ pos2 = index(pos1+1, ' ');
+ pattern = pos1+1;
+ *pos2 = '\0';
+ module = pos2+1;
+
+ if(!fnmatch(pattern, argv[2], 0))
+ printf("%s\n", module);
+ }
+ }
+ return 0;
+}
diff --git a/abs/core/udev/udev-ntfs-3g.patch b/abs/core/udev/udev-ntfs-3g.patch
new file mode 100644
index 0000000..366c41f
--- /dev/null
+++ b/abs/core/udev/udev-ntfs-3g.patch
@@ -0,0 +1,217 @@
+diff -ruaN udev-135.orig/extras/volume_id/lib/ntfs.c udev-135/extras/volume_id/lib/ntfs.c
+--- udev-135.orig/extras/volume_id/lib/ntfs.c 2008-11-13 20:42:56.000000000 +0000
++++ udev-135/extras/volume_id/lib/ntfs.c 2009-06-28 23:31:01.000000000 +0000
+@@ -194,7 +194,7 @@
+ }
+
+ volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
+- id->type = "ntfs";
++ id->type = "ntfs-3g";
+ /* we think this is ntfs, but we make sure no other signatures are found */
+ id->force_unique_result = 1;
+ return 0;
+diff -ruaN udev-135.orig/extras/volume_id/lib/ntfs.c~ udev-135/extras/volume_id/lib/ntfs.c~
+--- udev-135.orig/extras/volume_id/lib/ntfs.c~ 1970-01-01 00:00:00.000000000 +0000
++++ udev-135/extras/volume_id/lib/ntfs.c~ 2008-11-13 20:42:56.000000000 +0000
+@@ -0,0 +1,201 @@
++/*
++ * volume_id - reads filesystem label and uuid
++ *
++ * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
++ *
++ * This program is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE 1
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++#include <errno.h>
++#include <ctype.h>
++
++#include "libvolume_id.h"
++#include "libvolume_id-private.h"
++
++static struct ntfs_super_block {
++ uint8_t jump[3];
++ uint8_t oem_id[8];
++ uint16_t bytes_per_sector;
++ uint8_t sectors_per_cluster;
++ uint16_t reserved_sectors;
++ uint8_t fats;
++ uint16_t root_entries;
++ uint16_t sectors;
++ uint8_t media_type;
++ uint16_t sectors_per_fat;
++ uint16_t sectors_per_track;
++ uint16_t heads;
++ uint32_t hidden_sectors;
++ uint32_t large_sectors;
++ uint16_t unused[2];
++ uint64_t number_of_sectors;
++ uint64_t mft_cluster_location;
++ uint64_t mft_mirror_cluster_location;
++ int8_t cluster_per_mft_record;
++ uint8_t reserved1[3];
++ int8_t cluster_per_index_record;
++ uint8_t reserved2[3];
++ uint8_t volume_serial[8];
++ uint16_t checksum;
++} PACKED *ns;
++
++static struct master_file_table_record {
++ uint8_t magic[4];
++ uint16_t usa_ofs;
++ uint16_t usa_count;
++ uint64_t lsn;
++ uint16_t sequence_number;
++ uint16_t link_count;
++ uint16_t attrs_offset;
++ uint16_t flags;
++ uint32_t bytes_in_use;
++ uint32_t bytes_allocated;
++} PACKED *mftr;
++
++static struct file_attribute {
++ uint32_t type;
++ uint32_t len;
++ uint8_t non_resident;
++ uint8_t name_len;
++ uint16_t name_offset;
++ uint16_t flags;
++ uint16_t instance;
++ uint32_t value_len;
++ uint16_t value_offset;
++} PACKED *attr;
++
++static struct volume_info {
++ uint64_t reserved;
++ uint8_t major_ver;
++ uint8_t minor_ver;
++} PACKED *info;
++
++#define MFT_RECORD_VOLUME 3
++#define MFT_RECORD_ATTR_VOLUME_NAME 0x60
++#define MFT_RECORD_ATTR_VOLUME_INFO 0x70
++#define MFT_RECORD_ATTR_OBJECT_ID 0x40
++#define MFT_RECORD_ATTR_END 0xffffffffu
++
++int volume_id_probe_ntfs(struct volume_id *id, uint64_t off, uint64_t size)
++{
++ unsigned int sector_size;
++ unsigned int cluster_size;
++ uint64_t mft_cluster;
++ uint64_t mft_off;
++ unsigned int mft_record_size;
++ unsigned int attr_type;
++ unsigned int attr_off;
++ unsigned int attr_len;
++ unsigned int val_off;
++ unsigned int val_len;
++ const uint8_t *buf;
++ const uint8_t *val;
++
++ info("probing at offset 0x%" PRIx64 "\n", off);
++
++ ns = (struct ntfs_super_block *) volume_id_get_buffer(id, off, 0x200);
++ if (ns == NULL)
++ return -1;
++
++ if (memcmp(ns->oem_id, "NTFS", 4) != 0)
++ return -1;
++
++ volume_id_set_uuid(id, ns->volume_serial, 0, UUID_64BIT_LE);
++
++ sector_size = le16_to_cpu(ns->bytes_per_sector);
++ if (sector_size < 0x200)
++ return -1;
++
++ cluster_size = ns->sectors_per_cluster * sector_size;
++ mft_cluster = le64_to_cpu(ns->mft_cluster_location);
++ mft_off = mft_cluster * cluster_size;
++
++ if (ns->cluster_per_mft_record < 0)
++ /* size = -log2(mft_record_size); normally 1024 Bytes */
++ mft_record_size = 1 << -ns->cluster_per_mft_record;
++ else
++ mft_record_size = ns->cluster_per_mft_record * cluster_size;
++
++ dbg("sectorsize 0x%x\n", sector_size);
++ dbg("clustersize 0x%x\n", cluster_size);
++ dbg("mftcluster %" PRIu64 "\n", mft_cluster);
++ dbg("mftoffset 0x%" PRIx64 "\n", mft_off);
++ dbg("cluster per mft_record %i\n", ns->cluster_per_mft_record);
++ dbg("mft record size %i\n", mft_record_size);
++
++ buf = volume_id_get_buffer(id, off + mft_off + (MFT_RECORD_VOLUME * mft_record_size),
++ mft_record_size);
++ if (buf == NULL)
++ return -1;
++
++ mftr = (struct master_file_table_record*) buf;
++ dbg("mftr->magic '%c%c%c%c'\n", mftr->magic[0], mftr->magic[1], mftr->magic[2], mftr->magic[3]);
++ if (memcmp(mftr->magic, "FILE", 4) != 0)
++ return -1;
++
++ attr_off = le16_to_cpu(mftr->attrs_offset);
++ dbg("file $Volume's attributes are at offset %i\n", attr_off);
++
++ while (1) {
++ attr = (struct file_attribute*) &buf[attr_off];
++ attr_type = le32_to_cpu(attr->type);
++ attr_len = le16_to_cpu(attr->len);
++ val_off = le16_to_cpu(attr->value_offset);
++ val_len = le32_to_cpu(attr->value_len);
++ attr_off += attr_len;
++
++ if (attr_len == 0)
++ break;
++
++ if (attr_off >= mft_record_size)
++ break;
++
++ if (attr_type == MFT_RECORD_ATTR_END)
++ break;
++
++ dbg("found attribute type 0x%x, len %i, at offset %i\n",
++ attr_type, attr_len, attr_off);
++
++ if (attr_type == MFT_RECORD_ATTR_VOLUME_INFO) {
++ dbg("found info, len %i\n", val_len);
++ info = (struct volume_info*) (((uint8_t *) attr) + val_off);
++ snprintf(id->type_version, sizeof(id->type_version)-1,
++ "%u.%u", info->major_ver, info->minor_ver);
++ }
++
++ if (attr_type == MFT_RECORD_ATTR_VOLUME_NAME) {
++ dbg("found label, len %i\n", val_len);
++ if (val_len > VOLUME_ID_LABEL_SIZE)
++ val_len = VOLUME_ID_LABEL_SIZE;
++
++ val = ((uint8_t *) attr) + val_off;
++ volume_id_set_label_raw(id, val, val_len);
++ volume_id_set_label_unicode16(id, val, LE, val_len);
++ }
++ }
++
++ volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
++ id->type = "ntfs";
++ /* we think this is ntfs, but we make sure no other signatures are found */
++ id->force_unique_result = 1;
++ return 0;
++}
diff --git a/abs/core/udev/udev.install b/abs/core/udev/udev.install
index 19d3546..bb8b166 100644
--- a/abs/core/udev/udev.install
+++ b/abs/core/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/udev/usb-storage.rules b/abs/core/udev/usb-storage.rules
new file mode 100644
index 0000000..a7e0726
--- /dev/null
+++ b/abs/core/udev/usb-storage.rules
@@ -0,0 +1,4 @@
+SUBSYSTEMS=="usb", KERNEL=="sd[b-z]", NAME="%k", SYMLINK+="usb-%k", GROUP="users", OPTIONS="last_rule"
+ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="sd[b-z][0-9]", SYMLINK+="usb-%k", GROUP="users", NAME="%k"
+ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="sd[b-z][0-9]", RUN+="/etc/udev/scripts/mount-usb mount %k", OPTIONS="last_rule"
+ACTION=="remove", SUBSYSTEMS=="block", RUN+="/etc/udev/scripts/mount-usb umount %k", OPTIONS="last_rule"#
diff --git a/abs/core/udev/usb_id-fix.patch b/abs/core/udev/usb_id-fix.patch
deleted file mode 100644
index 35fb2e1..0000000
--- a/abs/core/udev/usb_id-fix.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From: Kay Sievers <kay.sievers@vrfy.org>
-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);
-