SHA256
1
0
forked from pool/systemd
systemd/log-target-null-instead-kmsg.patch
Stephan Kulow c14a1e98d3 Accepting request 242359 from Base:System
- Disable blkrrpart for SLES12 and below

- Add upstream patch
  1054-udev-exclude-MD-from-block-device-ownership-event-lo.patch
- Add with condition blkrrpart to be able to disable the patches
  1025, 1027, 1029, 1030, 1031, 1032, 1033, 1034, 1037, and 1054
  which uses the BLKRRPART ioctl for e.g. synthesize change events
  which may interfere with other tools like parted.

- Update
  handle-disable_caplock-and-compose_table-and-kbd_rate.patch, 
  handle-numlock-value-in-etc-sysconfig-keyboard.patch: read
  /etc/vconsole.conf after /etc/sysconfig/(keyboard,console)
  otherwise empty value in /etc/sysconfig/keyboard might override
  /etc/vconsole.conf values.
- Update :
  0001-journal-compress-return-early-in-uncompress_startswi.patch
  0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch
  0002-vconsole-setup-run-setfont-before-loadkeys.patch
  0003-core-never-consider-failure-when-reading-drop-ins-fa.patch
  0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch
  apply-ACL-for-nvidia-device-nodes.patch
  keep-crypt-password-prompt.patch
  log-target-null-instead-kmsg.patch
  parse-crypttab-for-noauto-option.patch
  set-and-use-default-logconsole.patch: fix all warnings in code
- Remove 0001-compress-fix-return-value.patch: not relevant to
  systemd v210 code.

- Also change udev-generate-peristent-rule to udev-generate-persistent-rule

OBS-URL: https://build.opensuse.org/request/show/242359
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=195
2014-07-26 10:19:44 +00:00

117 lines
3.9 KiB
Diff

---
src/journal/journald-kmsg.c | 16 +++++++++++++++-
src/libudev/libudev-util.c | 16 +++++++++++++++-
src/shared/log.c | 16 +++++++++++++++-
src/shared/util.c | 6 +++++-
4 files changed, 50 insertions(+), 4 deletions(-)
Index: systemd-210/src/journal/journald-kmsg.c
===================================================================
--- systemd-210.orig/src/journal/journald-kmsg.c
+++ systemd-210/src/journal/journald-kmsg.c
@@ -391,12 +391,24 @@ static int dispatch_dev_kmsg(sd_event_so
return server_read_dev_kmsg(s);
}
+static int parse_proc_cmdline_word(const char *word) {
+ if (streq(word, "systemd.log_target=null"))
+ return -115;
+
+ return 0;
+}
+
int server_open_dev_kmsg(Server *s) {
int r;
assert(s);
- s->dev_kmsg_fd = open("/dev/kmsg", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
+ if (parse_proc_cmdline(parse_proc_cmdline_word) == -115) {
+ s->dev_kmsg_fd = open("/dev/null", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
+ } else {
+ s->dev_kmsg_fd = open("/dev/kmsg", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
+ }
+
if (s->dev_kmsg_fd < 0) {
log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
"Failed to open /dev/kmsg, ignoring: %m");
Index: systemd-210/src/libudev/libudev-util.c
===================================================================
--- systemd-210.orig/src/libudev/libudev-util.c
+++ systemd-210/src/libudev/libudev-util.c
@@ -416,6 +416,13 @@ uint64_t util_string_bloom64(const char
return bits;
}
+static int parse_proc_cmdline_word(const char *word) {
+ if (streq(word, "systemd.log_target=null"))
+ return -115;
+
+ return 0;
+}
+
ssize_t print_kmsg(const char *fmt, ...)
{
_cleanup_close_ int fd = -1;
@@ -424,7 +431,12 @@ ssize_t print_kmsg(const char *fmt, ...)
ssize_t len;
ssize_t ret;
- fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ if (parse_proc_cmdline(parse_proc_cmdline_word) == -115) {
+ fd = open("/dev/null", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ } else {
+ fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ }
+
if (fd < 0)
return -errno;
Index: systemd-210/src/shared/log.c
===================================================================
--- systemd-210.orig/src/shared/log.c
+++ systemd-210/src/shared/log.c
@@ -92,12 +92,24 @@ void log_close_kmsg(void) {
kmsg_fd = -1;
}
+static int parse_proc_cmdline_word(const char *word) {
+ if (streq(word, "systemd.log_target=null"))
+ return -115;
+
+ return 0;
+}
+
static int log_open_kmsg(void) {
if (kmsg_fd >= 0)
return 0;
- kmsg_fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ if (parse_proc_cmdline(parse_proc_cmdline_word) == -115) {
+ kmsg_fd = open("/dev/null", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ } else {
+ kmsg_fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
+ }
+
if (kmsg_fd < 0)
return -errno;
Index: systemd-210/src/shared/util.c
===================================================================
--- systemd-210.orig/src/shared/util.c
+++ systemd-210/src/shared/util.c
@@ -6069,7 +6069,11 @@ int parse_proc_cmdline(int (*parse_word)
r = parse_word(word);
if (r < 0) {
- log_error("Failed on cmdline argument %s: %s", word, strerror(-r));
+ if (r == -115) {
+ log_error("Warning: %s set, redirecting messages to /dev/null.", word);
+ } else {
+ log_error("Failed on cmdline argument %s: %s", word, strerror(-r));
+ }
return r;
}
}