2011-10-12 15:43:49 +02:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Wed, 12 Oct 2011 15:18:29 +0200
|
2013-04-13 13:09:53 +02:00
|
|
|
Subject: module-load: handle SUSE /etc/sysconfig/kernel module list
|
2011-10-12 15:43:49 +02:00
|
|
|
|
|
|
|
---
|
2013-04-13 13:09:53 +02:00
|
|
|
src/modules-load/modules-load.c | 27 ++++++++++++++++++++++++++-
|
|
|
|
units/systemd-modules-load.service.in | 1 +
|
|
|
|
2 files changed, 27 insertions(+), 1 deletion(-)
|
2011-10-12 15:43:49 +02:00
|
|
|
|
2013-07-23 11:21:21 +02:00
|
|
|
--- systemd-206.orig/src/modules-load/modules-load.c
|
|
|
|
+++ systemd-206/src/modules-load/modules-load.c
|
|
|
|
@@ -262,6 +262,9 @@ static int parse_argv(int argc, char *ar
|
2013-04-13 13:09:53 +02:00
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
int r, k;
|
2012-10-26 14:34:44 +02:00
|
|
|
struct kmod_ctx *ctx;
|
2013-04-13 13:09:53 +02:00
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
|
|
|
+ _cleanup_free_ char *modules_on_boot = NULL;
|
2011-10-12 15:43:49 +02:00
|
|
|
+#endif
|
|
|
|
|
2013-04-13 13:09:53 +02:00
|
|
|
r = parse_argv(argc, argv);
|
|
|
|
if (r <= 0)
|
|
|
|
@@ -318,7 +321,29 @@ int main(int argc, char *argv[]) {
|
|
|
|
r = k;
|
|
|
|
}
|
2012-02-09 18:04:56 +01:00
|
|
|
}
|
2012-10-26 14:34:44 +02:00
|
|
|
-
|
2013-04-13 13:09:53 +02:00
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
2012-02-09 18:04:56 +01:00
|
|
|
+ log_debug("apply: /etc/sysconfig/kernel MODULES_LOADED_ON_BOOT");
|
2011-10-12 15:43:49 +02:00
|
|
|
+ if ((r = parse_env_file("/etc/sysconfig/kernel", NEWLINE,
|
|
|
|
+ "MODULES_LOADED_ON_BOOT", &modules_on_boot,
|
|
|
|
+ NULL)) < 0) {
|
2012-01-26 17:29:45 +01:00
|
|
|
+ if (r != -ENOENT)
|
|
|
|
+ log_warning("Failed to read /etc/sysconfig/kernel: %s", strerror(-r));
|
|
|
|
+ } else
|
|
|
|
+ r = EXIT_SUCCESS;
|
2011-10-12 15:43:49 +02:00
|
|
|
+ if (modules_on_boot) {
|
|
|
|
+ char **modules = strv_split(modules_on_boot,WHITESPACE);
|
|
|
|
+ char **module;
|
2012-02-09 18:04:56 +01:00
|
|
|
+
|
2011-10-12 15:43:49 +02:00
|
|
|
+ if (modules) {
|
|
|
|
+ STRV_FOREACH(module, modules) {
|
2012-10-26 14:34:44 +02:00
|
|
|
+ k = load_module(ctx, *module);
|
|
|
|
+ if (k < 0)
|
2012-02-09 18:04:56 +01:00
|
|
|
+ r = EXIT_FAILURE;
|
2011-10-12 15:43:49 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ strv_free(modules);
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
finish:
|
2012-02-09 18:04:56 +01:00
|
|
|
kmod_unref(ctx);
|
2012-10-26 14:34:44 +02:00
|
|
|
strv_free(arg_proc_cmdline_modules);
|
2013-07-23 11:21:21 +02:00
|
|
|
--- systemd-206.orig/units/systemd-modules-load.service.in
|
|
|
|
+++ systemd-206/units/systemd-modules-load.service.in
|
2012-10-26 14:34:44 +02:00
|
|
|
@@ -13,6 +13,7 @@ Conflicts=shutdown.target
|
2011-12-09 15:44:59 +01:00
|
|
|
After=systemd-readahead-collect.service systemd-readahead-replay.service
|
|
|
|
Before=sysinit.target shutdown.target
|
2012-10-26 14:34:44 +02:00
|
|
|
ConditionCapability=CAP_SYS_MODULE
|
2011-12-09 15:44:59 +01:00
|
|
|
+ConditionPathExists=|/etc/sysconfig/kernel
|
|
|
|
ConditionDirectoryNotEmpty=|/lib/modules-load.d
|
|
|
|
ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
|
|
|
|
ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d
|