SHA256
1
0
forked from pool/systemd
systemd/modules_on_boot.patch
Frederic Crozat f54de6a28b - Update to version 41:
+ systemd binary is now installed in /lib/systemd (symlink for
  /bin/systemd is available now)
  + kernel modules are now loaded through libkmod
  + Watchdog support is now useful (not complete)
  + new kernel command line available to set system wide
    environment variable: systemd.setenv
  + journald capabilities set is now limited
  + SIGPIPE is ignored by default. This can be disabled with
    IgnoreSIGPIPE=no in unit files.
- Add fix-kmod-build.patch: fix build with libkmod
- Drop remote-fs-after-network.patch (merged upstream)
- Add dm-lvm-after-local-fs-pre-target.patch: ensure md / lvm
  /dmraid is started before mounting partitions, if fsck was
  disabled for them (bnc#733283).
- Update lsb-header patch to correctly disable heuristic if
  X-Systemd-RemainAfterExit is specified (whatever its value)
- Add fix-message-after-chkconfig.patch: don't complain if only
  sysv services are called in systemctl.
- Add is-enabled-non-existing-service.patch: fix error message when
  running is-enabled on non-existing service.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=242
2012-02-09 17:04:56 +00:00

95 lines
4.2 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-41/src/modules-load.c
===================================================================
--- systemd-41.orig/src/modules-load.c
+++ systemd-41/src/modules-load.c
@@ -44,6 +44,9 @@ static void systemd_kmod_log(void *data,
int main(int argc, char *argv[]) {
int r = EXIT_FAILURE;
char **files, **fn;
+#if defined(TARGET_SUSE)
+ char *modules_on_boot = NULL;
+#endif
struct kmod_ctx *ctx;
const int probe_flags = KMOD_PROBE_APPLY_BLACKLIST|KMOD_PROBE_IGNORE_LOADED;
@@ -141,9 +144,58 @@ 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;
+ struct kmod_list *itr, *modlist = NULL;
+ int err;
+
+ if (modules) {
+ STRV_FOREACH(module, modules) {
+ err = kmod_module_new_from_lookup(ctx, *module, &modlist);
+ if (err < 0) {
+ log_error("Failed to lookup alias '%s'", *module);
+ r = EXIT_FAILURE;
+ continue;
+ }
+ kmod_list_foreach(itr, modlist) {
+ struct kmod_module *mod = kmod_module_get_module(itr);
+ err = kmod_module_probe_insert_module(mod, probe_flags,
+ NULL, NULL, NULL, NULL);
+
+ if (err == 0)
+ log_info("Inserted module '%s'", kmod_module_get_name(mod));
+ else if (err == KMOD_PROBE_APPLY_BLACKLIST)
+ log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
+ else {
+ log_error("Failed to insert '%s': %s", kmod_module_get_name(mod),
+ strerror(-err));
+ r = EXIT_FAILURE;
+ }
+
+ kmod_module_unref(mod);
+ }
+ kmod_module_unref_list(modlist);
+ }
+ }
+ strv_free(modules);
+ }
+#endif
finish:
strv_free(files);
+#if defined(TARGET_SUSE)
+ free(modules_on_boot);
+#endif
kmod_unref(ctx);
return r;
Index: systemd-41/units/systemd-modules-load.service.in
===================================================================
--- systemd-41.orig/units/systemd-modules-load.service.in
+++ systemd-41/units/systemd-modules-load.service.in
@@ -11,6 +11,7 @@ DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service
Before=sysinit.target shutdown.target
+ConditionPathExists=|/etc/sysconfig/kernel
ConditionDirectoryNotEmpty=|/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d