2013-05-17 17:16:28 +02:00
|
|
|
From 752a4370ecb5643a432ad73b1e22c80cd304948f Mon Sep 17 00:00:00 2001
|
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Fri, 17 May 2013 13:31:46 +0200
|
|
|
|
Subject: [PATCH] sysctl: handle /boot/sysctl.conf-<kernel_release>
|
|
|
|
|
|
|
|
Add support for kernel release sysctl.conf files (for per-flavor
|
|
|
|
configuration), needed by openSUSE (bnc#809420).
|
|
|
|
---
|
2015-02-13 10:43:21 +01:00
|
|
|
src/sysctl/sysctl.c | 8 ++++++++
|
|
|
|
units/systemd-sysctl.service.in | 2 ++
|
|
|
|
2 files changed, 10 insertions(+)
|
2013-05-17 17:16:28 +02:00
|
|
|
|
2015-02-13 10:43:21 +01:00
|
|
|
Index: systemd-218/src/sysctl/sysctl.c
|
2013-09-19 01:39:18 +02:00
|
|
|
===================================================================
|
2015-02-13 10:43:21 +01:00
|
|
|
--- systemd-218.orig/src/sysctl/sysctl.c
|
|
|
|
+++ systemd-218/src/sysctl/sysctl.c
|
2013-05-17 17:16:28 +02:00
|
|
|
@@ -26,6 +26,7 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
+#include <sys/utsname.h>
|
|
|
|
|
|
|
|
#include "log.h"
|
|
|
|
#include "strv.h"
|
2015-02-13 10:43:21 +01:00
|
|
|
@@ -310,6 +311,13 @@ int main(int argc, char *argv[]) {
|
2013-05-17 17:16:28 +02:00
|
|
|
} else {
|
|
|
|
_cleanup_strv_free_ char **files = NULL;
|
|
|
|
char **f;
|
|
|
|
+ char kernel_sysctl[PATH_MAX];
|
|
|
|
+ struct utsname uts;
|
|
|
|
+
|
|
|
|
+ assert_se(uname(&uts) >= 0);
|
|
|
|
+
|
|
|
|
+ snprintf(kernel_sysctl, sizeof(kernel_sysctl), "/boot/sysctl.conf-%s", uts.release);
|
|
|
|
+ r = parse_file(sysctl_options, kernel_sysctl, true);
|
|
|
|
|
|
|
|
r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
|
|
|
|
if (r < 0) {
|
2015-02-13 10:43:21 +01:00
|
|
|
Index: systemd-218/units/systemd-sysctl.service.in
|
2013-09-19 01:39:18 +02:00
|
|
|
===================================================================
|
2015-02-13 10:43:21 +01:00
|
|
|
--- systemd-218.orig/units/systemd-sysctl.service.in
|
|
|
|
+++ systemd-218/units/systemd-sysctl.service.in
|
|
|
|
@@ -13,6 +13,8 @@ Conflicts=shutdown.target
|
|
|
|
After=systemd-modules-load.service
|
|
|
|
Before=sysinit.target shutdown.target
|
|
|
|
ConditionPathIsReadWrite=/proc/sys/
|
2013-10-01 09:23:27 +02:00
|
|
|
+ConditionPathExistsGlob=|/boot/sysctl.conf-%v
|
2013-09-19 01:39:18 +02:00
|
|
|
+RequiresMountsFor=/boot
|
2013-05-17 17:16:28 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|