Blame 0050-Fix-regressions-with-dracut-install-with-kernel-modu.patch

Harald Hoyer b38677
From 8d9ab2755d1341904ca7889f4e05b2151848a759 Mon Sep 17 00:00:00 2001
Harald Hoyer b38677
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer b38677
Date: Wed, 13 Apr 2016 11:47:20 +0200
Harald Hoyer b38677
Subject: [PATCH] Fix regressions with dracut-install with kernel modules
Harald Hoyer b38677
Harald Hoyer b38677
Make sure, the same modules are installed as before.
Harald Hoyer b38677
---
Harald Hoyer b38677
 install/dracut-install.c                           |  9 +++++----
Harald Hoyer b38677
 modules.d/50drm/module-setup.sh                    |  4 ++--
Harald Hoyer b38677
 modules.d/90kernel-modules/module-setup.sh         | 15 ++++++++-------
Harald Hoyer b38677
 modules.d/90kernel-network-modules/module-setup.sh |  2 +-
Harald Hoyer b38677
 modules.d/90multipath/module-setup.sh              |  2 +-
Harald Hoyer b38677
 modules.d/95iscsi/module-setup.sh                  |  2 +-
Harald Hoyer b38677
 6 files changed, 18 insertions(+), 16 deletions(-)
Harald Hoyer b38677
Harald Hoyer b38677
diff --git a/install/dracut-install.c b/install/dracut-install.c
Harald Hoyer b38677
index a20e06c..c246201 100644
Harald Hoyer b38677
--- a/install/dracut-install.c
Harald Hoyer b38677
+++ b/install/dracut-install.c
Harald Hoyer b38677
@@ -1202,6 +1202,7 @@ static int install_module(struct kmod_module *mod)
Harald Hoyer b38677
         if (!check_module_path(path) || !check_module_symbols(mod)) {
Harald Hoyer b38677
                 log_debug("No symbol or patch match for '%s'", path);
Harald Hoyer b38677
                 return 0;
Harald Hoyer b38677
+                //return -ENOENT;
Harald Hoyer b38677
         }
Harald Hoyer b38677
 
Harald Hoyer b38677
         log_debug("dracut_install '%s'", path);
Harald Hoyer b38677
@@ -1295,7 +1296,7 @@ static int install_modules(int argc, char **argv)
Harald Hoyer b38677
                         }
Harald Hoyer b38677
                         kmod_list_foreach(itr, modlist) {
Harald Hoyer b38677
                                 mod = kmod_module_get_module(itr);
Harald Hoyer b38677
-                                ret = install_module(mod);
Harald Hoyer b38677
+                                ret += install_module(mod);
Harald Hoyer b38677
                         }
Harald Hoyer b38677
                         kmod_module_unref_list(modlist);
Harald Hoyer b38677
                         modlist = 0;
Harald Hoyer b38677
@@ -1364,13 +1365,13 @@ static int install_modules(int argc, char **argv)
Harald Hoyer b38677
                                 }
Harald Hoyer b38677
                                 kmod_list_foreach(itr, modlist) {
Harald Hoyer b38677
                                         mod = kmod_module_get_module(itr);
Harald Hoyer b38677
-                                        ret = install_module(mod);
Harald Hoyer b38677
+                                        ret += install_module(mod);
Harald Hoyer b38677
                                         kmod_module_unref(mod);
Harald Hoyer b38677
                                 }
Harald Hoyer b38677
                                 kmod_module_unref_list(modlist);
Harald Hoyer b38677
                                 modlist = 0;
Harald Hoyer b38677
 #else
Harald Hoyer b38677
-                                ret = install_module(mod_o);
Harald Hoyer b38677
+                                ret += install_module(mod_o);
Harald Hoyer b38677
                                 kmod_module_unref(mod_o);
Harald Hoyer b38677
 #endif
Harald Hoyer b38677
 
Harald Hoyer b38677
@@ -1413,7 +1414,7 @@ static int install_modules(int argc, char **argv)
Harald Hoyer b38677
                         }
Harald Hoyer b38677
                         kmod_list_foreach(itr, modlist) {
Harald Hoyer b38677
                                 mod = kmod_module_get_module(itr);
Harald Hoyer b38677
-                                ret = install_module(mod);
Harald Hoyer b38677
+                                ret += install_module(mod);
Harald Hoyer b38677
                                 kmod_module_unref(mod);
Harald Hoyer b38677
                         }
Harald Hoyer b38677
                         kmod_module_unref_list(modlist);
Harald Hoyer b38677
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
Harald Hoyer b38677
index e0b2959..661dde9 100755
Harald Hoyer b38677
--- a/modules.d/50drm/module-setup.sh
Harald Hoyer b38677
+++ b/modules.d/50drm/module-setup.sh
Harald Hoyer b38677
@@ -34,8 +34,8 @@ installkernel() {
Harald Hoyer b38677
     if [[ $hostonly ]]; then
Harald Hoyer b38677
         for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
Harald Hoyer b38677
             [[ -e $i ]] || continue
Harald Hoyer b38677
-            if hostonly="" dracut_instmods -s "drm_crtc_init" $(<$i) 2>/dev/null; then
Harald Hoyer b38677
-                if strstr $(modinfo -F filename $(<$i) 2>/dev/null) radeon.ko; then
Harald Hoyer b38677
+            if hostonly="" dracut_instmods -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i) 2>/dev/null; then
Harald Hoyer b38677
+                if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
Harald Hoyer b38677
                     hostonly='' instmods amdkfd
Harald Hoyer b38677
                 fi
Harald Hoyer b38677
             fi
Harald Hoyer b38677
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
Harald Hoyer b38677
index e97d598..c30715d 100755
Harald Hoyer b38677
--- a/modules.d/90kernel-modules/module-setup.sh
Harald Hoyer b38677
+++ b/modules.d/90kernel-modules/module-setup.sh
Harald Hoyer b38677
@@ -7,20 +7,21 @@ installkernel() {
Harald Hoyer b38677
     if [[ -z $drivers ]]; then
Harald Hoyer b38677
         hostonly='' instmods \
Harald Hoyer b38677
             sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
Harald Hoyer b38677
-            ehci-hcd ehci-pci \
Harald Hoyer b38677
+            ehci-hcd ehci-pci ehci-platform \
Harald Hoyer b38677
             ohci-hcd ohci-pci \
Harald Hoyer b38677
             uhci-hcd \
Harald Hoyer b38677
             xhci-hcd xhci-pci xhci-plat-hcd \
Harald Hoyer b38677
-            ehci-platform
Harald Hoyer b38677
-
Harald Hoyer b38677
-        instmods \
Harald Hoyer b38677
             "=drivers/hid" \
Harald Hoyer b38677
             "=drivers/input/serio" \
Harald Hoyer b38677
             "=drivers/input/keyboard" \
Harald Hoyer b38677
+            "=drivers/usb/storage" \
Harald Hoyer b38677
+            ${NULL}
Harald Hoyer b38677
+
Harald Hoyer b38677
+        instmods \
Harald Hoyer b38677
             yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
Harald Hoyer b38677
             atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
Harald Hoyer b38677
             virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
Harald Hoyer b38677
-            "=drivers/pcmcia" =ide "=drivers/usb/storage"
Harald Hoyer b38677
+            "=drivers/pcmcia" =ide
Harald Hoyer b38677
 
Harald Hoyer b38677
         if [[ "$(uname -p)" == arm* ]]; then
Harald Hoyer b38677
             # arm specific modules
Harald Hoyer b38677
@@ -33,13 +34,13 @@ installkernel() {
Harald Hoyer b38677
                 ${NULL}
Harald Hoyer b38677
         fi
Harald Hoyer b38677
 
Harald Hoyer b38677
-        dracut_instmods -s "${_blockfuncs}" "=drivers"
Harald Hoyer b38677
+        dracut_instmods -o -s "${_blockfuncs}" "=drivers"
Harald Hoyer b38677
 
Harald Hoyer b38677
         # if not on hostonly mode, install all known filesystems,
Harald Hoyer b38677
         # if the required list is not set via the filesystems variable
Harald Hoyer b38677
         if ! [[ $hostonly ]]; then
Harald Hoyer b38677
             if [[ -z $filesystems ]]; then
Harald Hoyer b38677
-                dracut_instmods -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
Harald Hoyer b38677
+                dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
Harald Hoyer b38677
             fi
Harald Hoyer b38677
         else
Harald Hoyer b38677
             hostonly='' instmods "${host_fs_types[@]}"
Harald Hoyer b38677
diff --git a/modules.d/90kernel-network-modules/module-setup.sh b/modules.d/90kernel-network-modules/module-setup.sh
Harald Hoyer b38677
index c004ff8..11fbab9 100755
Harald Hoyer b38677
--- a/modules.d/90kernel-network-modules/module-setup.sh
Harald Hoyer b38677
+++ b/modules.d/90kernel-network-modules/module-setup.sh
Harald Hoyer b38677
@@ -21,7 +21,7 @@ installkernel() {
Harald Hoyer b38677
         _s390drivers="=drivers/s390/net"
Harald Hoyer b38677
     fi
Harald Hoyer b38677
 
Harald Hoyer b38677
-    dracut_instmods -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
+    dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
 
Harald Hoyer b38677
     #instmods() will take care of hostonly
Harald Hoyer b38677
     instmods \
Harald Hoyer b38677
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
Harald Hoyer b38677
index 27817bd..0af777d 100755
Harald Hoyer b38677
--- a/modules.d/90multipath/module-setup.sh
Harald Hoyer b38677
+++ b/modules.d/90multipath/module-setup.sh
Harald Hoyer b38677
@@ -58,7 +58,7 @@ installkernel() {
Harald Hoyer b38677
         _s390drivers="=drivers/s390/scsi"
Harald Hoyer b38677
     fi
Harald Hoyer b38677
 
Harald Hoyer b38677
-    hostonly='' dracut_instmods -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
+    hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
 }
Harald Hoyer b38677
 
Harald Hoyer b38677
 # called by dracut
Harald Hoyer b38677
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
Harald Hoyer b38677
index 203e313..04937b5 100755
Harald Hoyer b38677
--- a/modules.d/95iscsi/module-setup.sh
Harald Hoyer b38677
+++ b/modules.d/95iscsi/module-setup.sh
Harald Hoyer b38677
@@ -166,7 +166,7 @@ installkernel() {
Harald Hoyer b38677
         _s390drivers="=drivers/s390/scsi"
Harald Hoyer b38677
     fi
Harald Hoyer b38677
 
Harald Hoyer b38677
-    dracut_instmods -s "$_funcs" "=drivers/scsi" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
+    dracut_instmods -o -s "$_funcs" "=drivers/scsi" ${_s390drivers:+"$_s390drivers"}
Harald Hoyer b38677
 
Harald Hoyer b38677
 }
Harald Hoyer b38677