6edea0
From e4e1ab4e129fa17c5e90a2144e15096b0267c22a Mon Sep 17 00:00:00 2001
6edea0
From: Lukas Nykryn <lnykryn@redhat.com>
6edea0
Date: Thu, 2 Jul 2020 09:08:03 +0200
6edea0
Subject: [PATCH] install: also install post weak dependencies of kernel
6edea0
 modules
6edea0
6edea0
(cherry picked from commit 6dafdda4a6bdb8721133e4267553c5d86564f9e8)
6edea0
6edea0
Resolves: #1846343
6edea0
---
6edea0
 install/dracut-install.c | 18 +++++++++++++-----
6edea0
 1 file changed, 13 insertions(+), 5 deletions(-)
6edea0
6edea0
diff --git a/install/dracut-install.c b/install/dracut-install.c
6edea0
index 253ae194..51f79422 100644
6edea0
--- a/install/dracut-install.c
6edea0
+++ b/install/dracut-install.c
6edea0
@@ -1272,9 +1272,13 @@ static int install_dependent_modules(struct kmod_list *modlist)
6edea0
 			ret = install_dependent_modules(modlist);
6edea0
 			if (ret == 0) {
6edea0
 				ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
6edea0
-				if (ret == 0)
6edea0
-					ret = install_dependent_modules(modpre);
6edea0
-			}
6edea0
+                                if (ret == 0) {                        
6edea0
+                                        int r;
6edea0
+                                        ret = install_dependent_modules(modpre);    
6edea0
+                                        r = install_dependent_modules(modpost);
6edea0
+                                        ret = ret ? : r;
6edea0
+                                }
6edea0
+                        }
6edea0
                 } else {
6edea0
                         log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
6edea0
                 }
6edea0
@@ -1335,8 +1339,12 @@ static int install_module(struct kmod_module *mod)
6edea0
 
6edea0
         if (ret == 0) {
6edea0
                 ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
6edea0
-                if (ret == 0)
6edea0
-                        ret = install_dependent_modules(modpre);
6edea0
+                if (ret == 0) {                        
6edea0
+                        int r;
6edea0
+                        ret = install_dependent_modules(modpre);    
6edea0
+                        r = install_dependent_modules(modpost);
6edea0
+                        ret = ret ? : r;
6edea0
+                }
6edea0
         }
6edea0
 
6edea0
         return ret;
6edea0