From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Tue, 09 Aug 2005 10:50:28 +0000 Subject: Re: persistent.rules Message-Id: <20050809105028.GA11712@vrfy.org> List-Id: References: <20050805185503.GA17751@wonderland.linux.it> In-Reply-To: <20050805185503.GA17751@wonderland.linux.it> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Aug 05, 2005 at 08:55:04PM +0200, Marco d'Itri wrote: > For the debian directory. I cleaned up the gentoo rules, it's not widely > tested but looks like it's working fine. Nice, I like the skip on ACTION!="add". :) You may want to add: SUBSYSTEM="block", BUS="ide", SYSFS{removable}="1", GOTO="no_volume_id" cause removable IDE devices causes hotplug events on open()/close(), which gives a nice infinite loop. Kay > # This file contains the rules needed to create persistent device names. > > # we are only interested in add actions for block devices > ACTION!="add", GOTO="no_volume_id" > SUBSYSTEM!="block", GOTO="no_volume_id" > > # and we can safely ignore these kinds of devices > KERNEL="ram*|loop*|fd*|sr*", GOTO="no_volume_id" > > # skip removable ide devices, because the IDE drivers are horrible broken > BUS="ide", SYSFS{removable}="1", GOTO="no_volume_id" > > # disk id > KERNEL="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode" > KERNEL="hd*[!0-9]", ENV{ID_SERIAL}="?*", \ > SYMLINK+="$env{ID_TYPE}/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" > > KERNEL="hd*[0-9]", IMPORT{parent}="ID_*" > KERNEL="hd*[0-9]", ENV{ID_SERIAL}="?*", \ > SYMLINK+="$env{ID_TYPE}/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" > > KERNEL="sd*[!0-9]", SYSFS{ieee1394_id}="*", \ > IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394\nID_TYPE=disk'" > KERNEL="sd*[!0-9]", ENV{ID_SERIAL}="", IMPORT="/sbin/usb_id -x" > KERNEL="sd*[!0-9]", ENV{ID_SERIAL}="", \ > IMPORT="/sbin/scsi_id -g -x -a -s %p" > KERNEL="sd*[!0-9]", ENV{ID_SERIAL}="?*", \ > SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}" > > KERNEL="sd*[0-9]", IMPORT{parent}="ID_*" > KERNEL="sd*[0-9]", ENV{ID_SERIAL}="?*", \ > SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" > > # path > KERNEL="*[!0-9]", ENV{ID_TYPE}="?*", IMPORT="/sbin/path_id %p", \ > SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}" > > KERNEL="*[0-9]", IMPORT{parent}="ID_*" > KERNEL="*[0-9]", ENV{ID_PATH}="?*", \ > SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}-part%n" > > # volume label and uuid > KERNEL="*[!0-9]", SYSFS{removable}="1", GOTO="no_volume_id" > KERNEL="*[0-9]", IMPORT="/sbin/vol_id --export $tempnode" > KERNEL="*[0-9]", ENV{ID_FS_UUID}="?*", \ > SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" > KERNEL="*[0-9]", ENV{ID_FS_LABEL_SAFE}="?*", \ > SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" > > # end of processing > SUBSYSTEM="block", LABEL="no_volume_id" ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel