SHA256
1
0
forked from pool/systemd
systemd/module-load-handle-SUSE-etc-sysconfig-kernel-module-list.patch
Frederic Crozat 2e48bf7a12 Accepting request 198799 from home:elvigia:branches:Base:System
- version 207, distribution specific changes follow, for overall 
  release notes see NEWS.
- Fixed: 
  * Failed at step PAM spawning /usr/lib/systemd/systemd: 
  Operation not permitted
  * Fix shutdown hang "a stop job is running for Session 1 of user root"
    that was reported in opensuse-factory list.
- systemd-sysctl no longer reads /etc/sysctl.conf however backward
  compatbility is to be provides by a symlink created at %post.

- version 207, distribution specific changes follow, for overall 
  release notes see NEWS.
- Fixed: 
  * Failed at step PAM spawning /usr/lib/systemd/systemd: 
  Operation not permitted
  * Fix shutdown hang "a stop job is running for Session 1 of user root"
    that was reported in opensuse-factory list.
- systemd-sysctl no longer reads /etc/sysctl.conf however backward
  compatbility is to be provides by a symlink created at %post.

OBS-URL: https://build.opensuse.org/request/show/198799
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=429
2013-09-13 07:25:15 +00:00

63 lines
2.4 KiB
Diff

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