]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(mdraid): remove offroot
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Thu, 26 Nov 2020 12:04:44 +0000 (13:04 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 5 Feb 2021 09:59:50 +0000 (10:59 +0100)
offroot is deprecated and can be safety removed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
modules.d/90mdraid/65-md-incremental-imsm.rules
modules.d/90mdraid/md-shutdown.sh
modules.d/90mdraid/mdraid-cleanup.sh
modules.d/90mdraid/mdraid-waitclean.sh
modules.d/90mdraid/mdraid_start.sh
modules.d/90mdraid/parse-md.sh

index 52f5b1956a8384939131e5b0c97a91740c958b3f..6697f159f40e6de15bcfb7bbe8225a22d12c7594 100644 (file)
@@ -39,6 +39,6 @@ RUN+="/sbin/initqueue --timeout --name 50-mdraid_start --onetime --unique /sbin/
 #
 LABEL="md_incremental"
 
-RUN+="/sbin/mdadm $env{rd_MD_OFFROOT} -I $env{DEVNAME}"
+RUN+="/sbin/mdadm -I $env{DEVNAME}"
 
 LABEL="md_end"
index 400bb003efd94d1aa066fc5b525eb20c72574c60..40c82570a852ae688455b971244fae078d63d83c 100755 (executable)
@@ -3,12 +3,11 @@
 _do_md_shutdown() {
     local ret
     local final=$1
-    local _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
     info "Waiting for mdraid devices to be clean."
-    mdadm $_offroot -vv --wait-clean --scan| vinfo
+    mdadm -vv --wait-clean --scan| vinfo
     ret=$?
     info "Disassembling mdraid devices."
-    mdadm $_offroot -vv --stop --scan | vinfo
+    mdadm -vv --stop --scan | vinfo
     ret=$(($ret+$?))
     if [ "x$final" != "x" ]; then
         info "/proc/mdstat:"
index 565449a5118125ac4ebbd118ff5637c9c354ee10..007e581bd6d9e3ba93ea84fcbe446d0f60f978ab 100755 (executable)
@@ -2,7 +2,6 @@
 
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
 
-_offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
 containers=""
 for md in /dev/md[0-9_]*; do
     [ -b "$md" ] || continue
@@ -12,11 +11,11 @@ for md in /dev/md[0-9_]*; do
         containers="$containers $md"
         continue
     fi
-    mdadm $_offroot -S "$md" >/dev/null 2>&1
+    mdadm -S "$md" >/dev/null 2>&1
 done
 
 for md in $containers; do
-    mdadm $_offroot -S "$md" >/dev/null 2>&1
+    mdadm -S "$md" >/dev/null 2>&1
 done
 
-unset containers udevinfo _offroot
+unset containers udevinfo
index 5c901982d8364640e301f9f7041c54624ac72b3a..0a7480f79ed94c9eb29af92c26314b20486aaad4 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 if getargbool 0 rd.md.waitclean; then
-    _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
     type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
     containers=""
     for md in /dev/md[0-9_]*; do
@@ -13,13 +12,13 @@ if getargbool 0 rd.md.waitclean; then
             continue
         fi
         info "Waiting for $md to become clean"
-        mdadm $_offroot -W "$md" >/dev/null 2>&1
+        mdadm -W "$md" >/dev/null 2>&1
     done
 
     for md in $containers; do
         info "Waiting for $md to become clean"
-        mdadm $_offroot -W "$md" >/dev/null 2>&1
+        mdadm -W "$md" >/dev/null 2>&1
     done
 
-    unset containers udevinfo _offroot
+    unset containers udevinfo
 fi
index 77e843d73b499d4b4cadc4fad67918cf3a50e68c..ed8d8dfe5773abe7ebb985b6715d564c09401078 100755 (executable)
@@ -7,7 +7,6 @@ _md_start() {
     local _path_s
     local _path_d
     local _md="$1"
-    local _offroot="$2"
 
     _udevinfo="$(udevadm info --query=env --name="${_md}")"
     strstr "$_udevinfo" "MD_LEVEL=container" && continue
@@ -19,7 +18,7 @@ _md_start() {
     # inactive ?
     [ "$(cat "$_path_s")" != "inactive" ] && continue
 
-    mdadm $_offroot -R "${_md}" 2>&1 | vinfo
+    mdadm -R "${_md}" 2>&1 | vinfo
 
     # still inactive ?
     [ "$(cat "$_path_s")" = "inactive" ] && continue
@@ -30,14 +29,11 @@ _md_start() {
 }
 
 _md_force_run() {
-    local _offroot
     local _md
     local _UUID
     local _MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
     [ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return
 
-    _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
-
     if [ -n "$_MD_UUID" ]; then
         _MD_UUID=$(str_replace "$_MD_UUID" "-" "")
         _MD_UUID=$(str_replace "$_MD_UUID" ":" "")
@@ -58,13 +54,13 @@ _md_force_run() {
             # check if we should handle this device
             strstr " $_MD_UUID " " $_UUID " || continue
 
-            _md_start "${_md}" "${_offroot}"
+            _md_start "${_md}"
         done
     else
         # try to force-run anything not running yet
         for _md in /dev/md[0-9_]*; do
             [ -b "$_md" ] || continue
-            _md_start "${_md}" "${_offroot}"
+            _md_start "${_md}"
         done
     fi
 }
index 4d9baa524dafdac674df1cff4d9bfb165e6369c0..2cce976963aa8df45112799fa4c54e4299cf5983 100755 (executable)
@@ -60,5 +60,3 @@ if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then
     info "no MD RAID for SNIA ddf raids"
     udevproperty rd_NO_MDDDF=1
 fi
-
-strstr "$(mdadm --help-options 2>&1)" offroot && udevproperty rd_MD_OFFROOT=--offroot