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