Hello community, here is the log from the commit of package udev checked in at Sun Jul 9 23:29:10 CEST 2006. -------- --- udev/udev.changes 2006-06-14 12:17:30.000000000 +0200 +++ udev/udev.changes 2006-07-09 21:54:30.000000000 +0200 @@ -1,0 +2,11 @@ +Sun Jul 9 21:53:37 CEST 2006 - kay.sievers@suse.de + +- new upstream release 096 + fix for path_id and kernel 2.6.18 (#191165) + +------------------------------------------------------------------- +Tue Jul 4 12:38:42 CEST 2006 - kay.sievers@suse.de + +- new upstream release 095 + +------------------------------------------------------------------- Old: ---- udev-094.tar.bz2 New: ---- udev-096.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ udev.spec ++++++ --- /var/tmp/diff_new_pack.22Rpwn/_old 2006-07-09 23:28:33.000000000 +0200 +++ /var/tmp/diff_new_pack.22Rpwn/_new 2006-07-09 23:28:33.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package udev (Version 094) +# spec file for package udev (Version 096) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,7 +12,7 @@ Name: udev URL: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ -Version: 094 +Version: 096 Release: 1 License: GPL Group: System/Kernel @@ -255,6 +255,11 @@ /%{_lib}/libvolume_id.so.* %changelog -n udev +* Sun Jul 09 2006 - kay.sievers@suse.de +- new upstream release 096 + fix for path_id and kernel 2.6.18 (#191165) +* Tue Jul 04 2006 - kay.sievers@suse.de +- new upstream release 095 * Mon Jun 12 2006 - kay.sievers@suse.de - update from upstream version 085 to 094 (integrating previous patches) ++++++ udev-094.tar.bz2 -> udev-096.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/ChangeLog new/udev-096/ChangeLog --- old/udev-094/ChangeLog 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/ChangeLog 2006-07-09 21:48:19.000000000 +0200 @@ -1,3 +1,28 @@ +Summary of changes from v095 to v096 +============================================ + +Kay Sievers: + Makefiles: fix .PHONY for man page target + allow longer devpath values + path_id: prepare for new sysfs layout + + +Summary of changes from v094 to v095 +============================================ + +Kay Sievers: + update SUSE rules + don't remove symlinks if they are already there + allow "online" events to create/update symlinks + udevinfo: clarify parent device attribute use + update SUSE rules + netif rename: optimistic loop for the name to become free + remove broken %e enumeration + +Tobias Klauser: + print usage of udevcontrol when no or invalid command is given + + Summary of changes from v093 to v094 ============================================ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/FAQ new/udev-096/FAQ --- old/udev-094/FAQ 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/FAQ 2006-07-09 21:48:19.000000000 +0200 @@ -14,7 +14,7 @@ All device naming policy permission control and event handling is done in userspace. devfs is operated from within the kernel. -Q: Why was devfs marked OBSOLETE/removed if udev can't do everthing devfs did? +Q: Why was devfs removed if udev can't do everthing devfs did? A: To quote Al Viro (Linux VFS kernel maintainer): - it was determined that the same thing could be done in userspace - devfs had been shoved into the tree in hope that its quality will @@ -46,31 +46,25 @@ spurious. Q: I really like the devfs naming scheme, will udev do that? -A: Yes, udev can create /dev nodes using the devfs naming policy. A - configuration file needs to be created to map the kernel default names - to the devfs names. See the udev.rules.devfs file in the udev - release. - Note that the devfs scheme is not recommended or officially supported - because it is a really stupid idea to simply enumerate devices in a world - where devices can come and go at any time. These numbers give you nothing - but problems, and are not useful to identify a device. Have a look at the - persistent disk rules for an example how to do it correctly in userspace - without any stupid device enumeration. +A: Yes, udev can create /dev nodes using the devfs naming policy. But you + will need a custom configuration and scripts that enumerate your devices + sequentially while events run in parallel, without a predictable order. + The devfs scheme is not recommended or supported because it is a stupid + idea to simply enumerate devices in a world where devices can come and go + at any time. These numbers give you nothing but problems, and are not + useful to identify a device. Have a look at the persistent rules for + examples how to create persistent device names in userspace without any + device enumeration depending on the device probing order. Q: What kinds of devices does udev create nodes for? -A: All devices that are shown in sysfs will work with udev. If more - support is added for devices to the kernel, udev will automatically - start working for them. All block devices are currently supported, and - almost all major char devices are supported. Kernel developers are - working on adding support for all char devices at this time. See the - linux-kernel mailing list for patches and status of these patches. +A: All devices that are shown in the kernel's sysfs tree will work with udev. Q: Will udev remove the limit on the number of anonymous devices? A: udev is entirely in userspace. If the kernel supports a greater number of anonymous devices, udev will support it. -Q: Will udev support symlinks? -A: Yes, It now does. Multiple symlinks per device node are supported. +Q: Does udev support symlinks? +A: Yes, multiple symlinks per device node are supported. Q: How will udev handle the /dev filesystem? A: /dev is recomended to be a tmpfs filesystem that is recreated on every reboot. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/Makefile new/udev-096/Makefile --- old/udev-094/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -17,7 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -VERSION = 094 +VERSION = 096 # set this to make use of syslog USE_LOG = true diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/RELEASE-NOTES new/udev-096/RELEASE-NOTES --- old/udev-094/RELEASE-NOTES 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/RELEASE-NOTES 2006-07-09 21:48:19.000000000 +0200 @@ -1,3 +1,14 @@ +udev 096 +======== +fix path_id for recent kernels + +udev 095 +======== +%e is finaly gone. + +Added support for swapping network interface names, by temporarily +renaming the device and wait for the target name to become free. + udev 094 ======== The built-in MODALIAS key and substitution is removed. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/TODO new/udev-096/TODO --- old/udev-094/TODO 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/TODO 2006-07-09 21:48:19.000000000 +0200 @@ -7,9 +7,6 @@ These things are deprecated and scheduled for removal in a future udev version: - o remove broken %e enumeration - (simple enumerations can't work reliably and should go) - o remove udevstart (we rely on the kernel "uevent" triggers of kernel 2.6.15 and no longer want to guess event properties from sysfs like udevstart is doing it) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/docs/udev_vs_devfs new/udev-096/docs/udev_vs_devfs --- old/udev-094/docs/udev_vs_devfs 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/docs/udev_vs_devfs 2006-07-09 21:48:19.000000000 +0200 @@ -101,7 +101,7 @@ want to deviate away from this standard (for example when naming some devices in a persistent manner), it is easily possible to do so. - 3) udev is small (49Kb binary) and is entirely in userspace, which + 3) udev is small and is entirely in userspace, which is swapable, and doesn't have to be running at all times. Nice, 7 out of 7 for udev. Makes you think the problems and constraints @@ -146,7 +146,7 @@ As the above scenarios show, both desktop users and big iron users both need to not worry about which device is assigned to what major/minor device. - + udev doesn't care what major/minor number is assigned to a device. It merely takes the numbers that the kernel says it assigned to the device and creates a device node based on it, which the user can @@ -174,7 +174,7 @@ For more information on how to create udev rules to name devices, please see the udev man page, and look at the example udev rules that ship with the tarball. - + So, convinced already why you should use udev instead of devfs? No. Ok, fine, I'm not forcing you to abandon your bloated, stifling policy, diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/etc/udev/suse/45-isdn.rules new/udev-096/etc/udev/suse/45-isdn.rules --- old/udev-094/etc/udev/suse/45-isdn.rules 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/etc/udev/suse/45-isdn.rules 1970-01-01 01:00:00.000000000 +0100 @@ -1,50 +0,0 @@ -# CAPI devices -SUBSYSTEM="capi", GROUP="dialout" -KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" -KERNEL=="capi*", NAME="capi/%n" - -# ISDN devices -KERNEL=="isdn*", NAME="%k", MODE="600" -KERNEL=="isdnctrl*", NAME="%k", MODE="600" -KERNEL=="ippp*", NAME="%k", MODE="600" -KERNEL=="isdninfo*", NAME="%k", MODE="444" - -# ISDN USB -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/c00*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/1000*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/1900*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2000*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2200*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2300*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2800*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/3000*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/3500*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/3600*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2805*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/2806*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/4401*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="57c/4601*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="483/4810*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="959/2bd0*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" -SUBSYSTEM=="usb", ENV{PRODUCT}=="9bf/*", RUN+="/lib/udev/isdn.sh", ENV{SYSCONFIG}="no" - -# ISDN PCMCIA -# AVM B1 models -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa95D42008pb845DC335pc*pd*", RUN+="/lib/udev/isdn.sh b1 1", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa95D42008pb81E10430pc*pd*", RUN+="/lib/udev/isdn.sh b1 2", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa95D42008pb18E8558Apc*pd*", RUN+="/lib/udev/isdn.sh b1 3", ENV{SYSCONFIG}="no" -# AVM A1 models (aka Fritz!Card PCMCIA) -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa95D42008pbADC9D4BBpc*pd*", RUN+="/lib/udev/isdn.sh a1 1", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa8D9761C8pb01C5AA7Bpc*pd*", RUN+="/lib/udev/isdn.sh a1 2", ENV{SYSCONFIG}="no" -# teles -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa67B50EAEpbE9E70119pc*pd*", RUN+="/lib/udev/isdn.sh teles 1", ENV{SYSCONFIG}="no" -# sedlbauer -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa81FB79F5pbF3612E1Dpc6B95C78Apd*", RUN+="/lib/udev/isdn.sh sedlbauer 1", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa81FB79F5pbE4E9BC12pc397B7E90pd*", RUN+="/lib/udev/isdn.sh sedlbauer 2", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa81FB79F5pbE4E9BC12pc2E5C7FCEpd*", RUN+="/lib/udev/isdn.sh sedlbauer 3", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa81FB79F5pbE4E9BC12pc8DB143FEpd*", RUN+="/lib/udev/isdn.sh sedlbauer 4", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa81FB79F5pbE4E9BC12pcB391AB4Cpd*", RUN+="/lib/udev/isdn.sh sedlbauer 5", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*paD79E0B84pb21D083AEpc*pd*", RUN+="/lib/udev/isdn.sh sedlbauer 6", ENV{SYSCONFIG}="no" -# elsa -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa983DE2C4pb333BA257pc*pd*", RUN+="/lib/udev/isdn.sh elsa 1", ENV{SYSCONFIG}="no" -SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="pcmcia:m*c*f*fn*pfn*pa639E5718pb333BA257pc*pd*", RUN+="/lib/udev/isdn.sh elsa 2", ENV{SYSCONFIG}="no" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/etc/udev/suse/60-persistent-input.rules new/udev-096/etc/udev/suse/60-persistent-input.rules --- old/udev-094/etc/udev/suse/60-persistent-input.rules 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/etc/udev/suse/60-persistent-input.rules 2006-07-09 21:48:19.000000000 +0200 @@ -3,7 +3,7 @@ KERNEL=="input[0-9]*", GOTO="persistent_input_end" # usb devices -BUS=="usb", IMPORT{program}="/sbin/usb_id -x" +BUS=="usb", IMPORT{program}="usb_id -x" BUS=="usb", SYSFS{bInterfaceClass}=="03", SYSFS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd" BUS=="usb", SYSFS{bInterfaceClass}=="03", SYSFS{bInterfaceProtocol}=="02", ENV{ID_CLASS}="mouse" @@ -12,7 +12,7 @@ KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{ID_CLASS}" # by-path -IMPORT{program}="/sbin/path_id %p" +IMPORT{program}="path_id %p" ENV{ID_PATH}=="?*", KERNEL=="mouse*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}" ENV{ID_PATH}=="?*", KERNEL=="event*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{ID_CLASS}" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/etc/udev/suse/60-persistent-storage.rules new/udev-096/etc/udev/suse/60-persistent-storage.rules --- old/udev-094/etc/udev/suse/60-persistent-storage.rules 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/etc/udev/suse/60-persistent-storage.rules 2006-07-09 21:48:19.000000000 +0200 @@ -5,7 +5,7 @@ SUBSYSTEM!="block", GOTO="persistent_storage_end" # skip rules for inappropriate block devices -KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_storage_end" +KERNEL=="ram*|loop*|fd*|nbd*|dm-*", GOTO="persistent_storage_end" # never access removable ide devices, the drivers are causing event loops on open() KERNEL=="hd*[!0-9]", SYSFS{removable}=="1", DRIVER=="ide-cs|ide-floppy", GOTO="persistent_storage_end" @@ -15,36 +15,34 @@ KERNEL=="*[0-9]", IMPORT{parent}=="ID_*" # by-id (hardware serial number) -KERNEL=="hd*[!0-9]", IMPORT{program}="/sbin/ata_id --export $tempnode" +KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode" KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" KERNEL=="sd*[!0-9]|sr*|st*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394" -KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/usb_id -x" -KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -s %p -d $tempnode" -KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -a -s %p -d $tempnode" -KERNEL=="dasd*[!0-9]", IMPORT{program}="/sbin/dasd_id --export $tempnode" +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x" +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" +KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode" +KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode" KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" # by-path (shortest physical path) -KERNEL=="*[!0-9]|sr*", IMPORT{program}="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" -KERNEL=="st*", IMPORT{program}="/sbin/path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" +KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" +KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" KERNEL=="sr*|st*", GOTO="persistent_storage_end" KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" # by-label/by-uuid (filesystem properties) KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_storage_end" -IMPORT{program}="/sbin/vol_id --export $tempnode" +IMPORT{program}="vol_id --export $tempnode" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" # BIOS Enhanced Disk Device -KERNEL=="*[!0-9]", IMPORT{program}="/sbin/edd_id --export $tempnode" +KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode" KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}" KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" -KERNEL=="dm-[0-9]*", ACTION=="add", PROGRAM="/sbin/dmsetup info -c --noopencount --noheadings -o name -j %M -m %m", SYMLINK+="disk/by-name/%c" - LABEL="persistent_storage_end" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/etc/udev/suse/64-device-mapper.rules new/udev-096/etc/udev/suse/64-device-mapper.rules --- old/udev-094/etc/udev/suse/64-device-mapper.rules 1970-01-01 01:00:00.000000000 +0100 +++ new/udev-096/etc/udev/suse/64-device-mapper.rules 2006-07-09 21:48:19.000000000 +0200 @@ -0,0 +1,15 @@ +# device mapper links hook into "online" event, when the dm table +# is available, while some table types must be ignored + +KERNEL=="dm-*", ACTION=="add|online", GOTO="device_mapper_do" +GOTO="device_mapper_end" + +LABEL="device_mapper_do" +PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end" +RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end" + +IMPORT{program}="/sbin/vol_id --export $tempnode" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" + +LABEL="device_mapper_end" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/ata_id/Makefile new/udev-096/extras/ata_id/Makefile --- old/udev-094/extras/ata_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/ata_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: $(INSTALL_DATA) -D $(PROG).8 $(DESTDIR)$(mandir)/man8/$(PROG).8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/cdrom_id/Makefile new/udev-096/extras/cdrom_id/Makefile --- old/udev-094/extras/cdrom_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/cdrom_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: $(INSTALL_DATA) -D $(PROG).8 $(DESTDIR)$(mandir)/man8/$(PROG).8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/dasd_id/Makefile new/udev-096/extras/dasd_id/Makefile --- old/udev-094/extras/dasd_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/dasd_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: $(INSTALL_DATA) -D $(PROG).8 $(DESTDIR)$(mandir)/man8/$(PROG).8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/edd_id/Makefile new/udev-096/extras/edd_id/Makefile --- old/udev-094/extras/edd_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/edd_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: $(INSTALL_DATA) -D $(PROG).8 $(DESTDIR)$(mandir)/man8/$(PROG).8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/firmware/Makefile new/udev-096/extras/firmware/Makefile --- old/udev-094/extras/firmware/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/firmware/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -46,7 +46,7 @@ install-man: @echo "Please create a man page for this tool." -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: @echo "Please create a man page for this tool." diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/floppy/Makefile new/udev-096/extras/floppy/Makefile --- old/udev-094/extras/floppy/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/floppy/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: @echo "Please create a man page for this tool." -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: @echo "Please create a man page for this tool." diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/path_id/Makefile new/udev-096/extras/path_id/Makefile --- old/udev-094/extras/path_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/path_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -46,7 +46,7 @@ install-man: @echo "Please create a man page for this tool." -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: @echo "Please create a man page for this tool." diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/path_id/path_id new/udev-096/extras/path_id/path_id --- old/udev-094/extras/path_id/path_id 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/path_id/path_id 2006-07-09 21:48:19.000000000 +0200 @@ -407,30 +407,35 @@ handle_device () { full_sysfs_path="$SYSFS$DEVPATH" - if [ -L $full_sysfs_path/subsystem ]; then - # new sysfs block layout - full_sysfs_path="${full_sysfs_path%/*}" - cd "$full_sysfs_path/subsystem"; - subsys="`pwd -P`" - cd "$OPWD" - subsys="${subsys##*/}" - if [ "$subsys" = "block" ]; then - # parent is "block", it's a partition, move one up - full_sysfs_path="${full_sysfs_path%/*}" - fi - cd $full_sysfs_path - else - # old sysfs block layout - if [ ! -L $full_sysfs_path/device ] ; then - if [ -f $full_sysfs_path/range ] ; then return ; fi - full_sysfs_path="${full_sysfs_path%/*}" - : full_sysfs_path "$full_sysfs_path" - if [ ! -L $full_sysfs_path/device -o ! -f $full_sysfs_path/dev ] ; then - return + case "$DEVPATH" in + /devices/*) + # new sysfs layout + if [ -L $full_sysfs_path/subsystem ]; then + full_sysfs_path="${full_sysfs_path%/*}" + cd "$full_sysfs_path/subsystem"; + subsys="`pwd -P`" + cd "$OPWD" + subsys="${subsys##*/}" + if [ "$subsys" = "block" ]; then + # parent is "block", it's a partition, move one up + full_sysfs_path="${full_sysfs_path%/*}" + fi + cd $full_sysfs_path fi - fi - cd $full_sysfs_path/device - fi + ;; + *) + # old sysfs layout + if [ ! -L $full_sysfs_path/device ] ; then + if [ -f $full_sysfs_path/range ] ; then return ; fi + full_sysfs_path="${full_sysfs_path%/*}" + : full_sysfs_path "$full_sysfs_path" + if [ ! -L $full_sysfs_path/device -o ! -f $full_sysfs_path/dev ] ; then + return + fi + fi + cd $full_sysfs_path/device + ;; + esac full_sysfs_device_path="`pwd -P`" cd "$OPWD" D=$full_sysfs_device_path diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/run_directory/Makefile new/udev-096/extras/run_directory/Makefile --- old/udev-094/extras/run_directory/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/run_directory/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -59,7 +59,7 @@ install-man: @echo "Please create a man page for this tool." -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: @echo "Please create a man page for this tool." diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/scsi_id/Makefile new/udev-096/extras/scsi_id/Makefile --- old/udev-094/extras/scsi_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/scsi_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -69,7 +69,7 @@ install-man: $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/scsi_id.8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/usb_id/Makefile new/udev-096/extras/usb_id/Makefile --- old/udev-094/extras/usb_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/usb_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -58,7 +58,7 @@ install-man: @echo "Please create a man page for this tool." -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: @echo "Please create a man page for this tool." diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/volume_id/Makefile new/udev-096/extras/volume_id/Makefile --- old/udev-094/extras/volume_id/Makefile 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/volume_id/Makefile 2006-07-09 21:48:19.000000000 +0200 @@ -66,7 +66,7 @@ install-man: $(INSTALL_DATA) -D $(PROG).8 $(DESTDIR)$(mandir)/man8/$(PROG).8 -.PHONY: uninstall-man +.PHONY: install-man uninstall-man: -rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/extras/volume_id/lib/reiserfs.c new/udev-096/extras/volume_id/lib/reiserfs.c --- old/udev-094/extras/volume_id/lib/reiserfs.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/extras/volume_id/lib/reiserfs.c 2006-07-09 21:48:19.000000000 +0200 @@ -66,7 +66,7 @@ if (buf == NULL) return -1; - rs = (struct reiserfs_super_block *) buf;; + rs = (struct reiserfs_super_block *) buf; if (memcmp(rs->magic, "ReIsErFs", 8) == 0) { strcpy(id->type_version, "3.5"); id->type = "reiserfs"; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/test/udev-test.pl new/udev-096/test/udev-test.pl --- old/udev-094/test/udev-test.pl 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/test/udev-test.pl 2006-07-09 21:48:19.000000000 +0200 @@ -862,6 +862,7 @@ devpath => "/class/tty/tty0", exp_name => "link", exp_target => "link", + exp_add_error => "yes", exp_rem_error => "yes", option => "clean", rules => <<EOF @@ -1010,74 +1011,6 @@ EOF }, { - desc => "enumeration char test (single test)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - rules => <<EOF -KERNEL=="sda", NAME="cdrom%e" -EOF - }, - { - desc => "enumeration char test sequence 1/5 (keep)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - option => "keep", - rules => <<EOF -KERNEL=="sda", NAME="cdrom%e" -EOF - }, - { - desc => "enumeration char test sequence 2/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda1", - exp_name => "enum", - option => "keep", - rules => <<EOF -KERNEL=="sda1", NAME="enum%e" -EOF - }, - { - desc => "enumeration char test sequence 3/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda2", - exp_name => "cdrom1", - option => "keep", - rules => <<EOF -KERNEL=="sda2", NAME="cdrom%e" -EOF - }, - { - desc => "enumeration char test sequence 4/5 (keep)", - subsys => "block", - devpath => "/block/sda/sda3", - exp_name => "enum1", - option => "keep", - rules => <<EOF -KERNEL=="sda3", NAME="enum%e" -EOF - }, - { - desc => "enumeration char test sequence 5/5 (clean)", - subsys => "block", - devpath => "/block/sda/sda4", - exp_name => "cdrom2", - option => "clean", - rules => <<EOF -KERNEL=="sda4", NAME="cdrom%e" -EOF - }, - { - desc => "enumeration char test after cleanup (single test)", - subsys => "block", - devpath => "/block/sda", - exp_name => "cdrom", - rules => <<EOF -KERNEL=="sda", NAME="cdrom%e" -EOF - }, - { desc => "ignore rule test", subsys => "block", devpath => "/block/sda", diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udev.h new/udev-096/udev.h --- old/udev-094/udev.h 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udev.h 2006-07-09 21:48:19.000000000 +0200 @@ -33,10 +33,8 @@ #define COMMENT_CHARACTER '#' #define PATH_TO_NAME_CHAR '@' #define LINE_SIZE 512 +#define PATH_SIZE 512 #define NAME_SIZE 128 -#define PATH_SIZE 256 -#define USER_SIZE 32 -#define SEQNUM_SIZE 32 #define VALUE_SIZE 128 #define DEFAULT_PARTITIONS_COUNT 15 @@ -73,9 +71,9 @@ char name[PATH_SIZE]; struct list_head symlink_list; int symlink_final; - char owner[USER_SIZE]; + char owner[NAME_SIZE]; int owner_final; - char group[USER_SIZE]; + char group[NAME_SIZE]; int group_final; mode_t mode; int mode_final; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udev_device.c new/udev-096/udev_device.c --- old/udev-094/udev_device.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udev_device.c 2006-07-09 21:48:19.000000000 +0200 @@ -81,7 +81,7 @@ return makedev(0, 0); } -static int rename_net_if(struct udevice *udev) +static int rename_netif(struct udevice *udev) { int sk; struct ifreq ifr; @@ -100,12 +100,44 @@ memset(&ifr, 0x00, sizeof(struct ifreq)); strlcpy(ifr.ifr_name, udev->dev->kernel_name, IFNAMSIZ); strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ); - retval = ioctl(sk, SIOCSIFNAME, &ifr); - if (retval != 0) - err("error changing net interface name: %s", strerror(errno)); - close(sk); + if (retval != 0) { + int loop; + + /* see if the destination interface name already exists */ + if (errno != EEXIST) { + err("error changing netif name: %s", strerror(errno)); + goto exit; + } + + /* free our own name, another process may wait for us */ + strlcpy(ifr.ifr_newname, udev->dev->kernel_name, IFNAMSIZ); + strlcat(ifr.ifr_newname, "_rename", IFNAMSIZ); + retval = ioctl(sk, SIOCSIFNAME, &ifr); + if (retval != 0) { + err("error changing netif name: %s", strerror(errno)); + goto exit; + } + + /* wait 30 seconds for our target to become available */ + strlcpy(ifr.ifr_name, ifr.ifr_newname, IFNAMSIZ); + strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ); + loop = 30 * 20; + while (loop--) { + retval = ioctl(sk, SIOCSIFNAME, &ifr); + if (retval != 0) { + if (errno != EEXIST) { + err("error changing net interface name: %s", strerror(errno)); + break; + } + dbg("wait for netif '%s' to become free, loop=%i", udev->name, (30 * 20) - loop); + usleep(1000 * 1000 / 20); + } + } + } +exit: + close(sk); return retval; } @@ -114,7 +146,8 @@ int retval = 0; /* add device node */ - if (major(udev->devt) != 0 && strcmp(udev->action, "add") == 0) { + if (major(udev->devt) != 0 && + (strcmp(udev->action, "add") == 0 || strcmp(udev->action, "online") == 0)) { struct udevice *udev_old; dbg("device node add '%s'", udev->dev->devpath); @@ -132,17 +165,38 @@ /* read current database entry, we may want to cleanup symlinks */ udev_old = udev_device_init(); if (udev_old != NULL) { - if (udev_db_get_device(udev_old, udev->dev->devpath) == 0) { - info("device '%s' already known, remove possible symlinks", udev->dev->devpath); - udev_node_remove_symlinks(udev_old); - } - udev_device_cleanup(udev_old); + if (udev_db_get_device(udev_old, udev->dev->devpath) != 0) { + udev_device_cleanup(udev_old); + udev_old = NULL; + } else + info("device '%s' already in database, validate currently present symlinks", + udev->dev->devpath); } - /* create node and symlinks, store record in database */ + /* create node and symlinks */ retval = udev_node_add(udev, udev_old); - if (retval == 0) + if (retval == 0) { + /* store record in database */ udev_db_add_device(udev); + + /* remove possibly left-over symlinks */ + if (udev_old != NULL) { + struct name_entry *link_loop; + struct name_entry *link_old_loop; + struct name_entry *link_old_tmp_loop; + + /* remove still valid symlinks from old list */ + list_for_each_entry_safe(link_old_loop, link_old_tmp_loop, &udev_old->symlink_list, node) + list_for_each_entry(link_loop, &udev->symlink_list, node) + if (strcmp(link_old_loop->name, link_loop->name) == 0) { + dbg("symlink '%s' still valid, keep it", link_old_loop->name); + list_del(&link_old_loop->node); + free(link_old_loop); + } + udev_node_remove_symlinks(udev_old); + udev_device_cleanup(udev_old); + } + } goto exit; } @@ -159,7 +213,7 @@ if (strcmp(udev->name, udev->dev->kernel_name) != 0) { char *pos; - retval = rename_net_if(udev); + retval = rename_netif(udev); if (retval != 0) goto exit; info("renamed netif to '%s'", udev->name); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udev_node.c new/udev-096/udev_node.c --- old/udev-094/udev_node.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udev_node.c 2006-07-09 21:48:19.000000000 +0200 @@ -90,6 +90,36 @@ return retval; } +static int udev_node_symlink(struct udevice *udev, const char *linktarget, const char *filename) +{ + char target[PATH_SIZE]; + int len; + + /* look if symlink already exists */ + len = readlink(filename, target, sizeof(target)); + if (len > 0) { + target[len] = '\0'; + if (strcmp(linktarget, target) == 0) { + info("preserving symlink '%s' to '%s'", filename, linktarget); + selinux_setfilecon(filename, NULL, S_IFLNK); + goto exit; + } else { + info("link '%s' points to different target '%s', delete it", filename, target); + unlink(filename); + } + } + + /* create link */ + info("creating symlink '%s' to '%s'", filename, linktarget); + selinux_setfscreatecon(filename, NULL, S_IFLNK); + if (symlink(linktarget, filename) != 0) + err("symlink(%s, %s) failed: %s", linktarget, filename, strerror(errno)); + selinux_resetfscreatecon(); + +exit: + return 0; +} + int udev_node_add(struct udevice *udev, struct udevice *udev_old) { char filename[PATH_SIZE]; @@ -205,13 +235,8 @@ strlcat(linktarget, &udev->name[tail], sizeof(linktarget)); info("creating symlink '%s' to '%s'", filename, linktarget); - if (!udev->test_run) { - unlink(filename); - selinux_setfscreatecon(filename, NULL, S_IFLNK); - if (symlink(linktarget, filename) != 0) - err("symlink(%s, %s) failed: %s", linktarget, filename, strerror(errno)); - selinux_resetfscreatecon(); - } + if (!udev->test_run) + udev_node_symlink(udev, linktarget, filename); strlcat(symlinks, filename, sizeof(symlinks)); strlcat(symlinks, " ", sizeof(symlinks)); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udev_rules.c new/udev-096/udev_rules.c --- old/udev-094/udev_rules.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udev_rules.c 2006-07-09 21:48:19.000000000 +0200 @@ -263,88 +263,6 @@ return rc; } -static int match_name_and_get_number(const char *base, const char *devname) -{ - size_t baselen; - char *endptr; - int num; - - baselen = strlen(base); - if (strncmp(base, devname, baselen) != 0) - return -1; - if (devname[baselen] == '\0') - return 0; - if (!isdigit(devname[baselen])) - return -1; - num = strtoul(&devname[baselen], &endptr, 10); - if (endptr[0] != '\0') - return -1; - return num; -} - -/* finds the lowest positive device number such that <name>N isn't present in the udevdb - * if <name> doesn't exist, 0 is returned, N otherwise */ -static int find_free_number(const char *base, const char *devpath) -{ - char db_devpath[PATH_SIZE]; - char filename[PATH_SIZE]; - struct udevice *udev_db; - int num = 0; - static int warn = 1; - - if (warn) { - err("%%e is deprecated, will be removed and is unlikely to work correctly. Don't use it."); - warn = 0; - } - - /* check if the device already owns a matching name */ - udev_db = udev_device_init(); - if (udev_db == NULL) - return -1; - if (udev_db_get_device(udev_db, devpath) == 0) { - struct name_entry *name_loop; - int devnum; - - devnum = match_name_and_get_number(base, udev_db->name); - if (devnum >= 0) { - num = devnum; - dbg("device '%s', already has the node '%s' with num %u, use it", devpath, base, num); - goto out; - } - list_for_each_entry(name_loop, &udev_db->symlink_list, node) { - devnum = match_name_and_get_number(base, name_loop->name); - if (devnum >= 0) { - num = devnum; - dbg("device '%s', already has a symlink '%s' with num %u, use it", devpath, base, num); - goto out; - } - } - } - - /* just search the database again and again until a free name is found */ - strlcpy(filename, base, sizeof(filename)); - while (1) { - dbg("look for existing node '%s'", filename); - if (udev_db_lookup_name(filename, db_devpath, sizeof(db_devpath)) != 0) { - dbg("free num=%d", num); - break; - } - - num++; - if (num > 100000) { - err("find_free_number aborted at num=%d", num); - num = -1; - break; - } - snprintf(filename, sizeof(filename), "%s%d", base, num); - filename[sizeof(filename)-1] = '\0'; - } - -out: - udev_device_cleanup(udev_db); - return num; -} - #define WAIT_LOOP_PER_SECOND 50 static int wait_for_sysfs(struct udevice *udev, const char *file, int timeout) { @@ -386,7 +304,6 @@ int len; int i; int count; - unsigned int next_free_number; enum subst_type { SUBST_UNKNOWN, SUBST_DEVPATH, @@ -397,7 +314,6 @@ SUBST_MINOR, SUBST_RESULT, SUBST_SYSFS, - SUBST_ENUM, SUBST_PARENT, SUBST_TEMP_NODE, SUBST_ROOT, @@ -416,7 +332,6 @@ { .name = "minor", .fmt = 'm', .type = SUBST_MINOR }, { .name = "result", .fmt = 'c', .type = SUBST_RESULT }, { .name = "sysfs", .fmt = 's', .type = SUBST_SYSFS }, - { .name = "enum", .fmt = 'e', .type = SUBST_ENUM }, { .name = "parent", .fmt = 'P', .type = SUBST_PARENT }, { .name = "tempnode", .fmt = 'N', .type = SUBST_TEMP_NODE }, { .name = "root", .fmt = 'r', .type = SUBST_ROOT }, @@ -572,13 +487,6 @@ dbg("substitute sysfs value '%s'", temp2); } break; - case SUBST_ENUM: - next_free_number = find_free_number(string, udev->dev->devpath); - if (next_free_number > 0) { - sprintf(temp2, "%d", next_free_number); - strlcat(string, temp2, maxsize); - } - break; case SUBST_PARENT: { struct sysfs_device *dev_parent; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udevcontrol.c new/udev-096/udevcontrol.c --- old/udev-094/udevcontrol.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udevcontrol.c 2006-07-09 21:48:19.000000000 +0200 @@ -33,7 +33,6 @@ #include "udev.h" #include "udevd.h" -/* global variables */ static int sock = -1; static int udev_log = 0; @@ -51,6 +50,16 @@ } #endif +static void usage(void) +{ + printf("Usage: udevcontrol COMMAND\n" + " log_priority=<level> set the udev log level for the daemon\n" + " stop_exec_queue keep udevd from executing events, queue only\n" + " start_exec_queue execute events, flush queue\n" + " reload_rules reloads the rules files\n" + " max_childs=<N> maximum number of childs running at the same time\n" + " --help print this help text\n\n"); +} int main(int argc, char *argv[], char *envp[]) { @@ -72,6 +81,7 @@ if (argc < 2) { fprintf(stderr, "missing command\n\n"); + usage(); goto exit; } @@ -100,23 +110,18 @@ *intval = atoi(val); info("send max_childs=%i", *intval); } else if (strcmp(arg, "help") == 0 || strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) { - printf("Usage: udevcontrol COMMAND\n" - " log_priority=<level> set the udev log level for the daemon\n" - " stop_exec_queue keep udevd from executing events, queue only\n" - " start_exec_queue execute events, flush queue\n" - " reload_rules reloads the rules files\n" - " max_childs=<N> maximum number of childs running at the same time\n" - " --help print this help text\n\n"); - exit(0); + usage(); + goto exit; } else { fprintf(stderr, "unknown option\n\n"); - exit(1); + usage(); + goto exit; } } if (getuid() != 0) { fprintf(stderr, "need to be root, exit\n\n"); - exit(1); + goto exit; } sock = socket(AF_LOCAL, SOCK_DGRAM, 0); @@ -131,7 +136,6 @@ strcpy(&saddr.sun_path[1], UDEVD_SOCK_PATH); addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1; - retval = sendto(sock, &usend_msg, sizeof(usend_msg), 0, (struct sockaddr *)&saddr, addrlen); if (retval == -1) { err("error sending message: %s", strerror(errno)); @@ -142,9 +146,7 @@ } close(sock); - exit: logging_close(); - return retval; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udevd.h new/udev-096/udevd.h --- old/udev-094/udevd.h 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udevd.h 2006-07-09 21:48:19.000000000 +0200 @@ -32,7 +32,7 @@ #define EVENT_SEQNUM ".udev/uevent_seqnum" /* maximum limit of forked childs */ -#define UDEVD_MAX_CHILDS 64 +#define UDEVD_MAX_CHILDS 256 /* start to throttle forking if maximum number of running childs in our session is reached */ #define UDEVD_MAX_CHILDS_RUNNING 16 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/udev-094/udevinfo.c new/udev-096/udevinfo.c --- old/udev-094/udevinfo.c 2006-06-12 10:27:03.000000000 +0200 +++ new/udev-096/udevinfo.c 2006-07-09 21:48:19.000000000 +0200 @@ -91,11 +91,11 @@ struct sysfs_device *dev; printf("\n" - "udevinfo starts with the device the node belongs to and then walks up the\n" - "device chain, to print for every device found, all possibly useful attributes\n" - "in the udev key format.\n" - "Only attributes within one device section may be used together in one rule,\n" - "to match the device for which the node will be created.\n" + "Udevinfo starts with the device specified by the devpath and then\n" + "walks up the chain of parent devices. It prints for every device\n" + "found, all possible attributes in the udev rules key format.\n" + "A rule to match, can be composed by the attributes of the device\n" + "and the attributes from one single parent device.\n" "\n"); dev = sysfs_device_get(devpath); @@ -112,7 +112,7 @@ dev = sysfs_device_get_parent(dev); if (dev == NULL) break; - printf(" looking at device '%s':\n", dev->devpath); + printf(" looking at parent device '%s':\n", dev->devpath); printf(" ID=="%s"\n", dev->kernel_name); printf(" BUS=="%s"\n", dev->subsystem); printf(" DRIVER=="%s"\n", dev->driver); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org