]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(mdraid): allow UUID comparison for more than one UUID
authorAlexander Wenzel <alexander.wenzel@qbeyond.de>
Tue, 2 Nov 2021 08:25:56 +0000 (09:25 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Wed, 24 Nov 2021 10:15:11 +0000 (11:15 +0100)
If the system provides more than one UUID, the _MD_UUID var
contains a line break after each UUID. Therefore the strstr
function could not find any UUID, caused by the additional
spaces provided to the function.

Furthermore this could lead to a boot interruption, because
the start of a degraded raid1 won't be executed. So, manual
interaction is necessary.

modules.d/90mdraid/mdraid_start.sh

index 9ac171d3c8ee0054aa67aeb3285a23b5faaf1578..7b3d0de7e3e5a29bb9b0303bc7a2011ceacecdb3 100755 (executable)
@@ -54,7 +54,7 @@ _md_force_run() {
             _UUID=$(str_replace "$_UUID" ":" "")
 
             # check if we should handle this device
-            strstr " $_MD_UUID " " $_UUID " || continue
+            strstr "$_MD_UUID" "$_UUID" || continue
 
             _md_start "${_md}"
         done