Harald Hoyer f8c4a0
From beb26a084794a4bc8baffc8384cb8e41844f89f9 Mon Sep 17 00:00:00 2001
Harald Hoyer f8c4a0
From: "dyoung@redhat.com" <dyoung@redhat.com>
Harald Hoyer f8c4a0
Date: Thu, 8 Aug 2013 14:05:02 +0800
Harald Hoyer f8c4a0
Subject: [PATCH] omit drivers fix
Harald Hoyer f8c4a0
Harald Hoyer f8c4a0
Because omit_drivers list use underline always, so when maching with it
Harald Hoyer f8c4a0
the _mod need to be converted as well or sometimes omit-drivers will fail
Harald Hoyer f8c4a0
silently.
Harald Hoyer f8c4a0
Harald Hoyer f8c4a0
Fix this by replace '-' with '_' in instmods function.
Harald Hoyer f8c4a0
Harald Hoyer f8c4a0
Signed-off-by: Dave Young <dyoung@redhat.com>
Harald Hoyer f8c4a0
---
Harald Hoyer f8c4a0
 dracut-functions.sh | 3 ++-
Harald Hoyer f8c4a0
 1 file changed, 2 insertions(+), 1 deletion(-)
Harald Hoyer f8c4a0
Harald Hoyer f8c4a0
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer f8c4a0
index fbe0633..6033a1a 100755
Harald Hoyer f8c4a0
--- a/dracut-functions.sh
Harald Hoyer f8c4a0
+++ b/dracut-functions.sh
Harald Hoyer f8c4a0
@@ -1420,7 +1420,8 @@ instmods() {
Harald Hoyer f8c4a0
                     return $_ret
Harald Hoyer f8c4a0
                 fi
Harald Hoyer f8c4a0
 
Harald Hoyer f8c4a0
-                if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
Harald Hoyer f8c4a0
+                _mod=${_mod/-/_}
Harald Hoyer f8c4a0
+                if [[ $omit_drivers ]] && [[ "$_mod" =~ $omit_drivers ]]; then
Harald Hoyer f8c4a0
                     dinfo "Omitting driver ${_mod##$srcmods}"
Harald Hoyer f8c4a0
                     return 0
Harald Hoyer f8c4a0
                 fi