[PATCH 2/3] Implement rdloaddriver= in loader (#689029)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Support dracut's rdloaddriver= option for force-loading kernel modules
at boot time.  This keeps loader's options in line with dracut and deals
with the customer cases where they want to force the loading of a
particular kernel module before udev scans the system.

The following syntax is valid:

    rdloaddriver=module
    rdloaddriver=module,module,module

You may specify multiple rdloaddriver= options.  "rdloaddriver" itself
is case-insensitive, but the kernel module name must exactly match what
it's called.
---
 loader/loader.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index aa26605..9ca56f3 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1110,6 +1110,23 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData,
                             &loaderData->proxyPassword, &loaderData->proxy);
         else if (!strncasecmp(argv[i], "noverifyssl", 11))
             flags |= LOADER_FLAGS_NOVERIFYSSL;
+        else if (!strncasecmp(argv[i], "rdloaddriver=", 13)) {
+            gint j = 0;
+            gchar *val = argv[i] + 13;
+            gchar **mods = NULL;
+
+            if (g_strcmp0(val, "")) {
+                if ((mods = g_strsplit(val, ",", 0)) != NULL) {
+                    for (j=0; j < g_strv_length(mods); j++) {
+                        if (mods[j] != NULL && g_strcmp0(mods[j], "")) {
+                            mlLoadModule(mods[j], NULL);
+                        }
+                    }
+
+                    g_strfreev(mods);
+                }
+            }
+        }
         else if (numExtraArgs < (MAX_EXTRA_ARGS - 1)) {
             /* go through and append args we just want to pass on to */
             /* the anaconda script, but don't want to represent as a */
-- 
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux