2011-10-12 15:43:49 +02:00
|
|
|
From 051e407e1af70e779c092c81733a98832c29d6b4 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Wed, 12 Oct 2011 15:18:29 +0200
|
|
|
|
Subject: [PATCH] module-load: handle SUSE /etc/sysconfig/kernel module list
|
|
|
|
|
|
|
|
---
|
|
|
|
src/modules-load.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
1 files changed, 42 insertions(+), 0 deletions(-)
|
|
|
|
|
2012-10-26 14:34:44 +02:00
|
|
|
Index: systemd-191/src/modules-load/modules-load.c
|
2011-12-09 15:44:59 +01:00
|
|
|
===================================================================
|
2012-10-26 14:34:44 +02:00
|
|
|
--- systemd-191.orig/src/modules-load/modules-load.c
|
|
|
|
+++ systemd-191/src/modules-load/modules-load.c
|
|
|
|
@@ -173,6 +173,9 @@ int main(int argc, char *argv[]) {
|
|
|
|
int r = EXIT_FAILURE, k;
|
|
|
|
char **files = NULL, **fn, **i;
|
|
|
|
struct kmod_ctx *ctx;
|
2011-10-12 15:43:49 +02:00
|
|
|
+#if defined(TARGET_SUSE)
|
|
|
|
+ char *modules_on_boot = NULL;
|
|
|
|
+#endif
|
|
|
|
|
2012-10-26 14:34:44 +02:00
|
|
|
if (argc > 1) {
|
|
|
|
log_error("This program takes no argument.");
|
|
|
|
@@ -256,9 +259,34 @@ int main(int argc, char *argv[]) {
|
2011-10-12 15:43:49 +02:00
|
|
|
|
2012-02-09 18:04:56 +01:00
|
|
|
fclose(f);
|
|
|
|
}
|
2012-10-26 14:34:44 +02:00
|
|
|
-
|
2011-10-12 15:43:49 +02:00
|
|
|
+#if defined(TARGET_SUSE)
|
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
|
|
|
strv_free(files);
|
2011-10-12 15:43:49 +02:00
|
|
|
+#if defined(TARGET_SUSE)
|
|
|
|
+ free(modules_on_boot);
|
|
|
|
+#endif
|
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);
|
2011-10-12 15:43:49 +02:00
|
|
|
|
2012-10-26 14:34:44 +02:00
|
|
|
Index: systemd-191/units/systemd-modules-load.service.in
|
2011-12-09 15:44:59 +01:00
|
|
|
===================================================================
|
2012-10-26 14:34:44 +02:00
|
|
|
--- systemd-191.orig/units/systemd-modules-load.service.in
|
|
|
|
+++ systemd-191/units/systemd-modules-load.service.in
|
|
|
|
@@ -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
|