69-bcache.rules 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # register bcache devices as they come up
  2. # man 7 udev for syntax
  3. SUBSYSTEM!="block", GOTO="bcache_end"
  4. ACTION=="remove", GOTO="bcache_end"
  5. ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="bcache_end"
  6. KERNEL=="fd*|sr*", GOTO="bcache_end"
  7. # blkid was run by the standard udev rules
  8. # It recognised bcache (util-linux 2.24+)
  9. ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found"
  10. # It recognised something else; bail
  11. ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end"
  12. # Backing devices: scan, symlink, register
  13. IMPORT{program}="probe-bcache -o udev $tempnode"
  14. ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end"
  15. ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
  16. LABEL="bcache_backing_found"
  17. RUN{builtin}+="kmod load bcache"
  18. RUN+="bcache-register $tempnode"
  19. LABEL="bcache_backing_end"
  20. # Cached devices: symlink
  21. DRIVER=="bcache", ENV{CACHED_UUID}=="?*", \
  22. SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}"
  23. DRIVER=="bcache", ENV{CACHED_LABEL}=="?*", \
  24. SYMLINK+="bcache/by-label/$env{CACHED_LABEL}"
  25. LABEL="bcache_end"