rpms/udev/devel udev-115-git-20070907.patch, NONE, 1.1 udev-115-looplast.patch, NONE, 1.1 udev-115-rulesinstall.patch, NONE, 1.1 udev.spec, 1.218, 1.219

Harald Hoyer (harald) fedora-extras-commits at redhat.com
Fri Sep 7 12:52:37 UTC 2007


Author: harald

Update of /cvs/pkgs/rpms/udev/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11134

Modified Files:
	udev.spec 
Added Files:
	udev-115-git-20070907.patch udev-115-looplast.patch 
	udev-115-rulesinstall.patch 
Log Message:
* Fri Sep 07 2007 Harald Hoyer <harald at redhat.com> - 115-2
- some upstream fixes from git
- last_rule for loop rules (speedup for live-cds/qemu with 128 loop devices)


udev-115-git-20070907.patch:

--- NEW FILE udev-115-git-20070907.patch ---
diff --git a/etc/udev/gentoo/05-udev-early.rules b/etc/udev/gentoo/05-udev-early.rules
deleted file mode 100644
index ee349dc..0000000
--- a/etc/udev/gentoo/05-udev-early.rules
+++ /dev/null
@@ -1,9 +0,0 @@
-# ignore these events until someone needs them
-SUBSYSTEM=="drivers",	OPTIONS="ignore_device"
-SUBSYSTEM=="module",	OPTIONS="ignore_device"
-
-# sysfs is populated after the event is sent
-ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
-ACTION=="add", KERNEL=="[0-9]*:[0-9]*", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
-ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
-ACTION=="add", SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
diff --git a/etc/udev/gentoo/30-kernel-compat.rules b/etc/udev/gentoo/30-kernel-compat.rules
new file mode 100644
index 0000000..7bc55c6
--- /dev/null
+++ b/etc/udev/gentoo/30-kernel-compat.rules
@@ -0,0 +1,47 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add", GOTO="kernel_compat_end"
+
+# workarounds needed to synchronize with sysfs
+DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
+
+# needed for kernels <2.6.16
+SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
+
+# needed for kernels <2.6.17
+SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
+
+
+
+# needed for kernels <2.6.22
+SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664"
+
+
+
+# this driver is broken and should not be loaded automatically
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962
+# needed for kernels <2.6.21
+SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}=""
+
+# No need for more code, as MODALIAS is present
+ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"
+
+# needed for kernels <2.6.22
+SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end"
+
+	# Parts taken from redhat-rules
+	# sd:           0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
+	# sr:           4 TYPE_WORM, 5 TYPE_ROM
+	# st/osst:      1 TYPE_TAPE
+
+	ATTRS{type}=="0|7|14",	RUN+="modprobe.sh sd_mod"
+	ATTRS{type}=="4|5",	RUN+="modprobe.sh sr_mod"
+	ATTRS{type}=="8",	RUN+="modprobe.sh ch"
+
+	ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \
+		ATTRS{model}!="ADR*", RUN+="modprobe.sh osst", GOTO="kernel_compat_end"
+	ATTRS{type}=="1", RUN+="modprobe.sh st"
+
+LABEL="kernel_compat_end"
+
+
diff --git a/etc/udev/gentoo/50-udev.rules b/etc/udev/gentoo/50-udev.rules
index dd32971..7c2ac81 100644
--- a/etc/udev/gentoo/50-udev.rules
+++ b/etc/udev/gentoo/50-udev.rules
@@ -1,13 +1,9 @@
+# do not edit this file, it will be overwritten on update
+
 # /etc/udev/rules/50-udev.rules:  device naming rules for udev
 #
 # Gentoo specific rules
 #
-# There are a number of modifiers that are allowed to be used in some of the
-# fields.  See the udev man page for a full description of them.
-#
-# Try not to modify this file, if you wish to change things, create a new rule
-# file that can be run before this one.
-#
 
 # Net devices can have arbitrary names, even
 # ones set by the user. Not try to match normal
@@ -241,10 +237,6 @@ KERNEL=="umad*",	NAME="infiniband/%k"
 KERNEL=="issm*",	NAME="infiniband/%k"
 
 
-# usbfs-like device nodes
-# the way to go up to kernel 2.6.21 (and above if setting USB_DEVICE_CLASS=y)
-SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664"
-# starting from kernel 2.6.22 use this rule
 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
 	NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", GROUP="usb", MODE="0664" 
 
diff --git a/etc/udev/gentoo/80-hotplug.rules b/etc/udev/gentoo/80-hotplug.rules
deleted file mode 100644
index 0637dbc..0000000
--- a/etc/udev/gentoo/80-hotplug.rules
+++ /dev/null
@@ -1,54 +0,0 @@
-# /etc/udev/rules/80-hotplug.rules:  module loading rules for udev
-#
-# Gentoo specific rules
-#
-# There are a number of modifiers that are allowed to be used in some of the
-# fields.  See the udev man page for a full description of them.
-#
-# Try not to modify this file, if you wish to change things, create a new rule
-# file that can be run before this one.
-#
-
-# Module autoloading
-ACTION!="add", GOTO="hotplug_load_end"
-
-# check if the device has already been claimed by a driver
-ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_load_end"
-
-# this driver is broken and should not be loaded automatically
-SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_load_end"
-
-# Autoload modules that lack aliases but have them defined in autoload modules
-ENV{MODALIAS}=="?*", RUN{ignore_error}+="modprobe.sh $env{MODALIAS}"
-
-# /etc/modprobe.conf.
-SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN{ignore_error}+="/bin/sh -c 'while read id; do /lib/udev/modprobe.sh pnp:d$$id; done < /sys$devpath/id'"
-# needed aliases are defined in /etc/modprobe.d/pnp-aliases
-
-
-SUBSYSTEM=="i2o",  RUN+="modprobe.sh i2o_block"
-SUBSYSTEM=="mmc",  RUN+="modprobe.sh mmc_block"
-SUBSYSTEM=="tifm", RUN+="modprobe.sh tifm_sd"
-SUBSYSTEM=="tifm", RUN+="modprobe.sh tifm_ms"
-SUBSYSTEM=="ide",  ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi"
-
-# Load driver for scsi-device
-SUBSYSTEM!="scsi_device", GOTO="hotplug_scsi_end"
-
-	# Parts taken from redhat-rules
-	# sd:           0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
-	# sr:           4 TYPE_WORM, 5 TYPE_ROM
-	# st/osst:      1 TYPE_TAPE
-
-	ATTRS{type}=="?*",	TEST!="[module/sg]", RUN+="modprobe.sh sg"
-	ATTRS{type}=="0|7|14",	RUN+="modprobe.sh sd_mod"
-	ATTRS{type}=="4|5",	RUN+="modprobe.sh sr_mod"
-	ATTRS{type}=="8",	RUN+="modprobe.sh ch"
-
-	ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \
-		ATTRS{model}!="ADR*", RUN+="modprobe.sh osst", GOTO="hotplug_scsi_end"
-	ATTRS{type}=="1", RUN+="modprobe.sh st"
-LABEL="hotplug_scsi_end"
-
-LABEL="hotplug_load_end"
-
diff --git a/etc/udev/gentoo/90-network.rules b/etc/udev/gentoo/90-network.rules
new file mode 100644
index 0000000..50903af
--- /dev/null
+++ b/etc/udev/gentoo/90-network.rules
@@ -0,0 +1,8 @@
+# do not edit this file, it will be overwritten on update
+
+# /etc/udev/rules/90-network.rules:  triggering network init-scripts
+
+# Activate our network if we can
+SUBSYSTEM=="net", ACTION=="add",    RUN+="net.sh %k start"
+SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop"
+
diff --git a/etc/udev/gentoo/95-udev-late.rules b/etc/udev/gentoo/95-udev-late.rules
deleted file mode 100644
index 40ada28..0000000
--- a/etc/udev/gentoo/95-udev-late.rules
+++ /dev/null
@@ -1,18 +0,0 @@
-# /etc/udev/rules/95-udev-late.rules:  device naming rules for udev
-#
-# Gentoo specific rules
-#
-# There are a number of modifiers that are allowed to be used in some of the
-# fields.  See the udev man page for a full description of them.
-#
-# Try not to modify this file, if you wish to change things, create a new rule
-# file that can be run before this one.
-#
-
-# Activate our network if we can
-SUBSYSTEM=="net", ACTION=="add",    RUN+="net.sh %k start"
-SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop"
-
-# event to be catched by udevmonitor
-RUN+="socket:/org/kernel/udev/monitor"
-
diff --git a/etc/udev/rules.d/50-udev-default.rules b/etc/udev/rules.d/50-udev-default.rules
index bff2fe5..bdce004 100644
--- a/etc/udev/rules.d/50-udev-default.rules
+++ b/etc/udev/rules.d/50-udev-default.rules
@@ -17,18 +17,15 @@ KERNEL=="hvc*|hvsi*",		GROUP="uucp"
 KERNEL=="lirc0",		SYMLINK+="lirc"
 
 # mem
-KERNEL=="null|zero|random",	MODE="0666"
+KERNEL=="null|zero|full|random|urandom", MODE="0666"
 KERNEL=="null",			SYMLINK+="XOR"
 KERNEL=="mem|kmem|port",	GROUP="kmem", MODE="0640"
-KERNEL=="nvram",		GROUP="kmem", MODE="0600"
 KERNEL=="ram0",			SYMLINK+="ramdisk"
 KERNEL=="ram1",			SYMLINK+="ram"
-KERNEL=="urandom",		MODE="0644"
-KERNEL=="full",			MODE="0666"
 
 # input
 KERNEL=="mouse*|mice|event*",	NAME="input/%k", MODE="0640"
-KERNEL=="ts[0-9]*|uinput",		NAME="input/%k", MODE="0600"
+KERNEL=="ts[0-9]*|uinput",	NAME="input/%k", MODE="0600"
 KERNEL=="js[0-9]*",		NAME="input/%k", MODE="0644", SYMLINK+="%k"
 
 # video4linux
@@ -58,7 +55,7 @@ SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{
 KERNEL=="parport[0-9]*",	GROUP="lp"
 SUBSYSTEM=="printer",		KERNEL=="lp*", GROUP="lp"
 SUBSYSTEM=="usb",		KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"
-KERNEL=="lp[0-9]*",		GROUP="lp" SYMLINK+="par%n"
+KERNEL=="lp[0-9]*",		GROUP="lp", SYMLINK+="par%n"
 KERNEL=="irlpt[0-9]*",		GROUP="lp"
 
 # block, tapes, block-releated
@@ -71,7 +68,7 @@ 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=="sch[0-9]*",		GROUP="disk"
 KERNEL=="sg[0-9]*",		GROUP="disk", MODE="0640"
-KERNEL=="ht[0-9]*|nht[0-9]*",	GROUP="disk""
+KERNEL=="ht[0-9]*|nht[0-9]*",	GROUP="disk"
 KERNEL=="pg[0-9]*",		GROUP="disk"
 KERNEL=="pt[0-9]*|npt[0-9]*",	GROUP="disk"
 KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
@@ -80,6 +77,7 @@ SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk"
 KERNEL=="pktcdvd[0-9]*",	NAME="pktcdvd/%k"
 KERNEL=="pktcdvd",		NAME="pktcdvd/control"
 KERNEL=="qft0",			SYMLINK+="ftape"
+SUBSYSTEM=="bsg"		NAME="bsg/%k"
 
 # network
 KERNEL=="tun",			NAME="net/%k", MODE="0666", OPTIONS+="ignore_remove"
@@ -91,7 +89,8 @@ KERNEL=="microcode",		NAME="cpu/microcode", MODE="0600"
 
 # miscellaneous
 KERNEL=="fuse",			MODE="0666"
-KERNEL=="rtc",			MODE="0644"
+KERNEL=="rtc|rtc0",		MODE="0644"
+KERNEL=="rtc0",			SYMLINK+="rtc"
 KERNEL=="auer[0-9]*"		NAME="usb/%k"
 KERNEL=="hw_random",		NAME="hwrng", SYMLINK+="%k"
 KERNEL=="mmtimer",		MODE="0644"
@@ -103,3 +102,6 @@ KERNEL=="sxctl",		NAME="specialix_sxctl", SYMLINK+="%k"
 KERNEL=="rioctl",		NAME="specialix_rioctl", SYMLINK+="%k"
 KERNEL=="iowarrior[0-9]*",	NAME="usb/%k"
 
+# do not delete static device nodes
+ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove"
+
diff --git a/etc/udev/rules.d/80-drivers.rules b/etc/udev/rules.d/80-drivers.rules
index e71f135..3388266 100644
--- a/etc/udev/rules.d/80-drivers.rules
+++ b/etc/udev/rules.d/80-drivers.rules
@@ -7,6 +7,7 @@ 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=="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_device", TEST!="[module/sg]", RUN+="/sbin/modprobe sg"
 
diff --git a/etc/udev/rules.d/95-udev-late.rules b/etc/udev/rules.d/95-udev-late.rules
index 1755d08..4a015b9 100644
--- a/etc/udev/rules.d/95-udev-late.rules
+++ b/etc/udev/rules.d/95-udev-late.rules
@@ -1,5 +1,8 @@
 # do not edit this file, it will be overwritten on update
 
+# run a command on remove events
+ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
+
 # event to be catched by udevmonitor
 RUN+="socket:/org/kernel/udev/monitor"
 
diff --git a/extras/volume_id/lib/linux_raid.c b/extras/volume_id/lib/linux_raid.c
index 6d1d19c..ff2c47c 100644
--- a/extras/volume_id/lib/linux_raid.c
+++ b/extras/volume_id/lib/linux_raid.c
@@ -142,13 +142,15 @@ static int volume_id_probe_linux_raid1(struct volume_id *id, uint64_t off, uint6
 
 int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size)
 {
-	uint64_t sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
+	uint64_t sboff;
 
 	/* version 0 at the end of the device */
+	sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
 	if (volume_id_probe_linux_raid0(id, off + sboff, size) == 0)
 		return 0;
 
 	/* version 1.0 at the end of the device */
+	sboff = (size & ~(0x1000 - 1)) - 0x2000;
 	if (volume_id_probe_linux_raid1(id, off + sboff, size) == 0)
 		return 0;
 
diff --git a/extras/volume_id/vol_id.8 b/extras/volume_id/vol_id.8
index 7594253..daa583b 100644
--- a/extras/volume_id/vol_id.8
+++ b/extras/volume_id/vol_id.8
@@ -1,6 +1,6 @@
 .\"     Title: vol_id
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: March 2006
 .\"    Manual: vol_id
 .\"    Source: volume_id
@@ -11,69 +11,69 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-vol_id \- probe filesystem type and read label and uuid
+vol_id - probe filesystem type and read label and uuid
 .SH "SYNOPSIS"
 .HP 7
 \fBvol_id\fR [\fB\-\-export\fR] [\fB\-\-type\fR] [\fB\-\-label\fR] [\fB\-\-label\-raw\fR] [\fB\-\-uuid\fR] [\fB\-\-skip\-raid\fR] [\fB\-\-probe\-all\fR] [\fB\-\-help\fR] [\fIdevice\fR]
 .SH "DESCRIPTION"
 .PP
 \fBvol_id\fR
-is usually called from a udev rule, to provide udev with the filesystem type, the label and the uuid of a volume. It supports most of the common filesystem formats and detects various raid setups to prevent the recognition of raid members as a volume with a filesystem.
+is usually called from a udev rule, to provide udev with the filesystem type, the label and the uuid of a volume\. It supports most of the common filesystem formats and detects various raid setups to prevent the recognition of raid members as a volume with a filesystem\.
 .SH "OPTIONS"
 .PP
 \fB\-\-export\fR
 .RS 4
-Print all values in key/value format to import them into the environment.
+Print all values in key/value format to import them into the environment\.
 .RE
 .PP
 \fB\-\-type\fR
 .RS 4
-Print the filesystem type.
+Print the filesystem type\.
 .RE
 .PP
 \fB\-\-label\fR
 .RS 4
-Print the safe version of volume label suitable for use as filename.
+Print the safe version of volume label suitable for use as filename\.
 .RE
 .PP
 \fB\-\-label\-raw\fR
 .RS 4
-Print the raw volume label.
+Print the raw volume label\.
 .RE
 .PP
 \fB\-\-uuid\fR
 .RS 4
-Print the uuid of a volume.
+Print the uuid of a volume\.
 .RE
 .PP
 \fB\-\-skip\-raid\fR
 .RS 4
-Skip detection of raid metadata.
+Skip detection of raid metadata\.
 .RE
 .PP
 \fB\-\-probe\-all\fR
 .RS 4
-Probe for all types and print all matches.
+Probe for all types and print all matches\.
 .RE
 .PP
 \fB\-\-help\fR
 .RS 4
-Print usage.
+Print usage\.
 .RE
 .SH "ENVIRONMENT"
 .PP
 \fBUDEV_LOG\fR
 .RS 4
-Set the syslog priority.
+Set the syslog priority\.
 .RE
 .SH "EXIT STATUS"
 .PP
 \fBvol_id\fR
-will only return successful if the value asked for is not empty. All trailing whitespace will be removed, spaces replaced by underscore and slashes ignored.
+will only return successful if the value asked for is not empty\. All trailing whitespace will be removed, spaces replaced by underscore and slashes ignored\.
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>
+<kay\.sievers at vrfy\.org>
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udev.7 b/udev.7
index 821a476..874c9ab 100644
--- a/udev.7
+++ b/udev.7
@@ -1,6 +1,6 @@
 .\"     Title: udev
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udev
 .\"    Source: udev
@@ -11,213 +11,213 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udev \- dynamic device management
+udev - dynamic device management
 .SH "DESCRIPTION"
 .PP
-udev provides a dynamic device directory containing only the files for actually present devices. It creates or removes device node files in the
+udev provides a dynamic device directory containing only the files for actually present devices\. It creates or removes device node files in the
 \fI/dev\fR
-directory, or it renames network interfaces.
+directory, or it renames network interfaces\.
 .PP
 Usually udev runs as
 \fBudevd\fR(8)
-and receives uevents directly from the kernel if a device is added or removed from the system.
+and receives uevents directly from the kernel if a device is added or removed from the system\.
 .PP
-If udev receives a device event, it matches its configured rules against the available device attributes provided in sysfs to identify the device. Rules that match may provide additional device information or specify a device node name and multiple symlink names and instruct udev to run additional programs as part of the device event handling.
+If udev receives a device event, it matches its configured rules against the available device attributes provided in sysfs to identify the device\. Rules that match may provide additional device information or specify a device node name and multiple symlink names and instruct udev to run additional programs as part of the device event handling\.
 .SH "CONFIGURATION"
 .PP
 All udev configuration files are placed in
-\fI/etc/udev/*\fR. Every file consists of a set of lines of text. All empty lines or lines beginning with '#' will be ignored.
+\fI/etc/udev/*\fR\. Every file consists of a set of lines of text\. All empty lines or lines beginning with \'#\' will be ignored\.
 .SS "Configuration file"
 .PP
 udev expects its main configuration file at
-\fI/etc/udev/udev.conf\fR. It consists of a set of variables allowing the user to override default udev values. The following variables can be set:
+\fI/etc/udev/udev\.conf\fR\. It consists of a set of variables allowing the user to override default udev values\. The following variables can be set:
 .PP
 \fBudev_root\fR
 .RS 4
-Specifies where to place the device nodes in the filesystem. The default value is
-\fI/dev\fR.
+Specifies where to place the device nodes in the filesystem\. The default value is
+\fI/dev\fR\.
 .RE
 .PP
 \fBudev_rules\fR
 .RS 4
 The name of the udev rules file or directory to look for files with the suffix
-\fI.rules\fR. Multiple rule files are read in lexical order. The default value is
-\fI/etc/udev/rules.d\fR.
+\fI\.rules\fR\. Multiple rule files are read in lexical order\. The default value is
+\fI/etc/udev/rules\.d\fR\.
 .RE
 .PP
 \fBudev_log\fR
 .RS 4
-The logging priority. Valid values are the numerical syslog priorities or their textual representations:
+The logging priority\. Valid values are the numerical syslog priorities or their textual representations:
 \fBerr\fR,
 \fBinfo\fR
 and
-\fBdebug\fR.
+\fBdebug\fR\.
 .RE
 .SS "Rules files"
 .PP
 The udev rules are read from the files located in the
-\fI/etc/udev/rules.d\fR
-directory or at the location specified value in the configuration file. Every line in the rules file contains at least one key value pair. There are two kind of keys, match and assignment keys. If all match keys are matching against its value, the rule gets applied and the assign keys get the specified value assigned.
+\fI/etc/udev/rules\.d\fR
+directory or at the location specified value in the configuration file\. Every line in the rules file contains at least one key value pair\. There are two kind of keys, match and assignment keys\. If all match keys are matching against its value, the rule gets applied and the assign keys get the specified value assigned\.
 .PP
-A matching rule may specify the name of the device node, add a symlink pointing to the node, or run a specified program as part of the event handling. If no matching rule is found, the default device node name is used.
+A matching rule may specify the name of the device node, add a symlink pointing to the node, or run a specified program as part of the event handling\. If no matching rule is found, the default device node name is used\.
 .PP
-A rule may consist of a list of one or more key value pairs separated by a comma. Each key has a distinct operation, depending on the used operator. Valid operators are:
+A rule may consist of a list of one or more key value pairs separated by a comma\. Each key has a distinct operation, depending on the used operator\. Valid operators are:
 .PP
 \fB==\fR
 .RS 4
-Compare for equality.
+Compare for equality\.
 .RE
 .PP
 \fB!=\fR
 .RS 4
-Compare for non\-equality.
+Compare for non\-equality\.
 .RE
 .PP
 \fB=\fR
 .RS 4
-Assign a value to a key. Keys that represent a list, are reset and only this single value is assigned.
+Assign a value to a key\. Keys that represent a list, are reset and only this single value is assigned\.
 .RE
 .PP
 \fB+=\fR
 .RS 4
-Add the value to a key that holds a list of entries.
+Add the value to a key that holds a list of entries\.
 .RE
 .PP
 \fB:=\fR
 .RS 4
-Assign a value to a key finally; disallow any later changes, which may be used to prevent changes by any later rules.
+Assign a value to a key finally; disallow any later changes, which may be used to prevent changes by any later rules\.
 .RE
 .PP
-The following key names can be used to match against device properties. Some of the keys also match against properties of the parent devices in sysfs, not only the device that has generated the event. If multiple keys that match a parent device are specified in a single rule, all these keys must match at one and the same parent device.
+The following key names can be used to match against device properties\. Some of the keys also match against properties of the parent devices in sysfs, not only the device that has generated the event\. If multiple keys that match a parent device are specified in a single rule, all these keys must match at one and the same parent device\.
 .PP
 \fBACTION\fR
 .RS 4
-Match the name of the event action.
+Match the name of the event action\.
 .RE
 .PP
 \fBDEVPATH\fR
 .RS 4
-Match the devpath of the event device.
+Match the devpath of the event device\.
 .RE
 .PP
 \fBKERNEL\fR
 .RS 4
-Match the name of the event device.
+Match the name of the event device\.
 .RE
 .PP
 \fBSUBSYSTEM\fR
 .RS 4
-Match the subsystem of the event device.
+Match the subsystem of the event device\.
 .RE
 .PP
 \fBDRIVER\fR
 .RS 4
-Match the driver name of the event device. Only set for devices which are bound to a driver at the time the event is generated.
+Match the driver name of the event device\. Only set for devices which are bound to a driver at the time the event is generated\.
 .RE
 .PP
 \fBATTR{\fR\fB\fIfilename\fR\fR\fB}\fR
 .RS 4
-Match sysfs attribute values of the event device. Up to five
+Match sysfs attribute values of the event device\. Up to five
 \fBATTR\fR
-keys can be specified per rule. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself. Depending on the type of operator, this key is also used to set the value of a sysfs attribute.
+keys can be specified per rule\. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself\. Depending on the type of operator, this key is also used to set the value of a sysfs attribute\.
 .RE
 .PP
 \fBKERNELS\fR
 .RS 4
-Search the devpath upwards for a matching device name.
+Search the devpath upwards for a matching device name\.
 .RE
 .PP
 \fBSUBSYSTEMS\fR
 .RS 4
-Search the devpath upwards for a matching device subsystem name.
+Search the devpath upwards for a matching device subsystem name\.
 .RE
 .PP
 \fBDRIVERS\fR
 .RS 4
-Search the devpath upwards for a matching device driver name.
+Search the devpath upwards for a matching device driver name\.
 .RE
 .PP
 \fBATTRS{\fR\fB\fIfilename\fR\fR\fB}\fR
 .RS 4
-Search the devpath upwards for a device with matching sysfs attribute values. Up to five
+Search the devpath upwards for a device with matching sysfs attribute values\. Up to five
 \fBATTRS\fR
-keys can be specified per rule, but all of them must match on the same device. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself.
+keys can be specified per rule, but all of them must match on the same device\. Trailing whitespace in the attribute values is ignored, if the specified match value does not contain trailing whitespace itself\.
 .RE
 .PP
 \fBENV{\fR\fB\fIkey\fR\fR\fB}\fR
 .RS 4
-Match against the value of an environment variable. Up to five
+Match against the value of an environment variable\. Up to five
 \fBENV\fR
-keys can be specified per rule. Depending on the type of operator, this key is also used to export a variable to the environment.
+keys can be specified per rule\. Depending on the type of operator, this key is also used to export a variable to the environment\.
 .RE
 .PP
 \fBTEST{\fR\fB\fIoctal mode mask\fR\fR\fB}\fR
 .RS 4
-Test the existence of a file. An octal mode mask can be specified if needed.
+Test the existence of a file\. An octal mode mask can be specified if needed\.
 .RE
 .PP
 \fBPROGRAM\fR
 .RS 4
-Execute external program. The key is true, if the program returns with exit code zero. The whole event environment is available to the executed program. The program's output printed to stdout, is available in the RESULT key.
+Execute external program\. The key is true, if the program returns with exit code zero\. The whole event environment is available to the executed program\. The program\'s output printed to stdout, is available in the RESULT key\.
 .RE
 .PP
 \fBRESULT\fR
 .RS 4
-Match the returned string of the last PROGRAM call. This key can be used in the same or in any later rule after a PROGRAM call.
+Match the returned string of the last PROGRAM call\. This key can be used in the same or in any later rule after a PROGRAM call\.
 .RE
 .PP
-Most of the fields support a shell style pattern matching. The following pattern characters are supported:
+Most of the fields support a shell style pattern matching\. The following pattern characters are supported:
 .PP
 \fB*\fR
 .RS 4
-Matches zero, or any number of characters.
+Matches zero, or any number of characters\.
 .RE
 .PP
 \fB?\fR
 .RS 4
-Matches any single character.
+Matches any single character\.
 .RE
 .PP
 \fB[]\fR
 .RS 4
-Matches any single character specified within the brackets. For example, the pattern string 'tty[SR]' would match either 'ttyS' or 'ttyR'. Ranges are also supported within this match with the '\-' character. For example, to match on the range of all digits, the pattern [0\-9] would be used. If the first character following the '[' is a '!', any characters not enclosed are matched.
+Matches any single character specified within the brackets\. For example, the pattern string \'tty[SR]\' would match either \'ttyS\' or \'ttyR\'\. Ranges are also supported within this match with the \'\-\' character\. For example, to match on the range of all digits, the pattern [0\-9] would be used\. If the first character following the \'[\' is a \'!\', any characters not enclosed are matched\.
 .RE
 .PP
 The following keys can get values assigned:
 .PP
 \fBNAME\fR
 .RS 4
-The name of the node to be created, or the name the network interface should be renamed to. Only one rule can set the node name, all later rules with a NAME key will be ignored.
+The name of the node to be created, or the name the network interface should be renamed to\. Only one rule can set the node name, all later rules with a NAME key will be ignored\.
 .RE
 .PP
 \fBSYMLINK\fR
 .RS 4
-The name of a symlink targeting the node. Every matching rule can add this value to the list of symlinks to be created along with the device node. Multiple symlinks may be specified by separating the names by the space character.
+The name of a symlink targeting the node\. Every matching rule can add this value to the list of symlinks to be created along with the device node\. Multiple symlinks may be specified by separating the names by the space character\.
 .RE
 .PP
 \fBOWNER, GROUP, MODE\fR
 .RS 4
-The permissions for the device node. Every specified value overwrites the compiled\-in default value.
+The permissions for the device node\. Every specified value overwrites the compiled\-in default value\.
 .RE
 .PP
 \fBATTR{\fR\fB\fIkey\fR\fR\fB}\fR
 .RS 4
-The value that should be written to a sysfs attribute of the event device. Depending on the type of operator, this key is also used to match against the value of a sysfs attribute.
+The value that should be written to a sysfs attribute of the event device\. Depending on the type of operator, this key is also used to match against the value of a sysfs attribute\.
 .RE
 .PP
 \fBENV{\fR\fB\fIkey\fR\fR\fB}\fR
 .RS 4
-Export a variable to the environment. Depending on the type of operator, this key is also to match against an environment variable.
+Export a variable to the environment\. Depending on the type of operator, this key is also to match against an environment variable\.
 .RE
 .PP
 \fBRUN\fR
 .RS 4
-Add a program to the list of programs to be executed for a specific device. This can only be used for very short running tasks. Running an event process for a long period of time may block all further events for this or a dependent device. Long running tasks need to be immediately detached from the event process itself.
+Add a program to the list of programs to be executed for a specific device\. This can only be used for very short running tasks\. Running an event process for a long period of time may block all further events for this or a dependent device\. Long running tasks need to be immediately detached from the event process itself\.
 .RE
 .PP
 \fBLABEL\fR
 .RS 4
-Named label where a GOTO can jump to.
+Named label where a GOTO can jump to\.
 .RE
 .PP
 \fBGOTO\fR
@@ -229,72 +229,68 @@ Jumps to the next LABEL with a matching name
 .RS 4
 Import a set of variables into the event environment, depending on
 \fItype\fR:
-.RS 4
 .PP
 \fBprogram\fR
 .RS 4
-Execute an external program specified as the assigned value and import its output, which must be in environment key format.
+Execute an external program specified as the assigned value and import its output, which must be in environment key format\.
 .RE
 .PP
 \fBfile\fR
 .RS 4
-Import a text file specified as the assigned value, which must be in environment key format.
+Import a text file specified as the assigned value, which must be in environment key format\.
 .RE
 .PP
 \fBparent\fR
 .RS 4
-Import the stored keys from the parent device by reading the database entry of the parent device. The value assigned to
+Import the stored keys from the parent device by reading the database entry of the parent device\. The value assigned to
 \fBIMPORT{parent}\fR
-is used as a filter of key names to import (with the same shell\-style pattern matching used for comparisons).
-.RE
+is used as a filter of key names to import (with the same shell\-style pattern matching used for comparisons)\.
 .RE
-.IP "" 4
+.sp
 If no option is given, udev will choose between
 \fBprogram\fR
 and
 \fBfile\fR
-based on the executable bit of the file permissions.
+based on the executable bit of the file permissions\.
 .RE
 .PP
 \fBWAIT_FOR_SYSFS\fR
 .RS 4
-Wait for the specified sysfs file of the device to be created. Can be used to fight against kernel sysfs timing issues.
+Wait for the specified sysfs file of the device to be created\. Can be used to fight against kernel sysfs timing issues\.
 .RE
 .PP
 \fBOPTIONS\fR
 .RS 4
 Rule and device options:
-.RS 4
 .PP
 \fBlast_rule\fR
 .RS 4
-Stops further rules application. No later rules will have any effect.
+Stops further rules application\. No later rules will have any effect\.
 .RE
 .PP
 \fBignore_device\fR
 .RS 4
-Ignore this event completely.
+Ignore this event completely\.
 .RE
 .PP
 \fBignore_remove\fR
 .RS 4
-Ignore any later remove event for this device. This may be useful as a workaround for broken device drivers.
+Do not remove the device node when the device goes away\. This may be useful as a workaround for broken device drivers\.
 .RE
 .PP
 \fBlink_priority=\fR\fB\fIvalue\fR\fR
 .RS 4
-Specify the priority of the created symlinks. Devices with higher priorities overwrite existing symlinks of other devices.
+Specify the priority of the created symlinks\. Devices with higher priorities overwrite existing symlinks of other devices\.
 .RE
 .PP
 \fBall_partitions\fR
 .RS 4
-Create the device nodes for all available partitions of a block device. This may be useful for removable media devices where media changes are not detected.
+Create the device nodes for all available partitions of a block device\. This may be useful for removable media devices where media changes are not detected\.
 .RE
 .PP
 \fBstring_escape=\fR\fB\fInone|replace\fR\fR
 .RS 4
-Usually control and other possibly unsafe characters are replaced in strings used for device naming. The mode of replacement can be specified with this option.
-.RE
+Usually control and other possibly unsafe characters are replaced in strings used for device naming\. The mode of replacement can be specified with this option\.
 .RE
 .RE
 .PP
@@ -306,23 +302,23 @@ The
 \fBGROUP\fR
 and
 \fBRUN\fR
-fields support simple printf\-like string substitutions. The
+fields support simple printf\-like string substitutions\. The
 \fBRUN\fR
-format chars gets applied after all rules have been processed, right before the program is executed. It allows the use of the complete environment set by earlier matching rules. For all other fields, substitutions are applied while the individual rule is being processed. The available substitutions are:
+format chars gets applied after all rules have been processed, right before the program is executed\. It allows the use of the complete environment set by earlier matching rules\. For all other fields, substitutions are applied while the individual rule is being processed\. The available substitutions are:
 .PP
 \fB$kernel\fR, \fB%k\fR
 .RS 4
-The kernel name for this device.
+The kernel name for this device\.
 .RE
 .PP
 \fB$number\fR, \fB%n\fR
 .RS 4
-The kernel number for this device. For example, 'sda3' has kernel number of '3'
+The kernel number for this device\. For example, \'sda3\' has kernel number of \'3\'
 .RE
 .PP
 \fB$devpath\fR, \fB%p\fR
 .RS 4
-The devpath of the device.
+The devpath of the device\.
 .RE
 .PP
 \fB$id\fR, \fB%b\fR
@@ -332,85 +328,90 @@ The name of the device matched while searching the devpath upwards for
 \fBKERNELS\fR,
 \fBDRIVERS\fR
 and
-\fBATTRS\fR.
+\fBATTRS\fR\.
 .RE
 .PP
-\fB$driver\fR, \fB%d\fR
+\fB$driver\fR
 .RS 4
 The driver name of the device matched while searching the devpath upwards for
 \fBSUBSYSTEMS\fR,
 \fBKERNELS\fR,
 \fBDRIVERS\fR
 and
-\fBATTRS\fR.
+\fBATTRS\fR\.
 .RE
 .PP
 \fB$attr{\fR\fB\fIfile\fR\fR\fB}\fR, \fB%s{\fR\fB\fIfile\fR\fR\fB}\fR
 .RS 4
-The value of a sysfs attribute found at the device, where all keys of the rule have matched. If the matching device does not have such an attribute, all devices along the chain of parents are searched for a matching attribute. If the attribute is a symlink, the last element of the symlink target is returned as the value.
+The value of a sysfs attribute found at the device, where all keys of the rule have matched\. If the matching device does not have such an attribute, all devices along the chain of parents are searched for a matching attribute\. If the attribute is a symlink, the last element of the symlink target is returned as the value\.
 .RE
 .PP
 \fB$env{\fR\fB\fIkey\fR\fR\fB}\fR, \fB%E{\fR\fB\fIkey\fR\fR\fB}\fR
 .RS 4
-The value of an environment variable.
+The value of an environment variable\.
 .RE
 .PP
 \fB$major\fR, \fB%M\fR
 .RS 4
-The kernel major number for the device.
+The kernel major number for the device\.
 .RE
 .PP
 \fB$minor\fR, \fB%m\fR
 .RS 4
-The kernel minor number for the device.
+The kernel minor number for the device\.
 .RE
 .PP
 \fB$result\fR, \fB%c\fR
 .RS 4
-The string returned by the external program requested with PROGRAM. A single part of the string, separated by a space character may be selected by specifying the part number as an attribute:
-\fB%c{N}\fR. If the number is followed by the '+' char this part plus all remaining parts of the result string are substituted:
+The string returned by the external program requested with PROGRAM\. A single part of the string, separated by a space character may be selected by specifying the part number as an attribute:
+\fB%c{N}\fR\. If the number is followed by the \'+\' char this part plus all remaining parts of the result string are substituted:
 \fB%c{N+}\fR
 .RE
 .PP
 \fB$parent\fR, \fB%P\fR
 .RS 4
-The node name of the parent device.
+The node name of the parent device\.
+.RE
+.PP
+\fB$name\fR
+.RS 4
+The name of the device node\. The value is only set if an earlier rule assigned a value, or during a remove events\.
 .RE
 .PP
 \fB$root\fR, \fB%r\fR
 .RS 4
-The udev_root value.
+The udev_root value\.
 .RE
 .PP
 \fB$sys\fR, \fB%S\fR
 .RS 4
-The sysfs mount point.
+The sysfs mount point\.
 .RE
 .PP
 \fB$tempnode\fR, \fB%N\fR
 .RS 4
-The name of a created temporary device node to provide access to the device from a external program before the real node is created.
+The name of a created temporary device node to provide access to the device from a external program before the real node is created\.
 .RE
 .PP
 \fB%%\fR
 .RS 4
-The '%' character itself.
+The \'%\' character itself\.
 .RE
 .PP
 \fB$$\fR
 .RS 4
-The '$' character itself.
+The \'$\' character itself\.
 .RE
 .PP
-The count of characters to be substituted may be limited by specifying the format length value. For example, '%3s{file}' will only insert the first three characters of the sysfs attribute
+The count of characters to be substituted may be limited by specifying the format length value\. For example, \'%3s{file}\' will only insert the first three characters of the sysfs attribute
 .SH "AUTHOR"
 .PP
 Written by Greg Kroah\-Hartman
-<greg at kroah.com>
+<greg at kroah\.com>
 and Kay Sievers
-<kay.sievers at vrfy.org>. With much help from Dan Stekloff
-<dsteklof at us.ibm.com>
-and many others.
+<kay\.sievers at vrfy\.org>\. With much help from Dan Stekloff
+<dsteklof at us\.ibm\.com>
+and many others\.
 .SH "SEE ALSO"
 .PP
 \fBudevd\fR(8),
diff --git a/udev.h b/udev.h
index f13eb83..33b39aa 100644
--- a/udev.h
+++ b/udev.h
@@ -69,6 +69,7 @@ struct udevice {
 	struct sysfs_device dev_local;
 	struct sysfs_device *dev_parent;	/* current parent device used for matching */
 	char action[NAME_SIZE];
+	char *devpath_old;
 
 	/* node */
 	char name[PATH_SIZE];
@@ -131,6 +132,7 @@ extern int udev_node_remove(struct udevice *udev);
 /* udev_db.c */
 extern int udev_db_add_device(struct udevice *dev);
 extern int udev_db_delete_device(struct udevice *dev);
+extern int udev_db_rename(const char *devpath_old, const char *devpath);
 extern int udev_db_get_device(struct udevice *udev, const char *devpath);
 extern int udev_db_get_devices_by_name(const char *name, struct list_head *name_list);
 extern int udev_db_get_all_entries(struct list_head *name_list);
diff --git a/udev.xml b/udev.xml
index b43abb7..83a9d75 100644
--- a/udev.xml
+++ b/udev.xml
@@ -416,8 +416,8 @@
                   <varlistentry>
                     <term><option>ignore_remove</option></term>
                     <listitem>
-                      <para>Ignore any later remove event for this device. This may be useful
-                      as a workaround for broken device drivers.</para>
+                      <para>Do not remove the device node when the device goes away. This may be
+                      useful as a workaround for broken device drivers.</para>
                     </listitem>
                   </varlistentry>
                   <varlistentry>
@@ -488,7 +488,7 @@
             </varlistentry>
 
             <varlistentry>
-              <term><option>$driver</option>, <option>%d</option></term>
+              <term><option>$driver</option></term>
               <listitem>
                 <para>The driver name of the device matched while searching the devpath upwards for
                   <option>SUBSYSTEMS</option>, <option>KERNELS</option>, <option>DRIVERS</option> and <option>ATTRS</option>.
@@ -548,6 +548,14 @@
             </varlistentry>
 
             <varlistentry>
+              <term><option>$name</option></term>
+              <listitem>
+                <para>The name of the device node. The value is only set if an earlier
+                rule assigned a value, or during a remove events.</para>
+              </listitem>
+            </varlistentry>
+
+            <varlistentry>
               <term><option>$root</option>, <option>%r</option></term>
               <listitem>
                 <para>The udev_root value.</para>
diff --git a/udev_db.c b/udev_db.c
index abc1e5a..29aa031 100644
--- a/udev_db.c
+++ b/udev_db.c
@@ -117,6 +117,16 @@ out:
 	return rc;
 }
 
+int udev_db_rename(const char *devpath_old, const char *devpath)
+{
+	char filename[PATH_SIZE];
+	char filename_old[PATH_SIZE];
+
+	devpath_to_db_path(devpath_old, filename_old, sizeof(filename_old));
+	devpath_to_db_path(devpath, filename, sizeof(filename));
+	return rename(filename_old, filename);
+}
+
 int udev_db_add_device(struct udevice *udev)
 {
 	char filename[PATH_SIZE];
diff --git a/udev_device.c b/udev_device.c
index 23ba313..62217ff 100644
--- a/udev_device.c
+++ b/udev_device.c
@@ -168,6 +168,10 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
 {
 	int retval = 0;
 
+	if (udev->devpath_old != NULL)
+		if (udev_db_rename(udev->devpath_old, udev->dev->devpath) == 0)
+			info("moved database from '%s' to '%s'", udev->devpath_old, udev->dev->devpath);
+
 	/* add device node */
 	if (major(udev->devt) != 0 &&
 	    (strcmp(udev->action, "add") == 0 || strcmp(udev->action, "change") == 0)) {
@@ -262,10 +266,6 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
 		/* import database entry, and delete it */
 		if (udev_db_get_device(udev, udev->dev->devpath) == 0) {
 			udev_db_delete_device(udev);
-			if (udev->ignore_remove) {
-				info("ignore_remove for '%s'", udev->name);
-				goto exit;
-			}
 			/* restore stored persistent data */
 			list_for_each_entry(name_loop, &udev->env_list, node)
 				putenv(name_loop->name);
@@ -281,6 +281,10 @@ int udev_device_event(struct udev_rules *rules, struct udevice *udev)
 			goto exit;
 		}
 
+		if (udev->ignore_remove) {
+			info("ignore_remove for '%s'", udev->name);
+			goto exit;
+		}
 		/* remove the node */
 		retval = udev_node_remove(udev);
 
diff --git a/udev_node.c b/udev_node.c
index fcd52d0..25eed86 100644
--- a/udev_node.c
+++ b/udev_node.c
@@ -133,7 +133,7 @@ static int node_symlink(const char *node, const char *slink)
 				    stats.st_rdev == stats2.st_rdev) {
 					info("replace device node '%s' with symlink to our node '%s'", slink, node);
 				} else {
-					err("device node '%s' already exists, link '%s' will not overwrite it", node, slink);
+					err("device node '%s' already exists, link to '%s' will not overwrite it", slink, node);
 					goto exit;
 				}
 			}
diff --git a/udev_rules.c b/udev_rules.c
index 0dcbf15..dcd0914 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -475,10 +475,12 @@ static int pass_env_to_socket(const char *sockname, const char *devpath, const c
 
 	bufpos = snprintf(buf, sizeof(buf)-1, "%s@%s", action, devpath);
 	bufpos++;
-	for (i = 0; environ[i] != NULL && bufpos < sizeof(buf); i++) {
+	for (i = 0; environ[i] != NULL && bufpos < (sizeof(buf)-1); i++) {
 		bufpos += strlcpy(&buf[bufpos], environ[i], sizeof(buf) - bufpos-1);
 		bufpos++;
 	}
+	if (bufpos > sizeof(buf))
+		bufpos = sizeof(buf);
 
 	count = sendto(sock, &buf, bufpos, 0, (struct sockaddr *)&saddr, addrlen);
 	if (count < 0)
@@ -604,6 +606,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
 		SUBST_ATTR,
 		SUBST_PARENT,
 		SUBST_TEMP_NODE,
+		SUBST_NAME,
 		SUBST_ROOT,
 		SUBST_SYS,
 		SUBST_ENV,
@@ -625,6 +628,7 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
 		{ .name = "sysfs",	.fmt = 's',	.type = SUBST_ATTR },
 		{ .name = "parent",	.fmt = 'P',	.type = SUBST_PARENT },
 		{ .name = "tempnode",	.fmt = 'N',	.type = SUBST_TEMP_NODE },
+		{ .name = "name",	.fmt = 'D',	.type = SUBST_NAME },
 		{ .name = "root",	.fmt = 'r',	.type = SUBST_ROOT },
 		{ .name = "sys",	.fmt = 'S',	.type = SUBST_SYS },
 		{ .name = "env",	.fmt = 'E',	.type = SUBST_ENV },
@@ -843,6 +847,10 @@ found:
 			strlcat(string, udev->tmp_node, maxsize);
 			dbg("substitute temporary device node name '%s'", udev->tmp_node);
 			break;
+		case SUBST_NAME:
+			strlcat(string, udev->name, maxsize);
+			dbg("substitute udev->name '%s'", udev->name);
+			break;
 		case SUBST_ROOT:
 			strlcat(string, udev_root, maxsize);
 			dbg("substitute udev_root '%s'", udev_root);
@@ -986,7 +994,8 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
 		}
 	}
 
-	if (rule->test.operation != KEY_OP_UNSET) {
+	if (rule->test.operation == KEY_OP_MATCH ||
+	    rule->test.operation == KEY_OP_NOMATCH) {
 		char filename[PATH_SIZE];
 		char devpath[PATH_SIZE];
 		char *attr;
@@ -1031,7 +1040,7 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
 	if (rule->wait_for_sysfs.operation != KEY_OP_UNSET) {
 		int found;
 
-		found = (wait_for_sysfs(udev, key_val(rule, &rule->wait_for_sysfs), 3) == 0);
+		found = (wait_for_sysfs(udev, key_val(rule, &rule->wait_for_sysfs), 10) == 0);
 		if (!found && (rule->wait_for_sysfs.operation != KEY_OP_NOMATCH))
 			goto nomatch;
 	}
@@ -1464,9 +1473,14 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
 			break;
 
 		dbg("process rule");
-		if (rule->name.operation != KEY_OP_UNSET || rule->symlink.operation != KEY_OP_UNSET ||
-		    rule->mode_operation != KEY_OP_UNSET || rule->owner.operation != KEY_OP_UNSET ||
-		    rule->group.operation != KEY_OP_UNSET) {
+		if (rule->name.operation == KEY_OP_ASSIGN ||
+		    rule->name.operation == KEY_OP_ASSIGN_FINAL ||
+		    rule->name.operation == KEY_OP_ADD ||
+		    rule->symlink.operation == KEY_OP_ASSIGN ||
+		    rule->symlink.operation == KEY_OP_ASSIGN_FINAL ||
+		    rule->symlink.operation == KEY_OP_ADD ||
+		    rule->mode_operation != KEY_OP_UNSET ||
+		    rule->owner.operation != KEY_OP_UNSET || rule->group.operation != KEY_OP_UNSET) {
 			dbg("skip rule that names a device");
 			continue;
 		}
@@ -1477,6 +1491,10 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
 				udev->ignore_device = 1;
 				return 0;
 			}
+			if (rule->ignore_remove) {
+				udev->ignore_remove = 1;
+				dbg("remove event should be ignored");
+			}
 
 			if (!udev->run_final && rule->run.operation != KEY_OP_UNSET) {
 				struct name_entry *entry;
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 3afc31a..9e43581 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -469,6 +469,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
 		}
 
 		if (strncasecmp(key, "TEST", sizeof("TEST")-1) == 0) {
+			if (operation != KEY_OP_MATCH &&
+			    operation != KEY_OP_NOMATCH) {
+				err("invalid TEST operation");
+				goto invalid;
+			}
 			attr = get_key_attribute(key + sizeof("TEST")-1);
 			if (attr != NULL)
 				rule->test_mode_mask = strtol(attr, NULL, 8);
diff --git a/udev_selinux.c b/udev_selinux.c
index 1ad6e8a..3fa84a0 100644
--- a/udev_selinux.c
+++ b/udev_selinux.c
@@ -24,8 +24,8 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <limits.h>
-#include <libgen.h>
 #include <errno.h>
+#include <sys/stat.h>
 #include <selinux/selinux.h>
 
 #include "udev.h"
diff --git a/udev_sysfs.c b/udev_sysfs.c
index 34ae9ac..d5b04c3 100644
--- a/udev_sysfs.c
+++ b/udev_sysfs.c
@@ -355,6 +355,8 @@ char *sysfs_attr_get_value(const char *devpath, const char *attr_name)
 
 	dbg("open '%s'/'%s'", devpath, attr_name);
 	sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full));
+	if(sysfs_len >= sizeof(path_full))
+		sysfs_len = sizeof(path_full) - 1;
 	path = &path_full[sysfs_len];
 	strlcat(path_full, devpath, sizeof(path_full));
 	strlcat(path_full, "/", sizeof(path_full));
diff --git a/udevd.8 b/udevd.8
index 25996d1..46edde4 100644
--- a/udevd.8
+++ b/udevd.8
@@ -1,6 +1,6 @@
 .\"     Title: udevd
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udevd, udevcontrol
 .\"    Source: udev
@@ -11,7 +11,7 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevd \- event managing daemon
+udevd - event managing daemon
 .SH "SYNOPSIS"
 .HP 6
 \fBudevd\fR [\fB\-\-daemon\fR] [\fB\-\-debug\-trace\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
@@ -19,87 +19,87 @@ udevd \- event managing daemon
 \fBudevcontrol \fR\fB\fIcommand\fR\fR
 .SH "DESCRIPTION"
 .PP
-udevd listens to kernel uevents and passes the incoming events to udev. It ensures the right event order and takes care, that events for child devices are delayed until the parent has finished the device handling.
+udevd listens to kernel uevents and passes the incoming events to udev\. It ensures the right event order and takes care, that events for child devices are delayed until the parent has finished the device handling\.
 .SH "OPTIONS"
 .PP
 \fB\-\-daemon\fR
 .RS 4
-Detach and run in the background.
+Detach and run in the background\.
 .RE
 .PP
 \fB\-\-debug\-trace\fR
 .RS 4
-Run all events completely serialized. This may be useful if udev triggers actions or loads kernel modules which cause problems and a slow but continuous operation is needed, where no events are processed in parallel.
+Run all events completely serialized\. This may be useful if udev triggers actions or loads kernel modules which cause problems and a slow but continuous operation is needed, where no events are processed in parallel\.
 .RE
 .PP
 \fB\-\-verbose\fR
 .RS 4
-Print log messages to stdout.
+Print log messages to stdout\.
 .RE
 .PP
 \fB\-\-version\fR
 .RS 4
-Print version number.
+Print version number\.
 .RE
 .PP
 \fB\-\-help\fR
 .RS 4
-Print usage.
+Print usage\.
 .RE
 .PP
 \fBlog_priority=\fR\fB\fIvalue\fR\fR
 .RS 4
-Set the internal log level of udevd. Valid values are the numerical syslog priorities or their textual representations:
+Set the internal log level of udevd\. Valid values are the numerical syslog priorities or their textual representations:
 \fBerr\fR,
 \fBinfo\fR
 and
-\fBdebug\fR.
+\fBdebug\fR\.
 .RE
 .PP
 \fBstop_exec_queue\fR
 .RS 4
-Signal udevd to stop executing new events. Incoming events will be queued.
+Signal udevd to stop executing new events\. Incoming events will be queued\.
 .RE
 .PP
 \fBstart_exec_queue\fR
 .RS 4
-Signal udevd to enable the execution of events.
+Signal udevd to enable the execution of events\.
 .RE
 .PP
 \fBreload_rules\fR
 .RS 4
-Signal udevd to reload the rules from the config.
+Signal udevd to reload the rules from the config\.
 .RE
 .PP
 \fBenv \fR\fB\fIvar\fR\fR\fB=\fR\fB\fIvalue\fR\fR
 .RS 4
-Set global variable.
+Set global variable\.
 .RE
 .PP
 \fBmax_childs\fR
 .RS 4
-Set the maximum number of events, udevd will handle at the same time.
+Set the maximum number of events, udevd will handle at the same time\.
 .RE
 .PP
 \fBmax_childs_running\fR
 .RS 4
-Set the maximum number of events, which are allowed to run at the same time.
+Set the maximum number of events, which are allowed to run at the same time\.
 .RE
 .PP
 \fBhelp\fR
 .RS 4
-Print help text.
+Print help text\.
 .RE
 .SH "ENVIRONMENT"
 .PP
 \fBUDEV_LOG\fR
 .RS 4
-Overrides the syslog priority specified in the config file.
+Overrides the syslog priority specified in the config file\.
 .RE
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>.
+<kay\.sievers at vrfy\.org>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevd.c b/udevd.c
index 8f56de6..5ff5d3f 100644
--- a/udevd.c
+++ b/udevd.c
@@ -130,6 +130,7 @@ static int udev_event_process(struct udevd_uevent_msg *msg)
 		return -1;
 	strlcpy(udev->action, msg->action, sizeof(udev->action));
 	sysfs_device_set_values(udev->dev, msg->devpath, msg->subsystem, msg->driver);
+	udev->devpath_old = msg->devpath_old;
 	udev->devt = msg->devt;
 
 	retval = udev_device_event(&rules, udev);
@@ -156,14 +157,14 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
 	struct udevd_uevent_msg *loop_msg;
 	int fd;
 
-	/* add location of queue files */
+	/* location of queue file */
 	strlcpy(filename, udev_root, sizeof(filename));
 	strlcat(filename, "/", sizeof(filename));
 	start = strlcat(filename, EVENT_QUEUE_DIR"/", sizeof(filename));
 	strlcat(filename, msg->devpath, sizeof(filename));
 	path_encode(&filename[start], sizeof(filename) - start);
 
-	/* add location of failed files */
+	/* location of failed file */
 	strlcpy(filename_failed, udev_root, sizeof(filename_failed));
 	strlcat(filename_failed, "/", sizeof(filename_failed));
 	start = strlcat(filename_failed, EVENT_FAILED_DIR"/", sizeof(filename_failed));
@@ -174,6 +175,7 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
 	case EVENT_QUEUED:
 		unlink(filename_failed);
 		delete_path(filename_failed);
+
 		create_path(filename);
 		fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
 		if (fd > 0)
@@ -181,10 +183,25 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
 		return;
 	case EVENT_FINISHED:
 	case EVENT_FAILED:
-		unlink(filename_failed);
-		delete_path(filename_failed);
+		if (msg->devpath_old != NULL) {
+			/* "move" event - rename failed file to current name, do not delete failed */
+			char filename_failed_old[PATH_SIZE];
+
+			strlcpy(filename_failed_old, udev_root, sizeof(filename_failed_old));
+			strlcat(filename_failed_old, "/", sizeof(filename_failed_old));
+			start = strlcat(filename_failed_old, EVENT_FAILED_DIR"/", sizeof(filename_failed_old));
+			strlcat(filename_failed_old, msg->devpath_old, sizeof(filename_failed_old));
+			path_encode(&filename_failed_old[start], sizeof(filename) - start);
+
+			if (rename(filename_failed_old, filename_failed) == 0)
+				info("renamed devpath, moved failed state of '%s' to %s'",
+				     msg->devpath_old, msg->devpath);
+		} else {
+			unlink(filename_failed);
+			delete_path(filename_failed);
+		}
 
-		/* don't remove, if events for the same path are still pending */
+		/* skip if events for the same path are still pending */
 		list_for_each_entry(loop_msg, &running_list, node)
 			if (loop_msg->devpath && strcmp(loop_msg->devpath, msg->devpath) == 0)
 				return;
@@ -193,7 +210,7 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
 			if (loop_msg->devpath && strcmp(loop_msg->devpath, msg->devpath) == 0)
 				return;
 
-		/* move failed events to the failed directory */
+		/* move failed event to the failed directory */
 		if (state == EVENT_FAILED) {
 			create_path(filename_failed);
 			rename(filename, filename_failed);
@@ -201,7 +218,7 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
 			unlink(filename);
 		}
 
-		/* clean up the queue directory */
+		/* clean up possibly empty queue directory */
 		delete_path(filename);
 
 		return;
@@ -212,7 +229,7 @@ static void msg_queue_delete(struct udevd_uevent_msg *msg)
 {
 	list_del(&msg->node);
 
-	/* mark as failed, if add event returns non-zero */
+	/* mark as failed, if "add" event returns non-zero */
 	if (msg->exitstatus && strcmp(msg->action, "add") == 0)
 		export_event_state(msg, EVENT_FAILED);
 	else
@@ -280,6 +297,7 @@ static void msg_queue_insert(struct udevd_uevent_msg *msg)
 	}
 
 	export_event_state(msg, EVENT_QUEUED);
+	info("seq %llu forked, '%s' '%s'", msg->seqnum, msg->action, msg->subsystem);
 
 	/* run one event after the other in debug mode */
 	if (debug_trace) {
@@ -469,11 +487,16 @@ static int devpath_busy(struct udevd_uevent_msg *msg, int limit)
 		if (loop_msg->seqnum >= msg->seqnum)
 			break;
 
+		/* check our old name */
+		if (msg->devpath_old != NULL)
+			if (strcmp(loop_msg->devpath , msg->devpath_old) == 0)
+				return 2;
+
 		/* check identical, parent, or child device event */
 		if (compare_devpath(loop_msg->devpath, msg->devpath) != 0) {
 			dbg("%llu, device event still pending %llu (%s)",
 			    msg->seqnum, loop_msg->seqnum, loop_msg->devpath);
-			return 2;
+			return 3;
 		}
 
 		/* check physical device event (special case of parent) */
@@ -481,22 +504,27 @@ static int devpath_busy(struct udevd_uevent_msg *msg, int limit)
 			if (compare_devpath(loop_msg->devpath, msg->physdevpath) != 0) {
 				dbg("%llu, physical device event still pending %llu (%s)",
 				    msg->seqnum, loop_msg->seqnum, loop_msg->devpath);
-				return 3;
+				return 4;
 			}
 	}
 
-	/* check runing-queue for still running events */
+	/* check run queue for still running events */
 	list_for_each_entry(loop_msg, &running_list, node) {
 		if (limit && childs_count++ > limit) {
 			dbg("%llu, maximum number (%i) of childs reached", msg->seqnum, childs_count);
 			return 1;
 		}
 
+		/* check our old name */
+		if (msg->devpath_old != NULL)
+			if (strcmp(loop_msg->devpath , msg->devpath_old) == 0)
+				return 2;
+
 		/* check identical, parent, or child device event */
 		if (compare_devpath(loop_msg->devpath, msg->devpath) != 0) {
 			dbg("%llu, device event still running %llu (%s)",
 			    msg->seqnum, loop_msg->seqnum, loop_msg->devpath);
-			return 2;
+			return 3;
 		}
 
 		/* check physical device event (special case of parent) */
@@ -504,7 +532,7 @@ static int devpath_busy(struct udevd_uevent_msg *msg, int limit)
 			if (compare_devpath(loop_msg->devpath, msg->physdevpath) != 0) {
 				dbg("%llu, physical device event still running %llu (%s)",
 				    msg->seqnum, loop_msg->seqnum, loop_msg->devpath);
-				return 3;
+				return 4;
 			}
 	}
 	return 0;
@@ -588,6 +616,8 @@ static struct udevd_uevent_msg *get_msg_from_envbuf(const char *buf, int buf_siz
 			msg->driver = &key[7];
 		else if (strncmp(key, "SEQNUM=", 7) == 0)
 			msg->seqnum = strtoull(&key[7], NULL, 10);
+		else if (strncmp(key, "DEVPATH_OLD=", 12) == 0)
+			msg->devpath_old = &key[12];
 		else if (strncmp(key, "PHYSDEVPATH=", 12) == 0)
 			msg->physdevpath = &key[12];
 		else if (strncmp(key, "PHYSDEVDRIVER=", 14) == 0)
diff --git a/udevd.h b/udevd.h
index 4ca6d1d..9be34cb 100644
--- a/udevd.h
+++ b/udevd.h
@@ -66,6 +66,7 @@ struct udevd_uevent_msg {
 	char *driver;
 	dev_t devt;
 	unsigned long long seqnum;
+	char *devpath_old;
 	char *physdevpath;
 	unsigned int timeout;
 	char *envp[UEVENT_NUM_ENVP+1];
diff --git a/udevinfo.8 b/udevinfo.8
index 337f206..6115f29 100644
--- a/udevinfo.8
+++ b/udevinfo.8
@@ -1,6 +1,6 @@
 .\"     Title: udevinfo
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udevinfo
 .\"    Source: udev
@@ -11,32 +11,32 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevinfo \- query udev device information
+udevinfo - query udev device information
 .SH "SYNOPSIS"
 .HP 9
 \fBudevinfo\fR [\fB\-\-query=\fR\fB\fIquery\-type\fR\fR] [\fB\-\-path=\fR\fB\fIdevpath\fR\fR] [\fB\-\-name=\fR\fB\fInode\fR\fR] [\fB\-\-root\fR] [\fB\-\-attribute\-walk\fR] [\fB\-\-export\-db\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
 .SH "DESCRIPTION"
 .PP
-udevinfo queries the udev database for device information stored in the udev database. It can also query the properties of a device from its sysfs representation to help creating udev rules that match this device.
+udevinfo queries the udev database for device information stored in the udev database\. It can also query the properties of a device from its sysfs representation to help creating udev rules that match this device\.
 .SH "OPTIONS"
 .PP
 \fB\-\-query=\fR\fB\fItype\fR\fR
 .RS 4
-Query the database for specified type of device data. It needs the
+Query the database for specified type of device data\. It needs the
 \fB\-\-path\fR
 or
 \fB\-\-name\fR
-to identify the specified device. Valid queries are:
+to identify the specified device\. Valid queries are:
 \fBname\fR,
 \fBsymlink\fR,
 \fBpath\fR,
 \fBenv\fR,
-\fBall\fR.
+\fBall\fR\.
 .RE
 .PP
 \fB\-\-path=\fR\fB\fIdevpath\fR\fR
 .RS 4
-The devpath of the device to query.
+The devpath of the device to query\.
 .RE
 .PP
 \fB\-\-name=\fR\fB\fInode\fR\fR
@@ -47,36 +47,36 @@ The name of the device node or a symlink to query
 \fB\-\-root\fR
 .RS 4
 The udev root directory:
-\fI/dev\fR. If used in conjunction with a
+\fI/dev\fR\. If used in conjunction with a
 \fBname\fR
 or
 \fBsymlink\fR
-query, the query returns the absolute path including the root directory.
+query, the query returns the absolute path including the root directory\.
 .RE
 .PP
 \fB\-\-attribute\-walk\fR
 .RS 4
-Print all sysfs properties of the specified device that can be used in udev rules to match the specified device. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules.
+Print all sysfs properties of the specified device that can be used in udev rules to match the specified device\. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules\.
 .RE
 .PP
 \fB\-\-export\-db\fR
 .RS 4
-Export the content of the udev database.
+Export the content of the udev database\.
 .RE
 .PP
 \fB\-\-version\fR
 .RS 4
-Print version.
+Print version\.
 .RE
 .PP
 \fB\-\-help\fR
 .RS 4
-Print help text.
+Print help text\.
 .RE
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>.
+<kay\.sievers at vrfy\.org>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevinfo.c b/udevinfo.c
index d0b1c44..be9aa76 100644
--- a/udevinfo.c
+++ b/udevinfo.c
@@ -79,6 +79,8 @@ static void print_all_attributes(const char *devpath, const char *key)
 			if (attr_value == NULL)
 				continue;
 			len = strlcpy(value, attr_value, sizeof(value));
+			if(len >= sizeof(value))
+				len = sizeof(value) - 1;
 			dbg("attr '%s'='%s'(%zi)", dent->d_name, value, len);
 
 			/* remove trailing newlines */
diff --git a/udevmonitor.8 b/udevmonitor.8
index 0adb998..5b624a7 100644
--- a/udevmonitor.8
+++ b/udevmonitor.8
@@ -1,6 +1,6 @@
 .\"     Title: udevmonitor
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udevmonitor
 .\"    Source: udev
@@ -11,38 +11,38 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevmonitor \- print the kernel and udev event sequence to the console
+udevmonitor - print the kernel and udev event sequence to the console
 .SH "SYNOPSIS"
 .HP 12
 \fBudevmonitor\fR [\fB\-\-environment\fR] [\fB\-\-kernel\fR] [\fB\-\-udev\fR] [\fB\-\-help\fR]
 .SH "DESCRIPTION"
 .PP
-udevmonitor listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event.
+udevmonitor listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console\. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event\.
 .SH "OPTIONS"
 .PP
 \fB\-\-environment\fR
 .RS 4
-Print the complete environment for all events. Can be used to compare the kernel supplied and the udev added environment values.
+Print the complete environment for all events\. Can be used to compare the kernel supplied and the udev added environment values\.
 .RE
 .PP
 \fB\-\-kernel\fR
 .RS 4
-Print the kernel uevents.
+Print the kernel uevents\.
 .RE
 .PP
 \fB\-\-udev\fR
 .RS 4
-Print the udev event after the rule processing.
+Print the udev event after the rule processing\.
 .RE
 .PP
 \fB\-\-help\fR
 .RS 4
-Print usage.
+Print usage\.
 .RE
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>.
+<kay\.sievers at vrfy\.org>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevmonitor.c b/udevmonitor.c
index a9cc061..644a955 100644
--- a/udevmonitor.c
+++ b/udevmonitor.c
@@ -43,7 +43,6 @@ static int init_udev_monitor_socket(void)
 {
 	struct sockaddr_un saddr;
 	socklen_t addrlen;
-	const int feature_on = 1;
 	int retval;
 
 	memset(&saddr, 0x00, sizeof(saddr));
@@ -67,9 +66,6 @@ static int init_udev_monitor_socket(void)
 		return -1;
 	}
 
-	/* enable receiving of the sender credentials */
-	setsockopt(udev_monitor_sock, SOL_SOCKET, SO_PASSCRED, &feature_on, sizeof(feature_on));
-
 	return 0;
 }
 
diff --git a/udevsettle.8 b/udevsettle.8
index 818a7ff..39054d9 100644
--- a/udevsettle.8
+++ b/udevsettle.8
@@ -1,6 +1,6 @@
 .\"     Title: udevsettle
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: March 2006
 .\"    Manual: udevsettle
 .\"    Source: udev
@@ -11,29 +11,29 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevsettle \- wait until queued kernel/udev events are handled
+udevsettle - wait until queued kernel/udev events are handled
 .SH "SYNOPSIS"
 .HP 11
 \fBudevsettle\fR [\fB\-\-timeout=\fR\fB\fIseconds\fR\fR]
 .SH "DESCRIPTION"
 .PP
-Waits watching the udev event queue and exits if all current events are handled.
+Waits watching the udev event queue and exits if all current events are handled\.
 .SH "OPTIONS"
 .PP
 \fB\-\-timeout=\fR\fB\fIseconds\fR\fR
 .RS 4
-maximum seconds to wait for the queue to become empty.
+maximum seconds to wait for the queue to become empty\.
 .RE
 .SH "ENVIRONMENT"
 .PP
 \fBUDEV_LOG\fR
 .RS 4
-Overrides the syslog priority specified in the config file.
+Overrides the syslog priority specified in the config file\.
 .RE
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>.
+<kay\.sievers at vrfy\.org>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevstart.8 b/udevstart.8
index ac7d070..6b463cf 100644
--- a/udevstart.8
+++ b/udevstart.8
@@ -1,6 +1,6 @@
 .\"     Title: udevstart
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udevstart
 .\"    Source: udev
@@ -11,17 +11,17 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevstart \- populate initial device directory
+udevstart - populate initial device directory
 .SH "SYNOPSIS"
 .HP 10
 \fBudevstart\fR
 .SH "DESCRIPTION"
 .PP
-udevstart scans the kernel exported device information available in sysfs for devices which require a device node to operate and creates the node using the specified udev rules. udevstart is used to create the initial device directory after system bootup.
+udevstart scans the kernel exported device information available in sysfs for devices which require a device node to operate and creates the node using the specified udev rules\. udevstart is used to create the initial device directory after system bootup\.
 .SH "AUTHOR"
 .PP
 Written by Harald Hoyer
-<harald at redhat.com>.
+<harald at redhat\.com>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevtest.8 b/udevtest.8
index 9ab9249..a090465 100644
--- a/udevtest.8
+++ b/udevtest.8
@@ -1,6 +1,6 @@
 .\"     Title: udevtest
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: August 2005
 .\"    Manual: udevtest
 .\"    Source: udev
@@ -11,17 +11,17 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevtest \- simulate a udev run and print the action to the console
+udevtest - simulate a udev run and print the action to the console
 .SH "SYNOPSIS"
 .HP 21
 \fBudevtest \fR\fB\fIdevice\-path\fR\fR
 .SH "DESCRIPTION"
 .PP
-udevtest simulates a udev run for the given device and prints out the name of the node udev would have created, or the name of the network interface, that would have been renamed.
+udevtest simulates a udev run for the given device and prints out the name of the node udev would have created, or the name of the network interface, that would have been renamed\.
 .SH "AUTHOR"
 .PP
 Written by Greg Kroah\-Hartman
-<greg at kroah.com>.
+<greg at kroah\.com>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevtrigger.8 b/udevtrigger.8
index 5ef9e8f..06c7e45 100644
--- a/udevtrigger.8
+++ b/udevtrigger.8
@@ -1,6 +1,6 @@
 .\"     Title: udevtrigger
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
 .\"      Date: March 2006
 .\"    Manual: udevtrigger
 .\"    Source: udev
@@ -11,66 +11,66 @@
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-udevtrigger \- request kernel devices events for coldplug
+udevtrigger - request kernel devices events for coldplug
 .SH "SYNOPSIS"
 .HP 12
 \fBudevtrigger\fR [\fB\-\-verbose\fR] [\fB\-\-dry\-run\fR] [\fB\-\-retry\-failed\fR] [\fB\-\-help\fR] [\fB\-\-action=\fR\fB\fIaction\fR\fR] [\fB\-\-subsystem\-match=\fR\fB\fIsubsystem\fR\fR] [\fB\-\-subsystem\-nomatch=\fR\fB\fIsubsystem\fR\fR] [\fB\-\-attr\-match=\fR\fB\fIattribute=value\fR\fR] [\fB\-\-attr\-nomatch=\fR\fB\fIattribute=value\fR\fR]
 .SH "DESCRIPTION"
 .PP
-Trigger kernel device uevents to replay missing events at system coldplug.
+Trigger kernel device uevents to replay missing events at system coldplug\.
 .SH "OPTIONS"
 .PP
 \fB\-\-verbose\fR
 .RS 4
-Print the list of devices which will be triggered.
+Print the list of devices which will be triggered\.
 .RE
 .PP
 \fB\-\-dry\-run\fR
 .RS 4
-Do not actually trigger the event.
+Do not actually trigger the event\.
 .RE
 .PP
 \fB\-\-retry\-failed\fR
 .RS 4
-Trigger only the events which are failed during a previous run.
+Trigger only the events which are failed during a previous run\.
 .RE
 .PP
 \fB\-\-action=\fR\fB\fIaction\fR\fR
 .RS 4
-Type of event to be triggered. The default value is "add".
+Type of event to be triggered\. The default value is "add"\.
 .RE
 .PP
 \fB\-\-subsystem\-match=\fR\fB\fIsubsystem\fR\fR
 .RS 4
-Trigger events for devices which belong to a matching subsystem. This option can be specified multiple times and supports shell style pattern matching.
+Trigger events for devices which belong to a matching subsystem\. This option can be specified multiple times and supports shell style pattern matching\.
 .RE
 .PP
 \fB\-\-subsystem\-nomatch=\fR\fB\fIsubsystem\fR\fR
 .RS 4
-Do not trigger events for devices which belong to a matching subsystem. This option can be specified multiple times and supports shell style pattern matching.
+Do not trigger events for devices which belong to a matching subsystem\. This option can be specified multiple times and supports shell style pattern matching\.
 .RE
 .PP
 \fB\-\-attr\-match=\fR\fB\fIattribute=value\fR\fR
 .RS 4
-Trigger events for devices with a matching sysfs attribute. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching. If no value is specified, the existence of the sysfs attribute is checked. This option can be specified multiple times.
+Trigger events for devices with a matching sysfs attribute\. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\. If no value is specified, the existence of the sysfs attribute is checked\. This option can be specified multiple times\.
 .RE
 .PP
 \fB\-\-attr\-nomatch\fR\fB\fIattribute=value\fR\fR
 .RS 4
-Do not trigger events for devices with a matching sysfs attribute. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching. If no value is specified, the existence of the sysfs attribute is checked. This option can be specified multiple times.
+Do not trigger events for devices with a matching sysfs attribute\. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching\. If no value is specified, the existence of the sysfs attribute is checked\. This option can be specified multiple times\.
 .RE
 .SH "ENVIRONMENT"
 .PP
 \fBUDEV_LOG\fR
 .RS 4
-Overrides the syslog priority specified in the config file.
+Overrides the syslog priority specified in the config file\.
 .RE
 .SH "AUTHOR"
 .PP
 Written by Kay Sievers
-<kay.sievers at vrfy.org>
+<kay\.sievers at vrfy\.org>
 and Hannes Reinecke
-<hare at suse.de>.
+<hare at suse\.de>\.
 .SH "SEE ALSO"
 .PP
 \fBudev\fR(7)
diff --git a/udevtrigger.c b/udevtrigger.c
index cf8f209..309c54a 100644
--- a/udevtrigger.c
+++ b/udevtrigger.c
@@ -435,6 +435,8 @@ static void scan_failed(void)
 				continue;
 
 			start = strlcpy(device, sysfs_path, sizeof(device));
+			if(start >= sizeof(device))
+				start = sizeof(device) - 1;
 			strlcat(device, dent->d_name, sizeof(device));
 			path_decode(&device[start]);
 			device_list_insert(device);

udev-115-looplast.patch:

--- NEW FILE udev-115-looplast.patch ---
--- udev-115/etc/udev/rules.d/50-udev-default.rules.looplast	2007-09-07 14:32:01.000000000 +0200
+++ udev-115/etc/udev/rules.d/50-udev-default.rules	2007-09-07 14:33:14.000000000 +0200
@@ -9,6 +9,9 @@ KERNEL=="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*",
 KERNEL=="console",		MODE="0600", OPTIONS="last_rule"
 KERNEL=="tty0",			SYMLINK+="systty"
 
+# loop
+KERNEL=="loop[0-9]", SUBSYSTEM=="block", GROUP="disk", MODE="0640", OPTIONS+="last_rule"
+
 # serial
 KERNEL=="tty[A-Z]*|pppox*|ircomm*|noz*", GROUP="uucp"
 KERNEL=="ppp",			MODE="0600", OPTIONS+="ignore_remove"

udev-115-rulesinstall.patch:

--- NEW FILE udev-115-rulesinstall.patch ---
--- udev-115/Makefile.rulesinstall	2007-09-07 14:46:07.000000000 +0200
+++ udev-115/Makefile	2007-09-07 14:46:38.000000000 +0200
@@ -234,9 +234,9 @@ install-config:
 	@ if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \
 		$(INSTALL_DATA) etc/udev/udev.conf $(DESTDIR)$(configdir); \
 	fi
-	@ for i in $(shell ls -1 etc/udev/rules.d); do \
-		if [ ! -r $(DESTDIR)$(configdir)/rules.d/$$i ]; then \
-			$(INSTALL_DATA) etc/udev/rules.d/$$i $(DESTDIR)$(configdir)/rules.d; \
+	@ for i in etc/udev/rules.d/*.rules; do \
+		if [ ! -r $(DESTDIR)$(configdir)/rules.d/$$(basename $$i) ]; then \
+			$(INSTALL_DATA) $$i $(DESTDIR)$(configdir)/rules.d; \
 		fi \
 	done
 	@ extras="$(EXTRAS)"; for target in $$extras; do \


Index: udev.spec
===================================================================
RCS file: /cvs/pkgs/rpms/udev/devel/udev.spec,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -r1.218 -r1.219
--- udev.spec	24 Aug 2007 08:37:19 -0000	1.218
+++ udev.spec	7 Sep 2007 12:52:05 -0000	1.219
@@ -6,7 +6,7 @@
 Summary: A userspace implementation of devfs
 Name: udev
 Version: 115
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2
 Group: System Environment/Base
 Provides: udev-persistent = %{version}-%{release}
@@ -20,6 +20,9 @@
 
 Patch1: udev-089-nopie.patch
 Patch2: udev-091-lib64.patch
+Patch3: udev-115-git-20070907.patch
+Patch4: udev-115-looplast.patch
+Patch5: udev-115-rulesinstall.patch
 
 ExclusiveOS: Linux
 URL: http://kernel.org/pub/linux/utils/kernel/hotplug/
@@ -69,6 +72,9 @@
 %setup -q  
 %patch1 -p1 -b .nopie
 %patch2 -p1 -b .lib64
+%patch3 -p1 -b .git20070907
+%patch4 -p1 -b .looplast
+%patch5 -p1 -b .rulesinstall
 
 rm -f etc/udev/redhat/51-hotplug.rules etc/udev/redhat/50* etc/udev/redhat/06*
 %build
@@ -183,7 +189,6 @@
 
 for i in \
 	etc/udev/redhat/*.rules \
-	etc/udev/rules.d/*.rules \
 	etc/udev/packages/40-ia64.rules \
 	etc/udev/packages/40-alsa.rules \
 	etc/udev/packages/40-ppc.rules \
@@ -347,6 +352,10 @@
 %{_libdir}/pkgconfig/libvolume_id.pc 
 
 %changelog
+* Fri Sep 07 2007 Harald Hoyer <harald at redhat.com> - 115-2
+- some upstream fixes from git
+- last_rule for loop rules (speedup for live-cds/qemu with 128 loop devices)
+
 * Thu Aug 24 2007 Harald Hoyer <harald at redhat.com> - 115-1
 - version 115
 




More information about the fedora-extras-commits mailing list