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