SHA256
1
0
forked from pool/systemd
systemd/module-load-handle-SUSE-etc-sysconfig-kernel-module-list.patch

67 lines
2.5 KiB
Diff
Raw Normal View History

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(-)
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
index 7b19ee0..36b1a68 100644
--- a/src/modules-load/modules-load.c
+++ b/src/modules-load/modules-load.c
@@ -262,6 +262,9 @@ static int parse_argv(int argc, char *argv[]) {
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;
}
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - 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. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
}
-
+#ifdef HAVE_SYSV_COMPAT
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - 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. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
+ 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;
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - 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. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
+
+ if (modules) {
+ STRV_FOREACH(module, modules) {
+ k = load_module(ctx, *module);
+ if (k < 0)
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - 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. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
+ r = EXIT_FAILURE;
+ }
+ }
+ strv_free(modules);
+ }
+#endif
finish:
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - 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. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
kmod_unref(ctx);
strv_free(arg_proc_cmdline_modules);
diff --git a/units/systemd-modules-load.service.in b/units/systemd-modules-load.service.in
index 32deb52..2e26d2f 100644
--- a/units/systemd-modules-load.service.in
+++ b/units/systemd-modules-load.service.in
@@ -13,6 +13,7 @@ Conflicts=shutdown.target
Accepting request 96193 from Base:System - Remove storage-after-cryptsetup.service, add storage-after-cryptsetup.patch instead to prevent dependency cycle (bnc#722539). - Add delay-fsck-cryptsetup-after-md-lvm-dmraid.patch: ensure fsck/cryptsetup is run after lvm/md/dmraid have landed (bnc#724912). - Add cron-tty-pam.patch: Fix cron filling logs (bnc#731358). - Add do_not_warn_pidfile.patch: Fix PID warning in logs (bnc#732912). - Add mount-swap-log.patch: Ensure swap and mount output is redirected to default log target (rhb#750032). - Add color-on-boot.patch: ensure colored status are displayed at boot time. - Update modules_on_boot.patch to fix bnc#732041. - Replace private_tmp_crash.patch with log_on_close.patch, better upstream fix for bnc#699829 and fix bnc#731719. - Update vconsole patch to fix memleaks and crash (bnc#734527). - Add handle-racy-daemon.patch: fix warnings with sendmail (bnc#732912). - Add new-lsb-headers.patch: support PIDFile: and X-Systemd-RemainAfterExit: header in initscript (bnc#727771). - Update bootsplash services to not start if vga= is missing from cmdline (bnc#727771) - Add lock-opensuse.patch: disable /var/lock/{subsys,lockdev} and change default permissions on /var/lock (bnc#733523). - Add garbage_collect_units: ensure error units are correctly garbage collected (rhb#680122). - Add crypt-loop-file.patch: add support for crypt file loop (bnc#730496). OBS-URL: https://build.opensuse.org/request/show/96193 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=84
2011-12-12 16:59:25 +01:00
After=systemd-readahead-collect.service systemd-readahead-replay.service
Before=sysinit.target shutdown.target
ConditionCapability=CAP_SYS_MODULE
Accepting request 96193 from Base:System - Remove storage-after-cryptsetup.service, add storage-after-cryptsetup.patch instead to prevent dependency cycle (bnc#722539). - Add delay-fsck-cryptsetup-after-md-lvm-dmraid.patch: ensure fsck/cryptsetup is run after lvm/md/dmraid have landed (bnc#724912). - Add cron-tty-pam.patch: Fix cron filling logs (bnc#731358). - Add do_not_warn_pidfile.patch: Fix PID warning in logs (bnc#732912). - Add mount-swap-log.patch: Ensure swap and mount output is redirected to default log target (rhb#750032). - Add color-on-boot.patch: ensure colored status are displayed at boot time. - Update modules_on_boot.patch to fix bnc#732041. - Replace private_tmp_crash.patch with log_on_close.patch, better upstream fix for bnc#699829 and fix bnc#731719. - Update vconsole patch to fix memleaks and crash (bnc#734527). - Add handle-racy-daemon.patch: fix warnings with sendmail (bnc#732912). - Add new-lsb-headers.patch: support PIDFile: and X-Systemd-RemainAfterExit: header in initscript (bnc#727771). - Update bootsplash services to not start if vga= is missing from cmdline (bnc#727771) - Add lock-opensuse.patch: disable /var/lock/{subsys,lockdev} and change default permissions on /var/lock (bnc#733523). - Add garbage_collect_units: ensure error units are correctly garbage collected (rhb#680122). - Add crypt-loop-file.patch: add support for crypt file loop (bnc#730496). OBS-URL: https://build.opensuse.org/request/show/96193 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=84
2011-12-12 16:59:25 +01:00
+ConditionPathExists=|/etc/sysconfig/kernel
ConditionDirectoryNotEmpty=|/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d