Blame 0123-dmraid-only-scan-once-because-of-one-device.patch

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