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