- Shadow single sysv service, it was breaking runlevel 1.

- Add modules_on_boot.patch to handle /etc/sysconfig/kernel
  MODULES_ON_BOOT variable (bnc#721662).

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=215
This commit is contained in:
Frederic Crozat 2011-10-12 13:43:49 +00:00 committed by Git OBS Bridge
parent 67eb0af50f
commit 917414614f
4 changed files with 96 additions and 0 deletions

79
modules_on_boot.patch Normal file
View File

@ -0,0 +1,79 @@
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(-)
diff --git a/src/modules-load.c b/src/modules-load.c
index 8dd98f7..73ef5f5 100644
--- a/src/modules-load.c
+++ b/src/modules-load.c
@@ -36,6 +36,9 @@ int main(int argc, char *argv[]) {
char **arguments = NULL;
unsigned n_arguments = 0, n_allocated = 0;
char **files, **fn;
+#if defined(TARGET_SUSE)
+ char *modules_on_boot = NULL;
+#endif
if (argc > 1) {
log_error("This program takes no argument.");
@@ -126,6 +129,42 @@ int main(int argc, char *argv[]) {
}
strv_free(files);
+#if defined(TARGET_SUSE)
+ 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));
+ }
+ if (modules_on_boot) {
+ char **modules = strv_split(modules_on_boot,WHITESPACE);
+ char **module;
+ if (modules) {
+ STRV_FOREACH(module, modules) {
+ if (n_arguments >= n_allocated) {
+ char **a;
+ unsigned m;
+
+ m = MAX(16U, n_arguments*2);
+
+ if (!(a = realloc(arguments, sizeof(char*) * (m+1)))) {
+ log_error("Failed to increase module array size.");
+ free(*module);
+ r = EXIT_FAILURE;
+ continue;
+ }
+
+ arguments = a;
+ n_allocated = m;
+ }
+ log_debug("adding module: %s\n", *module);
+ arguments[n_arguments++] = strdup(*module);
+ }
+ }
+ strv_free(modules);
+ }
+#endif
+
finish:
if (n_arguments > 3) {
@@ -138,6 +177,9 @@ finish:
}
strv_free(arguments);
+#if defined(TARGET_SUSE)
+ free(modules_on_boot);
+#endif
return r;
}
--
1.7.3.4

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Oct 12 13:21:15 UTC 2011 - fcrozat@suse.com
- Shadow single sysv service, it was breaking runlevel 1.
- Add modules_on_boot.patch to handle /etc/sysconfig/kernel
MODULES_ON_BOOT variable (bnc#721662).
-------------------------------------------------------------------
Wed Oct 12 08:38:36 UTC 2011 - fcrozat@suse.com

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Oct 12 13:21:15 UTC 2011 - fcrozat@suse.com
- Shadow single sysv service, it was breaking runlevel 1.
- Add modules_on_boot.patch to handle /etc/sysconfig/kernel
MODULES_ON_BOOT variable (bnc#721662).
-------------------------------------------------------------------
Wed Oct 12 08:38:36 UTC 2011 - fcrozat@suse.com

View File

@ -66,6 +66,7 @@ Patch8: tty1.patch
Patch10: 0001-service-Fix-dependencies-added-when-parsing-insserv..patch
Patch13: 0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch
Patch15: support-sysvinit.patch
Patch16: modules_on_boot.patch
# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
@ -120,6 +121,7 @@ Plymouth integration for systemd
%patch10 -p1
%patch13 -p1
%patch15 -p1
%patch16 -p1
%build
autoreconf -fiv
@ -180,6 +182,7 @@ install -m644 %{S:2} %{buildroot}/lib/systemd/system/localfs.service
#ln -s /dev/null %{buildroot}/lib/systemd/system/localnet.service
ln -s /dev/null %{buildroot}/lib/systemd/system/proc.service
ln -s fsck-root.service %{buildroot}/lib/systemd/system/rootfsck.service
ln -s /dev/null %{buildroot}/lib/systemd/system/single.service
ln -s /dev/null %{buildroot}/lib/systemd/system/swap.service
ln -s /dev/null %{buildroot}/lib/systemd/system/startpreload.service
ln -s /dev/null %{buildroot}/lib/systemd/system/stoppreload.service