summaryrefslogtreecommitdiffstats
path: root/source/a/udev
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/udev')
-rw-r--r--source/a/udev/config/rc.d/rc.udev.new100
-rw-r--r--source/a/udev/config/rules.d/59-non-libata-devices.rules44
-rw-r--r--source/a/udev/config/rules.d/65-permissions.rules11
-rw-r--r--source/a/udev/rule_generator.diff14
-rw-r--r--source/a/udev/udev-153.tar.sign (renamed from source/a/udev/udev-141.tar.bz2.sign)6
-rwxr-xr-xsource/a/udev/udev.SlackBuild71
6 files changed, 163 insertions, 83 deletions
diff --git a/source/a/udev/config/rc.d/rc.udev.new b/source/a/udev/config/rc.d/rc.udev.new
index 8c238b0dd..40f38d1de 100644
--- a/source/a/udev/config/rc.d/rc.udev.new
+++ b/source/a/udev/config/rc.d/rc.udev.new
@@ -11,6 +11,18 @@ OPT=""
# remove trailing slash from udev_root
UDEV_ROOT=$(echo "${udev_root}" |sed 's/\/*$//')
+check_mounted() {
+ grep -E -q "^[^[:space:]]+ $1 $2" /proc/mounts
+ return $?
+}
+
+mount_devpts() {
+ if ! check_mounted $UDEV_ROOT/pts devpts ; then
+ mkdir $UDEV_ROOT/pts 2> /dev/null
+ mount -n -o mode=0620,gid=5 -t devpts devpts $UDEV_ROOT/pts
+ fi
+}
+
case "$1" in
start)
# Sanity check #1, udev requires that the kernel support tmpfs:
@@ -23,8 +35,8 @@ case "$1" in
# Sanity check #2, make sure that a 2.6.x kernel is new enough:
if [ "$(uname -r | cut -f 1,2 -d .)" = "2.6" ]; then
- if [ "$(uname -r | cut -f 3 -d . | sed 's/[^[:digit:]].*//')" -lt "15" ]; then
- echo "Sorry, but you need a 2.6.15+ kernel to use udev."
+ if [ "$(uname -r | cut -f 3 -d . | sed 's/[^[:digit:]].*//')" -lt "27" ]; then
+ echo "Sorry, but you need a 2.6.27+ kernel to use udev."
echo "Your kernel version is only $(uname -r)."
echo
echo "FATAL: Refusing to run /etc/rc.d/rc.udev."
@@ -48,45 +60,59 @@ case "$1" in
echo "" > /proc/sys/kernel/hotplug
fi
- # if udevd is already running, rc.udev start will try to re-run
- # failed events. Else, it will start udevd.
- if ps axc | grep -q udevd ; then
- OPT="--type=failed $OPT"
- ( cd ${UDEV_ROOT}/.udev
- for TMPFILE in tmp-rules-*.rules ; do
- mv $TMPFILE /etc/udev/rules.d/${TMPFILE/tmp-rules--/} 2>/dev/null
- done
- )
- else
- # Mount tmpfs on $UDEV_ROOT:
- if ! grep -E -q "^[^[:space:]]+ $UDEV_ROOT tmpfs" /proc/mounts; then
+ if grep -qw devtmpfs /proc/filesystems ; then
+ if ! check_mounted $UDEV_ROOT devtmpfs ; then
# umount shm if needed
- if grep -E -q "^[^[:space:]]+ $UDEV_ROOT/shm tmpfs" /proc/mounts; then
- umount -l $UDEV_ROOT/shm
- fi
+ check_mounted $UDEV_ROOT/shm tmpfs && umount -l $UDEV_ROOT/shm
# Umount pts if needed, we will remount it later:
- if grep -E -q "^[^[:space:]]+ $UDEV_ROOT/pts devpts" /proc/mounts; then
- umount -l $UDEV_ROOT/pts
+ check_mounted $UDEV_ROOT/pts devpts && umount -l $UDEV_ROOT/pts
+
+ # Mount tmpfs on $UDEV_ROOT:
+ mount -n -t devtmpfs devtmpfs $UDEV_ROOT
+ fi
+ else
+ # Mount tmpfs on $UDEV_ROOT:
+ if ! check_mounted $UDEV_ROOT tmpfs ; then
+ # umount shm if needed
+ check_mounted $UDEV_ROOT/shm tmpfs && umount -l $UDEV_ROOT/shm
+
+ # Umount pts if needed, we will remount it later:
+ check_mounted $UDEV_ROOT/pts devpts && umount -l $UDEV_ROOT/pts
+
+ # Mount tmpfs on $UDEV_ROOT:
+ # the -n is because we don't want $UDEV_ROOT umounted when
+ # someone (rc.[06]) calls umount -a
+ mount -n -o mode=0755 -t tmpfs tmpfs $UDEV_ROOT
+
fi
+ fi
+ # Mount devpts
+ mount_devpts
- # Mount tmpfs on $UDEV_ROOT:
- # the -n is because we don't want $UDEV_ROOT umounted when
- # someone (rc.[06]) calls umount -a
- mount -n -o mode=0755 -t tmpfs tmpfs $UDEV_ROOT
+ # Start udevd.
+ /sbin/udevd --daemon 2>/dev/null
- # Remount pts:
- mkdir $UDEV_ROOT/pts 2> /dev/null
- mount -n -o mode=0620,gid=5 -t devpts devpts $UDEV_ROOT/pts
- fi
+ # If udevd was already running, then it will return !=0 exit code,
+ # so we'll try to re-run failed events
+ if [ $? != 0 ]; then
+ OPT="--type=failed $OPT"
+ ( cd ${UDEV_ROOT}/.udev
+ for TMPFILE in tmp-rules-*.rules ; do
+ mv $TMPFILE /etc/udev/rules.d/${TMPFILE/tmp-rules--/} 2>/dev/null
+ done
+ )
+ else # udev is just now being started, so we'll do some initial setup:
- # Add the static nodes to $UDEV_ROOT:
- cp --preserve=all --recursive --remove-destination /lib/udev/devices/* $UDEV_ROOT
+ # Set STARTUP=1 in the environment
+ /sbin/udevadm control --property=STARTUP=1
- # Start udevd:
- echo "Starting udevd: /sbin/udevd --daemon"
- /sbin/udevd --daemon
+ # Set OPT="--action=add" to generate add events on coldplug
+ OPT="--action=add"
+ # Add the static nodes to $UDEV_ROOT:
+ cp --preserve=all --recursive --remove-destination /lib/udev/devices/* $UDEV_ROOT
+
# Create rootdev rules
DEVICENUMBER=$( /bin/stat -c %d / )
MAJORNUMBER=$(($DEVICENUMBER / 256))
@@ -99,9 +125,15 @@ case "$1" in
echo "Triggering udev events: /sbin/udevadm trigger $OPT"
# Call udevtrigger and udevsettle to do the device configuration:
/sbin/udevadm trigger $OPT && /sbin/udevadm settle --timeout=120
+ # Unset STARTUP=1 in the environment
+ /sbin/udevadm control --property=STARTUP=
;;
stop)
+ echo "Stopping udevd is STRONGLY discouraged and not supported."
+ echo "If you are sure you want to do this, use 'force-stop' instead."
+ ;;
+ force-stop)
echo "Stopping udevd"
if [ -e /proc/sys/kernel/hotplug ]; then
echo /sbin/hotplug > /proc/sys/kernel/hotplug
@@ -109,6 +141,10 @@ case "$1" in
killall udevd
;;
restart)
+ echo "Restarting udevd is STRONGLY discouraged and not supported."
+ echo "If you are sure you want to do this, use 'force-restart' instead."
+ ;;
+ force-restart)
echo "Restarting udevd"
killall udevd
sleep 5
diff --git a/source/a/udev/config/rules.d/59-non-libata-devices.rules b/source/a/udev/config/rules.d/59-non-libata-devices.rules
new file mode 100644
index 000000000..4b1238a43
--- /dev/null
+++ b/source/a/udev/config/rules.d/59-non-libata-devices.rules
@@ -0,0 +1,44 @@
+# Support for the deprecated IDE devices has been removed from the
+# default set of rules shipped with udev, but some administrators
+# might want (or need) the old ata drivers and thus build a custom
+# kernel, so we'll carry these on our own for now...
+
+#############################################################################
+
+# Old 50-udev-default.rules
+
+# floppy
+KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy"
+
+# cdrom
+SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom"
+
+#############################################################################
+
+# Old 60-persistent-storage.rules
+
+# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
+KERNEL=="hd*[!0-9]", ATTR{removable}=="1", SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", GOTO="old_persistent_storage_end"
+KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="old_persistent_storage_end"
+
+# by-id (hardware serial number)
+KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
+KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
+KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
+
+LABEL="old_persistent_storage_end"
+
+#############################################################################
+
+# Old ide stuff from our custom 65-permissions.rules
+
+# permissions for IDE floppy devices
+KERNEL=="hd*[!0-9]", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", SYMLINK+="floppy floppy-%k"
+KERNEL=="hd*[0-9]", ATTRS{media}=="floppy", ATTRS{removable}=="1", SYMLINK+="floppy-%k"
+
+# put all removable devices in group "plugdev"
+KERNEL=="hd*[!0-9]", ATTR{removable}=="1", GROUP="plugdev"
+KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev"
+
+#############################################################################
+
diff --git a/source/a/udev/config/rules.d/65-permissions.rules b/source/a/udev/config/rules.d/65-permissions.rules
index b0cfb2590..6f82b0f36 100644
--- a/source/a/udev/config/rules.d/65-permissions.rules
+++ b/source/a/udev/config/rules.d/65-permissions.rules
@@ -12,15 +12,7 @@
# all disks with group disk
KERNEL!="fd*", SUBSYSTEM=="block", GROUP="disk"
-# permissions for IDE floppy devices
-KERNEL=="hd*[!0-9]", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", \
- SYMLINK+="floppy floppy-%k", OPTIONS+="ignore_remove"
-KERNEL=="hd*[0-9]", ATTRS{media}=="floppy", ATTRS{removable}=="1", \
- SYMLINK+="floppy-%k", OPTIONS+="ignore_remove"
-
# put all removable devices in group "plugdev"
-KERNEL=="hd*[!0-9]", ATTR{removable}=="1", GROUP="plugdev"
-KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev"
KERNEL=="sd*[!0-9]", ATTR{removable}=="1", GROUP="plugdev"
KERNEL=="sd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev"
@@ -44,9 +36,6 @@ SUBSYSTEMS=="scsi", KERNEL=="s[gt][0-9]*", ATTRS{type}=="5", \
# Make DRI video devices usable by anyone in group "video":
KERNEL=="card[0-9]*",GROUP:="video"
-# alsa devices
-SUBSYSTEM=="sound", GROUP="audio"
-
# Make the real time clock readable by all, and writable by root:
KERNEL=="rtc|rtc0", MODE="0644"
diff --git a/source/a/udev/rule_generator.diff b/source/a/udev/rule_generator.diff
index 0ff218a6c..f3f67516d 100644
--- a/source/a/udev/rule_generator.diff
+++ b/source/a/udev/rule_generator.diff
@@ -1,6 +1,6 @@
-diff -Naur udev-114/extras/rule_generator/write_cd_rules udev-114slk/extras/rule_generator/write_cd_rules
---- udev-114/extras/rule_generator/write_cd_rules 2007-08-05 09:08:47.000000000 -0300
-+++ udev-114slk/extras/rule_generator/write_cd_rules 2007-08-22 20:17:24.000000000 -0300
+diff -Naur udev.orig/extras/rule_generator/write_cd_rules udev/extras/rule_generator/write_cd_rules
+--- udev.orig/extras/rule_generator/write_cd_rules 2009-05-19 00:24:39.000000000 -0300
++++ udev/extras/rule_generator/write_cd_rules 2009-05-19 01:02:17.000000000 -0300
@@ -3,7 +3,8 @@
# This script is run if an optical drive lacks a rule for persistent naming.
#
@@ -11,13 +11,13 @@ diff -Naur udev-114/extras/rule_generator/write_cd_rules udev-114slk/extras/rule
#
# (C) 2006 Marco d'Itri <md@Linux.IT>
#
-@@ -97,18 +98,59 @@
+@@ -96,18 +97,57 @@
choose_rules_file
link_num=$(find_next_available 'cdrom[0-9]*')
+[ "$link_num" = "" ] && link_num=0
- match="ENV{ID_CDROM}==\"?*\", $RULE"
+ match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE"
comment="$ID_MODEL ($ID_PATH)"
-
@@ -73,8 +73,6 @@ diff -Naur udev-114/extras/rule_generator/write_cd_rules udev-114slk/extras/rule
+ fi
+ fi
+ fi
-+
-+
+ echo >> $RULES_FILE
unlock_rules_file
-
diff --git a/source/a/udev/udev-141.tar.bz2.sign b/source/a/udev/udev-153.tar.sign
index a30826919..193f3a0e7 100644
--- a/source/a/udev/udev-141.tar.bz2.sign
+++ b/source/a/udev/udev-153.tar.sign
@@ -2,7 +2,7 @@
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info
-iD8DBQBJ3TgkyGugalF9Dw4RAtJCAJ4+ns9bz4ZIu+3ecfra/BWrn3euqwCeOFQZ
-6A7UqbHlTlD48sOk249ZATA=
-=AY1A
+iD8DBQBLzqFNyGugalF9Dw4RApGYAKCVo2YvsfeOD/ozq/rsURNM/AoxrwCcCJl1
+YD0LnOVyqilDyMQdOk2VA7o=
+=hHbP
-----END PGP SIGNATURE-----
diff --git a/source/a/udev/udev.SlackBuild b/source/a/udev/udev.SlackBuild
index 0c6327486..e891fca35 100755
--- a/source/a/udev/udev.SlackBuild
+++ b/source/a/udev/udev.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2006, 2008, 2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2006, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,13 +20,21 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-VERSION=${VERSION:-141}
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-3}
+VERSION=${VERSION:-$(echo udev-*.tar.* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j7 "}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
if [ "$ARCH" = "x86_64" ]; then
LIBDIRSUFFIX="64"
else
@@ -41,7 +49,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG/lib/udev
cd $TMP
rm -rf udev-$VERSION
-tar xvf $CWD/udev-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/udev-$VERSION.tar.xz || exit 1
cd udev-$VERSION || exit 1
chown -R root:root .
find . \
@@ -50,31 +58,31 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-zcat $CWD/rule_generator.diff.gz | patch -p1 --verbose || exit 1
+# Fixup the rule generator for our use
+zcat $CWD/rule_generator.diff.gz | patch -p1 || exit 1
+# static libudev is needed for lvm2
./configure \
+ --enable-static \
--prefix=/usr \
- --exec-prefix=/ \
--sysconfdir=/etc \
+ --sbindir=/sbin \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --with-rootlibdir=/lib${LIBDIRSUFFIX} \
+ --libexecdir=/lib/udev \
+ --disable-introspection \
--mandir=/usr/man \
- --with-libdir-name=lib${LIBDIRSUFFIX} \
+ --docdir=/usr/doc/udev-$VERSION \
--build=$ARCH-slackware-linux
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
-( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
- xargs strip --strip-unneeded 2> /dev/null || true
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
- xargs strip --strip-unneeded 2> /dev/null
-)
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-# scsi_id and vol_id are needed by multipath
-( cd $PKG/sbin
- ln -s ../lib/udev/scsi_id scsi_id
- ln -s ../lib/udev/vol_id vol_id
-)
+# scsi_id is needed by multipath
+( cd $PKG/sbin ; ln -s ../lib/udev/scsi_id scsi_id )
mkdir -p \
$PKG/etc/modprobe.d \
@@ -84,15 +92,10 @@ mkdir -p \
# Yes, these will clobber existing config files.
cp -a $CWD/config/udev.conf $PKG/etc/udev/udev.conf
+
# Copy Slackware custom rules
cp -a $CWD/config/rules.d/* $PKG/lib/udev/rules.d/
-# Copy some files from upstream
-cp -a rules/packages/40-alsa.rules $PKG/lib/udev/rules.d/
-cp -a rules/packages/40-isdn.rules $PKG/lib/udev/rules.d/
-cp -a rules/packages/40-zaptel.rules $PKG/lib/udev/rules.d/
-cp -a rules/packages/40-infiniband.rules $PKG/lib/udev/rules.d/
-#cp -a rules/packages/40-pilot-links.rules $PKG/etc/udev/rules.d/
-#cp -a rules/packages/64-md-raid.rules $PKG/etc/udev/rules.d/
+
# Now the init script and module-init-tools stuff
cp -a $CWD/config/rc.d/rc.udev.new $PKG/etc/rc.d/rc.udev.new
cp -a $CWD/config/modprobe.d/* $PKG/etc/modprobe.d
@@ -100,7 +103,7 @@ cp -a $CWD/config/modprobe.d/* $PKG/etc/modprobe.d
chown -R root:root $PKG/etc
find $PKG/etc -type f -exec chmod 644 {} \;
find $PKG/etc -type d -exec chmod 755 {} \;
-chmod 755 $PKG/etc/rc.d/rc.udev.new
+chmod 0755 $PKG/etc/rc.d/rc.udev.new
# Add extra device nodes to the package that udev doesn't make:
tar xvf $CWD/udev-fixed-devices.tar.gz -C $PKG
@@ -112,11 +115,21 @@ done
chown -R root:root $PKG/lib/udev
chmod 755 $PKG/lib/udev/*
+# Move the pkgconfig file to where we expect it
+mv $PKG/usr/share/pkgconfig/* $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig
+rmdir $PKG/usr/share/pkgconfig
+
+# Kill the ConsoleKit stuff
+rm -rf $PKG/usr/lib/ConsoleKit ; rmdir $PKG/usr/lib 2>/dev/null
+
mkdir -p $PKG/usr/doc/udev-$VERSION
cp -a \
- COPYING* FAQ README* TODO RELEASE-NOTES docs \
+ COPYING* README* TODO \
$PKG/usr/doc/udev-$VERSION
+# Don't package the API docs:
+rm -rf $PKG/usr/share/gtk-doc ; rmdir $PKG/usr/share 2>/dev/null
+
# Compress and fix manpage symlinks:
if [ -d $PKG/usr/man ]; then
( cd $PKG/usr/man