qubes_block.rules 677 B

12345678910111213141516171819202122
  1. # Expose all (except xen-frontend) block devices via xenstore
  2. # Only block devices are interesting
  3. SUBSYSTEM!="block", GOTO="qubes_block_end"
  4. # Skip xen-blkfront devices
  5. ENV{MAJOR}=="202", GOTO="qubes_block_end"
  6. # Skip loop devices
  7. ENV{MAJOR}=="7", GOTO="qubes_block_end"
  8. # Skip device-mapper devices
  9. ENV{MAJOR}=="253", GOTO="qubes_block_end"
  10. ACTION=="add", RUN+="/usr/lib/qubes/block_add_change"
  11. ACTION=="change", RUN+="/usr/lib/qubes/block_add_change"
  12. ACTION=="remove", RUN+="/usr/lib/qubes/block_remove"
  13. LABEL="qubes_block_end"
  14. # Cleanup disconnected frontend from xenstore
  15. ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/block_cleanup"