1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/ait/poc/scanner/99-qubes_block.rule Sat May 04 12:17:31 2013 -0400
1.3 @@ -0,0 +1,20 @@
1.4 +# Expose all (except xen-frontend) block devices via xenstore
1.5 +
1.6 +# Only block devices are interesting
1.7 +SUBSYSTEM!="block", GOTO="qubes_block_end"
1.8 +
1.9 +# Skip xen-blkfront devices
1.10 +ENV{MAJOR}=="202", GOTO="qubes_block_end"
1.11 +
1.12 +# Skip device-mapper devices
1.13 +ENV{MAJOR}=="253", GOTO="qubes_block_end"
1.14 +
1.15 +IMPORT{db}="QUBES_EXPOSED"
1.16 +ACTION=="add", IMPORT{program}="/usr/lib/qubes/block_add_change"
1.17 +ACTION=="change", IMPORT{program}="/usr/lib/qubes/block_add_change"
1.18 +ACTION=="remove", RUN+="/usr/lib/qubes/block_remove"
1.19 +
1.20 +LABEL="qubes_block_end"
1.21 +
1.22 +# Cleanup disconnected frontend from xenstore
1.23 +ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/block_cleanup"