File: kpartx.rules

package info (click to toggle)
multipath-tools 0.7.9-3%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,976 kB
  • sloc: ansic: 45,939; perl: 1,622; sh: 861; makefile: 610; pascal: 122
file content (41 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# persistent links for device-mapper devices
# only hardware-backed device-mapper devices (ie multipath, dmraid,
# and kpartx) have meaningful persistent device names
#

KERNEL!="dm-*", GOTO="kpartx_end"
ACTION!="add|change", GOTO="kpartx_end"
ENV{DM_UUID}!="?*", GOTO="kpartx_end"

# This is a temporary hack until Debian's dmsetup properly supports "dmsetup
# export". For more information see: #434241, #487881, #493078
IMPORT{program}="dmsetup_env %M %m"

# Create dm tables for partitions on multipath devices.
ENV{DM_UUID}!="mpath-?*", GOTO="mpath_kpartx_end"

# DM_SUBSYSTEM_UDEV_FLAG1 is the "skip_kpartx" flag.
# For events not generated by libdevmapper, we need to fetch it from db.
ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG1"
ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="mpath_kpartx_end"

# 11-dm-mpath.rules sets MPATH_UNCHANGED for events that can be ignored.
ENV{MPATH_UNCHANGED}=="1", GOTO="mpath_kpartx_end"

# Don't run kpartx now if we know it will fail or hang.
ENV{DM_SUSPENDED}=="1", GOTO="mpath_kpartx_end"
ENV{DM_NOSCAN}=="1", GOTO="mpath_kpartx_end"

# Run kpartx
GOTO="run_kpartx"
LABEL="mpath_kpartx_end"

## Code for other subsystems (non-multipath) could be placed here ##

GOTO="kpartx_end"

LABEL="run_kpartx"
RUN+="/sbin/kpartx -un -p -part /dev/$name"

LABEL="kpartx_end"