SHA256
1
0
forked from pool/systemd
systemd/sysctl-handle-boot-sysctl.conf-kernel_release.patch
Robert Milasan 0201053d5c Accepting request 178519 from home:rmilasan:branches:Base:System
- Add udev MSFT compability rules (bnc#805059).
  add: 1007-add-msft-compability-rules.patch
- Add sg3_utils requires, need it by 61-msft.rules (bnc#805059).
- Clean-up spec file, put udev patches after systemd patches.
- Rebase patches so they would apply nicely.

- Add udev MSFT compability rules (bnc#805059).
  add: 1007-add-msft-compability-rules.patch
- Add sg3_utils requires, need it by 61-msft.rules (bnc#805059).
- Clean-up spec file, put udev patches after systemd patches.
- Rebase patches so they would apply nicely.

OBS-URL: https://build.opensuse.org/request/show/178519
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=391
2013-06-11 11:22:32 +00:00

51 lines
1.8 KiB
Diff

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).
---
src/sysctl/sysctl.c | 8 ++++++++
units/systemd-sysctl.service.in | 1 +
2 files changed, 9 insertions(+)
Index: systemd-204/src/sysctl/sysctl.c
===================================================================
--- systemd-204.orig/src/sysctl/sysctl.c
+++ systemd-204/src/sysctl/sysctl.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <limits.h>
#include <getopt.h>
+#include <sys/utsname.h>
#include "log.h"
#include "strv.h"
@@ -297,6 +298,13 @@ int main(int argc, char *argv[]) {
} 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) {
Index: systemd-204/units/systemd-sysctl.service.in
===================================================================
--- systemd-204.orig/units/systemd-sysctl.service.in
+++ systemd-204/units/systemd-sysctl.service.in
@@ -20,6 +20,7 @@ ConditionDirectoryNotEmpty=|/usr/lib/sys
ConditionDirectoryNotEmpty=|/usr/local/lib/sysctl.d
ConditionDirectoryNotEmpty=|/etc/sysctl.d
ConditionDirectoryNotEmpty=|/run/sysctl.d
+ConditionPathExistsGlob=|/boot/sysctl.conf-*
[Service]
Type=oneshot