qubes-linux-utils/udev/udev-qubes-block.rules
Marek Marczykowski-Górecki 7148f8d135
Move udev scripts to /usr/lib/qubes, move rules to /lib/udev/
Resolve udev-rule-in-etc, non-standard-dir-in-usr, file-in-unusual-dir
lintian warnings.

QubesOS/qubes-issues#1416
2015-11-26 22:18:03 +01:00

27 lines
1005 B
Plaintext

# Expose all (except xen-frontend) block devices via Qubes DB
# Only block devices are interesting
SUBSYSTEM!="block", GOTO="qubes_block_end"
# Hide qubes-internal drives from udisks, so file selection dialogs
ENV{MAJOR}=="7", ENV{UDISKS_IGNORE}="1"
KERNEL=="xvda|xvdb|xvdc*|xvdd", ENV{UDISKS_IGNORE}="1"
# Skip xen-blkfront devices
ENV{MAJOR}=="202", GOTO="qubes_block_end"
# Skip device-mapper devices
ENV{MAJOR}=="253", ENV{DM_NAME}=="snapshot-*", GOTO="qubes_block_end"
ENV{MAJOR}=="253", ENV{DM_NAME}=="origin-*", GOTO="qubes_block_end"
ENV{MAJOR}=="253", ENV{DM_NAME}=="", GOTO="qubes_block_end"
IMPORT{db}="QUBES_EXPOSED"
ACTION=="add", IMPORT{program}="/usr/lib/qubes/udev-block-add-change"
ACTION=="change", IMPORT{program}="/usr/lib/qubes/udev-block-add-change"
ACTION=="remove", RUN+="/usr/lib/qubes/udev-block-remove"
LABEL="qubes_block_end"
# Cleanup disconnected frontend from xenstore
ACTION=="remove", SUBSYSTEM=="block", ENV{MAJOR}=="202", RUN+="/usr/lib/qubes/udev-block-cleanup"