systemd/modules_on_boot.patch
Cristian Rodríguez 6e0d9c4c7b - Create and own more systemd drop-in directories.
- Improve mini packages for bootstrapping.
- do not mount /tmp as tmpfs by default.

- Fix install script when there is no inittab

- Create a systemd-mini specfile to prevent cycle in bootstrapping

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=300
2012-10-26 12:34:44 +00:00

72 lines
2.7 KiB
Diff

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(-)
Index: systemd-191/src/modules-load/modules-load.c
===================================================================
--- 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;
+#if defined(TARGET_SUSE)
+ char *modules_on_boot = NULL;
+#endif
if (argc > 1) {
log_error("This program takes no argument.");
@@ -256,9 +259,34 @@ int main(int argc, char *argv[]) {
fclose(f);
}
-
+#if defined(TARGET_SUSE)
+ 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:
strv_free(files);
+#if defined(TARGET_SUSE)
+ free(modules_on_boot);
+#endif
kmod_unref(ctx);
strv_free(arg_proc_cmdline_modules);
Index: systemd-191/units/systemd-modules-load.service.in
===================================================================
--- systemd-191.orig/units/systemd-modules-load.service.in
+++ systemd-191/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