ait/poc/scanner/99-qubes_block.rule
author mb
Sat, 04 May 2013 12:17:31 -0400
changeset 1 446a7ba98309
permissions -rw-r--r--
added scanner scripts
mb@1
     1
# Expose all (except xen-frontend) block devices via xenstore
mb@1
     2
mb@1
     3
# Only block devices are interesting
mb@1
     4
SUBSYSTEM!="block", GOTO="qubes_block_end"
mb@1
     5
mb@1
     6
# Skip xen-blkfront devices
mb@1
     7
ENV{MAJOR}=="202", GOTO="qubes_block_end"
mb@1
     8
mb@1
     9
# Skip device-mapper devices
mb@1
    10
ENV{MAJOR}=="253", GOTO="qubes_block_end"
mb@1
    11
mb@1
    12
IMPORT{db}="QUBES_EXPOSED"
mb@1
    13
ACTION=="add", IMPORT{program}="/usr/lib/qubes/block_add_change"
mb@1
    14
ACTION=="change", IMPORT{program}="/usr/lib/qubes/block_add_change"
mb@1
    15
ACTION=="remove", RUN+="/usr/lib/qubes/block_remove"
mb@1
    16
mb@1
    17
LABEL="qubes_block_end"
mb@1
    18
mb@1
    19
# Cleanup disconnected frontend from xenstore
mb@1
    20
ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/block_cleanup"