summaryrefslogtreecommitdiffstats
path: root/testing/source/mkinitrd/0008-fix-check-if-BASEDEV-is-a-partition-of-a-RAID-volume.patch
blob: 1f238289553b7cb0f9d6ffcca1a0275d73e8224b (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- ./mkinitrd_command_generator.sh.orig	2023-02-28 15:19:08.085991698 -0600
+++ ./mkinitrd_command_generator.sh	2023-02-28 15:22:03.264982008 -0600
@@ -308,11 +308,15 @@
       USING_RAID=1
       break
     fi
-  done
-  # Additional check in case $BASEDEV is a partition of /dev/$MD:
-  for BLK in $(sfdisk -ld /dev/$MD 2> /dev/null | grep "^/dev" | cut -d " " -f 1); do
-    if [ "$BASEDEV" = "$BLK" ]; then
-      USING_RAID=1
+    # Additional check in case $BASEDEV is a partition of /dev/$MD:
+    for BLK in $(sfdisk -ld /dev/$MD 2> /dev/null | grep "^/dev" | cut -d " " -f 1); do
+      if [ "$BASEDEV" = "$BLK" ]; then
+        USING_RAID=1
+        break
+      fi
+    done
+    # Break out of outer loop if needed.
+    if [ "$USING_RAID" = "1" ]; then
       break
     fi
   done