Blame SOURCES/0311-dmraid-only-scan-once-because-of-one-device.patch

64b87c
From 80153acc0f8bbb3829575201e2a0ba3da41268a8 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Tue, 18 Aug 2015 15:04:31 +0200
64b87c
Subject: [PATCH] dmraid: only scan once because of one device
64b87c
64b87c
---
64b87c
 modules.d/90dmraid/61-dmraid-imsm.rules | 2 +-
64b87c
 modules.d/90dmraid/dmraid.sh            | 7 +++++++
64b87c
 2 files changed, 8 insertions(+), 1 deletion(-)
64b87c
64b87c
diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
1755ca
index 33e060be..de7e97e5 100644
64b87c
--- a/modules.d/90dmraid/61-dmraid-imsm.rules
64b87c
+++ b/modules.d/90dmraid/61-dmraid-imsm.rules
64b87c
@@ -24,6 +24,6 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
64b87c
 ENV{DEVTYPE}!="partition", \
64b87c
     RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
64b87c
 
64b87c
-RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan"
64b87c
+RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan $env{DEVNAME}"
64b87c
 
64b87c
 LABEL="dm_end"
64b87c
diff --git a/modules.d/90dmraid/dmraid.sh b/modules.d/90dmraid/dmraid.sh
1755ca
index 3753ddd7..ce9a6b20 100755
64b87c
--- a/modules.d/90dmraid/dmraid.sh
64b87c
+++ b/modules.d/90dmraid/dmraid.sh
64b87c
@@ -4,6 +4,13 @@
64b87c
 
64b87c
 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
64b87c
 
64b87c
+dev="$1"
64b87c
+devenc=$(str_replace "$1" '/' '\2f')
64b87c
+
64b87c
+[ -e /tmp/dmraid.$devenc ] && exit 0
64b87c
+
64b87c
+>/tmp/dmraid.$devenc
64b87c
+
64b87c
 DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
64b87c
 
64b87c
 if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then