]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
chore: remove support for old mdadm versions
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 17 Jul 2024 07:45:04 +0000 (09:45 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sat, 20 Jul 2024 20:21:27 +0000 (16:21 -0400)
modules.d/90mdraid/module-setup.sh

index 6179a989b93642ee47ca77726fb078803c9cbe8e..8ce5f2eec1f3e33a8ca8a79d8226b1eebc540200 100755 (executable)
@@ -65,7 +65,6 @@ cmdline() {
 
 # called by dracut
 install() {
-    local rule rule_path
     inst_multiple cat expr
     inst_multiple -o mdmon
     inst "$(command -v partx)" /sbin/partx
@@ -77,21 +76,16 @@ install() {
         [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf"
     fi
 
-    # <mdadm-3.3 udev rule
-    inst_rules 64-md-raid.rules
-    # >=mdadm-3.3 udev rules
     inst_rules 63-md-raid-arrays.rules 64-md-raid-assembly.rules
     # remove incremental assembly from stock rules, so they don't shadow
     # 65-md-inc*.rules and its fine-grained controls, or cause other problems
     # when we explicitly don't want certain components to be incrementally
     # assembled
-    for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do
-        rule_path="${initdir}${udevdir}/rules.d/${rule}"
-        # shellcheck disable=SC2016
-        [ -f "${rule_path}" ] && sed -i -r \
-            -e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
-            "${rule_path}"
-    done
+    # shellcheck disable=SC2016
+    if [ -f "${initdir}${udevdir}/rules.d/64-md-raid-assembly.rules" ]; then
+        sed -i -r -e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$devnode)/d' \
+            "${initdir}${udevdir}/rules.d/64-md-raid-assembly.rules"
+    fi
 
     inst_rules "$moddir/65-md-incremental-imsm.rules"