OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
3.2 KiB

  1. ########################################################################
  2. #
  3. # Description : 60-persistent-disk.rules
  4. #
  5. # Authors : Based on Open Suse Udev Rules
  6. # kay.sievers@suse.de and hare@suse.de
  7. #
  8. # Adapted to : Jim Gifford
  9. # LFS
  10. #
  11. # Version : 00.01
  12. #
  13. # Notes :
  14. #
  15. ########################################################################
  16. # persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
  17. # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
  18. ACTION!="add", GOTO="persistent_storage_end"
  19. SUBSYSTEM!="block", GOTO="persistent_storage_end"
  20. # skip rules for inappropriate block devices
  21. KERNEL=="ram*|loop*|fd*|nbd*|dm-*", GOTO="persistent_storage_end"
  22. # Set Permissions on CDOM
  23. BUS=="ide", DRIVERS=="ide-cdrom", ATTRS{removable}=="1", GROUP="cdrom", MODE="660"
  24. # never access removable ide devices, the drivers are causing event loops on open()
  25. KERNEL=="hd*[!0-9]", ATTRS{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
  26. KERNEL=="hd*[0-9]", ATTRS{../removable}=="1", GOTO="persistent_storage_end"
  27. # for partitions import parent information
  28. KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
  29. # by-id (hardware serial number)
  30. KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
  31. KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
  32. KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
  33. KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
  34. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
  35. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
  36. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
  37. KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
  38. KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  39. KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
  40. KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  41. # by-path (shortest physical path)
  42. KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
  43. KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
  44. KERNEL=="sr*|st*", GOTO="persistent_storage_end"
  45. KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
  46. # by-label/by-uuid (filesystem properties)
  47. KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
  48. IMPORT{program}="vol_id --export $tempnode"
  49. ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
  50. ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
  51. # BIOS Enhanced Disk Device
  52. KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
  53. KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
  54. KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
  55. LABEL="persistent_storage_end"