Debian Codegraph @

mkosi-initrd/mkosi.profiles/raid/mkosi.extra/usr/lib/udev/rules.d/70-mkosi-initrd-md.rules

raw
1 # SPDX-License-Identifier: GPL-2.0-only
2 # Copied from https://github.com/dracutdevs/dracut/blob/059/modules.d/90mdraid/59-persistent-storage-md.rules
3
4 SUBSYSTEM!="block", GOTO="md_end"
5 ACTION!="add|change", GOTO="md_end"
6 # Also don't process disks that are slated to be a multipath device
7 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="md_end"
8
9 KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end"
10
11 # partitions have no md/{array_state,metadata_version}
12 ENV{DEVTYPE}=="partition", GOTO="md_ignore_state"
13
14 # container devices have a metadata version of e.g. 'external:ddf' and
15 # never leave state 'inactive'
16 ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
17 TEST!="md/array_state", GOTO="md_end"
18 ATTR{md/array_state}=="|clear|inactive", GOTO="md_end"
19
20 LABEL="md_ignore_state"
21
22 IMPORT{program}="/sbin/mdadm --detail --export $devnode"
23 IMPORT{builtin}="blkid"
24 OPTIONS+="link_priority=100"
25 OPTIONS+="watch"
26 OPTIONS+="db_persist"
27 LABEL="md_end"