--- trunk/udev/udev-persistent-storage.rules.magellan 2010/04/06 23:44:17 1015 +++ trunk/udev/udev-persistent-storage.rules.magellan 2010/04/06 23:46:22 1016 @@ -1,5 +1,5 @@ # /etc/udev/rules/65-persistent-storage.rules: device naming rules for udev -# $Header: /root/magellan-cvs/src/udev/udev-persistent-storage.rules.magellan,v 1.8 2009-10-13 10:46:20 niro Exp $ +# $Header: /root/magellan-cvs/src/udev/udev-persistent-storage.rules.magellan,v 1.9 2010-04-06 23:46:22 niro Exp $ # # There are a number of modifiers that are allowed to be used in some # of the different fields. They provide the following subsitutions: @@ -30,21 +30,12 @@ # skip rules for inappropriate block devices KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end" -# never access non-cdrom removable ide devices, the drivers are causing event loops on open() -KERNEL=="hd*[!0-9]", ATTR{removable}=="1", SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", GOTO="persistent_storage_end" -KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end" - # ignore partitions that span the entire disk TEST=="whole_disk", GOTO="persistent_storage_end" # for partitions import parent information ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" -# by-id (hardware serial number) -KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode" -KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}" -KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n" - # USB devices use their own serial number KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" # ATA devices with their own "ata" kernel subsystem @@ -79,7 +70,9 @@ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" # probe filesystem metadata of optical drives which have a media inserted -KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" +KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" +# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" # probe filesystem metadata of disks KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" @@ -91,4 +84,8 @@ ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" +# by-id (World Wide Name) +ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}" +ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n" + LABEL="persistent_storage_end"