From 9c53ec7478f9bd2572bb0a75de996c0f32288179a794b3c41f1b902089c7bee6 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 13 May 2014 08:48:13 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=624 --- ...restoring-brightness-to-an-unreadabl.patch | 79 ++++++++++++ ...to-handle-the-3-errnos-that-are-alia.patch | 30 +++++ ...ht-do-nothing-if-max_brightness-is-0.patch | 108 ++++++++++++++++ ...name_to_handle_at-is-not-implemented.patch | 30 +++++ 0003-analyze-fix-plot-with-bad-y-size.patch | 31 +++++ 0003-backlight-unify-error-messages.patch | 115 ++++++++++++++++++ ...f-kernel-exposes-backlight-device-wi.patch | 40 ++++++ ...g-jobs-to-run-queue-in-unit_coldplug.patch | 30 +++++ ...-saved-brightness-exceeding-max-brig.patch | 64 ++++++++++ ...aiting-jobs-to-run-queue-during-cold.patch | 34 ++++++ log-target-null-instead-kmsg.patch | 114 +++++++++++++++++ systemd-mini.changes | 27 ++++ systemd-mini.spec | 33 +++++ systemd.changes | 27 ++++ systemd.spec | 33 +++++ 15 files changed, 795 insertions(+) create mode 100644 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch create mode 100644 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch create mode 100644 0002-backlight-do-nothing-if-max_brightness-is-0.patch create mode 100644 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch create mode 100644 0003-analyze-fix-plot-with-bad-y-size.patch create mode 100644 0003-backlight-unify-error-messages.patch create mode 100644 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch create mode 100644 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch create mode 100644 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch create mode 100644 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch create mode 100644 log-target-null-instead-kmsg.patch diff --git a/0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch b/0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch new file mode 100644 index 00000000..3b20a7e0 --- /dev/null +++ b/0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch @@ -0,0 +1,79 @@ +From 7b909d7407965c03caaba30daae7aee113627a83 Mon Sep 17 00:00:00 2001 +From: Josh Triplett +Date: Tue, 11 Mar 2014 21:16:33 -0700 +Subject: [PATCH] backlight: Avoid restoring brightness to an unreadably dim + level + +Some systems turn the backlight all the way off at the lowest levels. +Clamp saved brightness to at least 1 or 5% of max_brightness. This +avoids preserving an unreadably dim screen, which would otherwise force +the user to disable state restoration. +--- + src/backlight/backlight.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +diff --git src/backlight/backlight.c src/backlight/backlight.c +index 81470b3..abf8bcf 100644 +--- src/backlight/backlight.c ++++ src/backlight/backlight.c +@@ -192,6 +192,48 @@ static bool validate_device(struct udev *udev, struct udev_device *device) { + return true; + } + ++/* Some systems turn the backlight all the way off at the lowest levels. ++ * clamp_brightness clamps the saved brightness to at least 1 or 5% of ++ * max_brightness. This avoids preserving an unreadably dim screen, which ++ * would otherwise force the user to disable state restoration. */ ++static void clamp_brightness(struct udev_device *device, char **value) { ++ int r; ++ const char *max_brightness_str; ++ unsigned brightness, max_brightness, new_brightness; ++ ++ max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness"); ++ if (!max_brightness_str) { ++ log_warning("Failed to read max_brightness attribute; not checking saved brightness"); ++ return; ++ } ++ ++ r = safe_atou(*value, &brightness); ++ if (r < 0) { ++ log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r)); ++ return; ++ } ++ ++ r = safe_atou(max_brightness_str, &max_brightness); ++ if (r < 0) { ++ log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r)); ++ return; ++ } ++ ++ new_brightness = MAX3(brightness, 1U, max_brightness/20); ++ if (new_brightness != brightness) { ++ char *old_value = *value; ++ ++ r = asprintf(value, "%u", new_brightness); ++ if (r < 0) { ++ log_oom(); ++ return; ++ } ++ ++ log_debug("Saved brightness %s too low; increasing to %s.", old_value, *value); ++ free(old_value); ++ } ++} ++ + int main(int argc, char *argv[]) { + _cleanup_udev_unref_ struct udev *udev = NULL; + _cleanup_udev_device_unref_ struct udev_device *device = NULL; +@@ -306,6 +348,8 @@ int main(int argc, char *argv[]) { + return EXIT_FAILURE; + } + ++ clamp_brightness(device, &value); ++ + r = udev_device_set_sysattr_value(device, "brightness", value); + if (r < 0) { + log_error("Failed to write system attribute: %s", strerror(-r)); +-- +1.7.9.2 + diff --git a/0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch b/0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch new file mode 100644 index 00000000..d087eeb6 --- /dev/null +++ b/0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch @@ -0,0 +1,30 @@ +Based on 0d522a7a0547982eae9ab1b5971e4bed9c2fbc7c Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Thu, 24 Apr 2014 08:11:39 +0200 +Subject: [PATCH] errno: make sure to handle the 3 errnos that are aliases for + others properly + +--- + Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- Makefile.am ++++ Makefile.am 2014-05-12 00:00:00.000000000 +0000 +@@ -1078,7 +1078,7 @@ BUILT_SOURCES += \ + + src/shared/errno-list.txt: + $(AM_V_at)$(MKDIR_P) $(dir $@) +- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+[0-9]/ { print $$2; }' > $@ ++ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' > $@ + + src/shared/errno-from-name.gperf: src/shared/errno-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) +@@ -1090,7 +1090,7 @@ src/shared/errno-from-name.h: src/shared + + src/shared/errno-to-name.h: src/shared/errno-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) +- $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ ++ $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@ + + # ------------------------------------------------------------------------------ + systemd_SOURCES = \ diff --git a/0002-backlight-do-nothing-if-max_brightness-is-0.patch b/0002-backlight-do-nothing-if-max_brightness-is-0.patch new file mode 100644 index 00000000..8ca31e28 --- /dev/null +++ b/0002-backlight-do-nothing-if-max_brightness-is-0.patch @@ -0,0 +1,108 @@ +From 3cadce7d33e263ec7a6a83c00c11144930258b22 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20B=C3=A4chler?= +Date: Thu, 27 Mar 2014 23:41:59 +0100 +Subject: [PATCH] backlight: do nothing if max_brightness is 0 + +On virtually any newer Asus mainboard, the eeepc-wmi driver is loaded. +It exposes a backlight device despite the lack of any physical backlight +devices. This fake backlight device has max_brightness set to 0. Since +the introduction of the clamp_brightness function, systemd-backlight +tries to write '1' to brightness and fails. + +This patch changes systemd-backlight to exit gracefully when +max_brightness is 0 before performing any action. This affects +both the load and save actions. +--- + src/backlight/backlight.c | 44 ++++++++++++++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 14 deletions(-) + +diff --git src/backlight/backlight.c src/backlight/backlight.c +index abf8bcf..ce0385b 100644 +--- src/backlight/backlight.c ++++ src/backlight/backlight.c +@@ -192,30 +192,37 @@ static bool validate_device(struct udev *udev, struct udev_device *device) { + return true; + } + +-/* Some systems turn the backlight all the way off at the lowest levels. +- * clamp_brightness clamps the saved brightness to at least 1 or 5% of +- * max_brightness. This avoids preserving an unreadably dim screen, which +- * would otherwise force the user to disable state restoration. */ +-static void clamp_brightness(struct udev_device *device, char **value) { ++static unsigned get_max_brightness(struct udev_device *device) { + int r; + const char *max_brightness_str; +- unsigned brightness, max_brightness, new_brightness; ++ unsigned max_brightness; + + max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness"); + if (!max_brightness_str) { +- log_warning("Failed to read max_brightness attribute; not checking saved brightness"); +- return; ++ log_warning("Failed to read max_brightness attribute"); ++ return 0; + } + +- r = safe_atou(*value, &brightness); ++ r = safe_atou(max_brightness_str, &max_brightness); + if (r < 0) { +- log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r)); +- return; ++ log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r)); ++ return 0; + } + +- r = safe_atou(max_brightness_str, &max_brightness); ++ return max_brightness; ++} ++ ++/* Some systems turn the backlight all the way off at the lowest levels. ++ * clamp_brightness clamps the saved brightness to at least 1 or 5% of ++ * max_brightness. This avoids preserving an unreadably dim screen, which ++ * would otherwise force the user to disable state restoration. */ ++static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) { ++ int r; ++ unsigned brightness, new_brightness; ++ ++ r = safe_atou(*value, &brightness); + if (r < 0) { +- log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r)); ++ log_warning("Failed to parse brightness \"%s\": %s", *value, strerror(-r)); + return; + } + +@@ -239,6 +246,7 @@ int main(int argc, char *argv[]) { + _cleanup_udev_device_unref_ struct udev_device *device = NULL; + _cleanup_free_ char *saved = NULL, *ss = NULL, *escaped_ss = NULL, *escaped_sysname = NULL, *escaped_path_id = NULL; + const char *sysname, *path_id; ++ unsigned max_brightness; + int r; + + if (argc != 3) { +@@ -294,6 +302,14 @@ int main(int argc, char *argv[]) { + return EXIT_FAILURE; + } + ++ /* If max_brightness is 0, then there is no actual backlight ++ * device. This happens on desktops with Asus mainboards ++ * that load the eeepc-wmi module. ++ */ ++ max_brightness = get_max_brightness(device); ++ if (max_brightness == 0) ++ return EXIT_SUCCESS; ++ + escaped_ss = cescape(ss); + if (!escaped_ss) { + log_oom(); +@@ -348,7 +364,7 @@ int main(int argc, char *argv[]) { + return EXIT_FAILURE; + } + +- clamp_brightness(device, &value); ++ clamp_brightness(device, &value, max_brightness); + + r = udev_device_set_sysattr_value(device, "brightness", value); + if (r < 0) { +-- +1.7.9.2 + diff --git a/0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch b/0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch new file mode 100644 index 00000000..fcf5f374 --- /dev/null +++ b/0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch @@ -0,0 +1,30 @@ +Based on e6c474723dc66cd4765fd09453d6b48bd5905ba4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 20 Apr 2014 13:57:26 -0400 +Subject: [PATCH] udev: warn when name_to_handle_at is not implemented + +We have a bunch of reports from people who have a custom kernel and +are confused why udev is not running. Issue a warning on +error. Barring an error in the code, the only error that is possible +is ENOSYS. + +https://bugzilla.redhat.com/show_bug.cgi?id=1072966 +--- + src/libudev/libudev-monitor.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- src/libudev/libudev-monitor.c ++++ src/libudev/libudev-monitor.c 2014-05-12 00:00:00.000000000 +0000 +@@ -115,8 +115,11 @@ static bool udev_has_devtmpfs(struct ude + int r; + + r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0); +- if (r < 0) ++ if (r < 0) { ++ if (errno != EOPNOTSUPP) ++ udev_err(udev, "name_to_handle_at on /dev: %m\n"); + return false; ++ } + + + f = fopen("/proc/self/mountinfo", "re"); diff --git a/0003-analyze-fix-plot-with-bad-y-size.patch b/0003-analyze-fix-plot-with-bad-y-size.patch new file mode 100644 index 00000000..07761449 --- /dev/null +++ b/0003-analyze-fix-plot-with-bad-y-size.patch @@ -0,0 +1,31 @@ +From a213b7e977221ca96bbc1b19a5a879c912ba2488 Mon Sep 17 00:00:00 2001 +From: Jeffrey Clark +Date: Wed, 23 Apr 2014 22:37:43 +0200 +Subject: [PATCH] analyze: fix plot with bad y size + +systemd-analyze plot > test.svg produces output with all y and height +element attributes equal to zero. This of course causes the resulting +svg to appear blank (zero height). Bug does not affect x86. Looks like +a compiler optimization may be the culprit. + +https://github.com/archlinuxarm/PKGBUILDs/issues/815 +--- + src/analyze/analyze.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/analyze/analyze.c src/analyze/analyze.c +index ba236d9..ebaa9d0 100644 +--- src/analyze/analyze.c ++++ src/analyze/analyze.c +@@ -43,7 +43,7 @@ + #include "pager.h" + + #define SCALE_X (0.1 / 1000.0) /* pixels per us */ +-#define SCALE_Y 20.0 ++#define SCALE_Y (20.0) + + #define compare(a, b) (((a) > (b))? 1 : (((b) > (a))? -1 : 0)) + +-- +1.7.9.2 + diff --git a/0003-backlight-unify-error-messages.patch b/0003-backlight-unify-error-messages.patch new file mode 100644 index 00000000..452de616 --- /dev/null +++ b/0003-backlight-unify-error-messages.patch @@ -0,0 +1,115 @@ +Based on 938d2699d2e818bd996614e89ea3d668200ad2a8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 7 Apr 2014 20:57:22 -0400 +Subject: [PATCH] backlight: unify error messages + +--- + src/backlight/backlight.c | 29 +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +--- src/backlight/backlight.c ++++ src/backlight/backlight.c 2014-05-12 13:31:50.502235843 +0000 +@@ -24,6 +24,7 @@ + #include "fileio.h" + #include "libudev.h" + #include "udev-util.h" ++#include "def.h" + + static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) { + struct udev_device *parent; +@@ -50,7 +51,7 @@ static struct udev_device *find_pci_or_p + if (!c) + return NULL; + +- c += strspn(c, "0123456789"); ++ c += strspn(c, DIGITS); + if (*c == '-') { + /* A connector DRM device, let's ignore all but LVDS and eDP! */ + +@@ -67,7 +68,8 @@ static struct udev_device *find_pci_or_p + unsigned long class = 0; + + if (safe_atolu(value, &class) < 0) { +- log_warning("Cannot parse PCI class %s of device %s:%s.", value, subsystem, sysname); ++ log_warning("Cannot parse PCI class %s of device %s:%s.", ++ value, subsystem, sysname); + return NULL; + } + +@@ -175,7 +177,9 @@ static bool validate_device(struct udev + if (same_device(parent, other_parent)) { + /* Both have the same PCI parent, that means + * we are out. */ +- log_debug("Skipping backlight device %s, since backlight device %s is on same PCI device and, takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other)); ++ log_debug("Skipping backlight device %s, since device %s is on same PCI device and takes precedence.", ++ udev_device_get_sysname(device), ++ udev_device_get_sysname(other)); + return false; + } + +@@ -184,7 +188,9 @@ static bool validate_device(struct udev + /* The other is connected to the platform bus + * and we are a PCI device, that also means we + * are out. */ +- log_debug("Skipping backlight device %s, since backlight device %s is a platform device and takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other)); ++ log_debug("Skipping backlight device %s, since device %s is a platform device and takes precedence.", ++ udev_device_get_sysname(device), ++ udev_device_get_sysname(other)); + return false; + } + } +@@ -199,13 +205,14 @@ static unsigned get_max_brightness(struc + + max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness"); + if (!max_brightness_str) { +- log_warning("Failed to read max_brightness attribute"); ++ log_warning("Failed to read 'max_brightness' attribute"); + return 0; + } + + r = safe_atou(max_brightness_str, &max_brightness); + if (r < 0) { +- log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r)); ++ log_warning("Failed to parse 'max_brightness' \"%s\": %s", ++ max_brightness_str, strerror(-r)); + return 0; + } + +@@ -262,7 +269,8 @@ int main(int argc, char *argv[]) { + + r = mkdir_p("/var/lib/systemd/backlight", 0755); + if (r < 0) { +- log_error("Failed to create backlight directory: %s", strerror(-r)); ++ log_error("Failed to create backlight directory /var/lib/systemd/backlight: %s", ++ strerror(-r)); + return EXIT_FAILURE; + } + +@@ -274,7 +282,7 @@ int main(int argc, char *argv[]) { + + sysname = strchr(argv[2], ':'); + if (!sysname) { +- log_error("Requires pair of subsystem and sysname for specifying backlight device."); ++ log_error("Requires a subsystem and sysname pair specifying a backlight device."); + return EXIT_FAILURE; + } + +@@ -368,7 +376,8 @@ int main(int argc, char *argv[]) { + + r = udev_device_set_sysattr_value(device, "brightness", value); + if (r < 0) { +- log_error("Failed to write system attribute: %s", strerror(-r)); ++ log_error("Failed to write system 'brightness' attribute: %s", ++ strerror(-r)); + return EXIT_FAILURE; + } + +@@ -382,7 +391,7 @@ int main(int argc, char *argv[]) { + + value = udev_device_get_sysattr_value(device, "brightness"); + if (!value) { +- log_error("Failed to read system attribute: %s", strerror(-r)); ++ log_error("Failed to read system 'brightness' attribute: %s", strerror(-r)); + return EXIT_FAILURE; + } + diff --git a/0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch b/0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch new file mode 100644 index 00000000..d0ec9ec8 --- /dev/null +++ b/0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch @@ -0,0 +1,40 @@ +From c7fdf44d08e1217d40dc092fb90a65978a0f541f Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 23 Apr 2014 06:55:54 +0200 +Subject: [PATCH] backlight: warn if kernel exposes backlight device with + bogus max_brightness + +We shouldn't silently tape over broken kernel drivers. +--- + src/backlight/backlight.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git src/backlight/backlight.c src/backlight/backlight.c +index 754a646..c708391 100644 +--- src/backlight/backlight.c ++++ src/backlight/backlight.c +@@ -205,14 +205,18 @@ static unsigned get_max_brightness(struct udev_device *device) { + + max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness"); + if (!max_brightness_str) { +- log_warning("Failed to read 'max_brightness' attribute"); ++ log_warning("Failed to read 'max_brightness' attribute."); + return 0; + } + + r = safe_atou(max_brightness_str, &max_brightness); + if (r < 0) { +- log_warning("Failed to parse 'max_brightness' \"%s\": %s", +- max_brightness_str, strerror(-r)); ++ log_warning("Failed to parse 'max_brightness' \"%s\": %s", max_brightness_str, strerror(-r)); ++ return 0; ++ } ++ ++ if (max_brightness <= 0) { ++ log_warning("Maximum brightness is 0, ignoring device."); + return 0; + } + +-- +1.7.9.2 + diff --git a/0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch b/0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch new file mode 100644 index 00000000..0358d8cc --- /dev/null +++ b/0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch @@ -0,0 +1,30 @@ +Based on 20a83d7bf4542875f8033b68682a4da4993010e8 Mon Sep 17 00:00:00 2001 +From: Brandon Philips +Date: Fri, 25 Apr 2014 09:31:59 -0600 +Subject: [PATCH] job: add waiting jobs to run queue in unit_coldplug + +When we have job installed and added to run queue for service which is +still in dead state and systemd initiates reload then after reload we +never add deserialized job to the run queue again. This is caused by +check in service_coldplug() where we check if deserialized state is +something else than dead state, which is not the case thus we never call +service_set_state() and finally unit_notify() where we would have added +job to the run queue. + +Thanks to Michal Sekletar for the original patch. +--- + src/core/job.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- src/core/job.c ++++ src/core/job.c 2014-05-12 12:58:30.354235531 +0000 +@@ -1057,6 +1057,9 @@ int job_coldplug(Job *j) { + if (j->timer_event_source) + j->timer_event_source = sd_event_source_unref(j->timer_event_source); + ++ if (j->state == JOB_WAITING) ++ job_add_to_run_queue(j); ++ + r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j); + if (r < 0) + log_debug("Failed to restart timeout for job: %s", strerror(-r)); diff --git a/0005-backlight-handle-saved-brightness-exceeding-max-brig.patch b/0005-backlight-handle-saved-brightness-exceeding-max-brig.patch new file mode 100644 index 00000000..bee5ed1a --- /dev/null +++ b/0005-backlight-handle-saved-brightness-exceeding-max-brig.patch @@ -0,0 +1,64 @@ +From 0c9d8f1d4b5018199cb5a9b57580dc1480a7f915 Mon Sep 17 00:00:00 2001 +From: Jani Nikula +Date: Wed, 7 May 2014 12:01:01 +0300 +Subject: [PATCH] backlight: handle saved brightness exceeding max brightness + +If too high a brightness value has been saved (e.g. due to kernel +mechanism changing from one kernel version to another, or booting the +userspace on another system), the brightness update fails and the +process exits. + +Clamp saved brightness between the policy minimum introduced in + +commit 7b909d7407965c03caaba30daae7aee113627a83 +Author: Josh Triplett +Date: Tue Mar 11 21:16:33 2014 -0700 + + backlight: Avoid restoring brightness to an unreadably dim level + +and the absolute maximum. + +https://bugs.freedesktop.org/show_bug.cgi?id=78200 +--- + src/backlight/backlight.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git src/backlight/backlight.c src/backlight/backlight.c +index c708391..691472c 100644 +--- src/backlight/backlight.c ++++ src/backlight/backlight.c +@@ -229,7 +229,7 @@ static unsigned get_max_brightness(struct udev_device *device) { + * would otherwise force the user to disable state restoration. */ + static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) { + int r; +- unsigned brightness, new_brightness; ++ unsigned brightness, new_brightness, min_brightness; + + r = safe_atou(*value, &brightness); + if (r < 0) { +@@ -237,7 +237,8 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned + return; + } + +- new_brightness = MAX3(brightness, 1U, max_brightness/20); ++ min_brightness = MAX(1U, max_brightness/20); ++ new_brightness = CLAMP(brightness, min_brightness, max_brightness); + if (new_brightness != brightness) { + char *old_value = *value; + +@@ -247,7 +248,11 @@ static void clamp_brightness(struct udev_device *device, char **value, unsigned + return; + } + +- log_debug("Saved brightness %s too low; increasing to %s.", old_value, *value); ++ log_info("Saved brightness %s %s to %s.", old_value, ++ new_brightness > brightness ? ++ "too low; increasing" : "too high; decreasing", ++ *value); ++ + free(old_value); + } + } +-- +1.7.9.2 + diff --git a/0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch b/0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch new file mode 100644 index 00000000..ea295af2 --- /dev/null +++ b/0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch @@ -0,0 +1,34 @@ +Based on 1727a595225132eb73ec134b6979d9c713b42e8c Mon Sep 17 00:00:00 2001 +From: Michael Marineau +Date: Mon, 12 May 2014 09:26:16 +0200 +Subject: [PATCH] job: always add waiting jobs to run queue during coldplug + +commit 20a83d7bf was not equivalent to the original bug fix proposed by +Michal Sekletar . The committed version only added +the job to the run queue if the job had a timeout, which most jobs do +not have. Just re-ordering the code gets us the intended functionality +--- + src/core/job.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- src/core/job.c ++++ src/core/job.c 2014-05-12 13:11:24.918735646 +0000 +@@ -1051,15 +1051,15 @@ int job_coldplug(Job *j) { + + assert(j); + ++ if (j->state == JOB_WAITING) ++ job_add_to_run_queue(j); ++ + if (j->begin_usec == 0 || j->unit->job_timeout == 0) + return 0; + + if (j->timer_event_source) + j->timer_event_source = sd_event_source_unref(j->timer_event_source); + +- if (j->state == JOB_WAITING) +- job_add_to_run_queue(j); +- + r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j); + if (r < 0) + log_debug("Failed to restart timeout for job: %s", strerror(-r)); diff --git a/log-target-null-instead-kmsg.patch b/log-target-null-instead-kmsg.patch new file mode 100644 index 00000000..f1d429b6 --- /dev/null +++ b/log-target-null-instead-kmsg.patch @@ -0,0 +1,114 @@ +--- + 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(-) + +--- systemd-210/src/journal/journald-kmsg.c ++++ systemd-210/src/journal/journald-kmsg.c 2014-05-09 07:35:02.880122386 +0000 +@@ -391,12 +391,26 @@ + return server_read_dev_kmsg(s); + } + ++static int parse_proc_cmdline_word(const char *word) { ++ int r; ++ ++ 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"); +--- systemd-210/src/libudev/libudev-util.c ++++ systemd-210/src/libudev/libudev-util.c 2014-05-09 07:35:28.304122530 +0000 +@@ -416,6 +416,15 @@ + return bits; + } + ++static int parse_proc_cmdline_word(const char *word) { ++ int r; ++ ++ 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 +433,12 @@ + 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; + +--- systemd-210/src/shared/log.c ++++ systemd-210/src/shared/log.c 2014-05-09 07:35:52.900122669 +0000 +@@ -92,12 +92,26 @@ + kmsg_fd = -1; + } + ++static int parse_proc_cmdline_word(const char *word) { ++ int r; ++ ++ 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; + +--- systemd-210/src/shared/util.c ++++ systemd-210/src/shared/util.c 2014-05-09 08:51:55.436148462 +0000 +@@ -5975,7 +5975,11 @@ + + 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; + } + } diff --git a/systemd-mini.changes b/systemd-mini.changes index 6dcf6d87..620b4e9a 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Tue May 13 08:28:05 UTC 2014 - werner@suse.de + +- Add patch log-target-null-instead-kmsg.patch from Thomas Blume + to enable the kernel developers to see a clean kmsg ring buffer + without any systemd/udev messages included (bnc#877021) + +------------------------------------------------------------------- +Mon May 12 13:35:25 UTC 2014 - werner@suse.de + +- Add upstram patches for backlight + 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch + 0002-backlight-do-nothing-if-max_brightness-is-0.patch + 0003-backlight-unify-error-messages.patch + 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch + 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch + +------------------------------------------------------------------- +Mon May 12 13:28:20 UTC 2014 - werner@suse.de + +- Add upstream patches + 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch + 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch + 0003-analyze-fix-plot-with-bad-y-size.patch + 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch + 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch + ------------------------------------------------------------------- Mon May 12 12:25:13 UTC 2014 - rmilasan@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 9bcf3f55..954150b4 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -407,6 +407,28 @@ Patch206: 0001-sd-rtnl-message-append-fix-uninitialized-memory.patch Patch207: 0001-tmpfiles-fix-permissions-on-new-journal-files.patch # PATCH-FIX-SUSE Do not ignores option 'noauto' in /etc/crypttab (bnc#742774) Patch208: parse-crypttab-for-noauto-option.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch209: 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch210: 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch211: 0003-analyze-fix-plot-with-bad-y-size.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch212: 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch213: 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch214: 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch215: 0002-backlight-do-nothing-if-max_brightness-is-0.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch216: 0003-backlight-unify-error-messages.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch217: 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch218: 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch +# PATCH-FIX-SUSE Do not poison kmsg ring buffer with systemd/udev messages (bnc#877021) +Patch219: log-target-null-instead-kmsg.patch # UDEV PATCHES # ============ @@ -800,6 +822,17 @@ cp %{SOURCE7} m4/ %patch206 -p0 %patch207 -p0 %patch208 -p1 +%patch209 -p0 +%patch210 -p0 +%patch211 -p0 +%patch212 -p0 +%patch213 -p0 +%patch214 -p0 +%patch215 -p0 +%patch216 -p0 +%patch217 -p0 +%patch218 -p0 +%patch219 -p1 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 6dcf6d87..620b4e9a 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Tue May 13 08:28:05 UTC 2014 - werner@suse.de + +- Add patch log-target-null-instead-kmsg.patch from Thomas Blume + to enable the kernel developers to see a clean kmsg ring buffer + without any systemd/udev messages included (bnc#877021) + +------------------------------------------------------------------- +Mon May 12 13:35:25 UTC 2014 - werner@suse.de + +- Add upstram patches for backlight + 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch + 0002-backlight-do-nothing-if-max_brightness-is-0.patch + 0003-backlight-unify-error-messages.patch + 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch + 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch + +------------------------------------------------------------------- +Mon May 12 13:28:20 UTC 2014 - werner@suse.de + +- Add upstream patches + 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch + 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch + 0003-analyze-fix-plot-with-bad-y-size.patch + 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch + 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch + ------------------------------------------------------------------- Mon May 12 12:25:13 UTC 2014 - rmilasan@suse.com diff --git a/systemd.spec b/systemd.spec index a97b5590..dc84387e 100644 --- a/systemd.spec +++ b/systemd.spec @@ -402,6 +402,28 @@ Patch206: 0001-sd-rtnl-message-append-fix-uninitialized-memory.patch Patch207: 0001-tmpfiles-fix-permissions-on-new-journal-files.patch # PATCH-FIX-SUSE Do not ignores option 'noauto' in /etc/crypttab (bnc#742774) Patch208: parse-crypttab-for-noauto-option.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch209: 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch210: 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch211: 0003-analyze-fix-plot-with-bad-y-size.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch212: 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch213: 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch214: 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch215: 0002-backlight-do-nothing-if-max_brightness-is-0.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch216: 0003-backlight-unify-error-messages.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch217: 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch +# PATCH-FIX-UPSTREAM added at 2014/05/12 +Patch218: 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch +# PATCH-FIX-SUSE Do not poison kmsg ring buffer with systemd/udev messages (bnc#877021) +Patch219: log-target-null-instead-kmsg.patch # UDEV PATCHES # ============ @@ -795,6 +817,17 @@ cp %{SOURCE7} m4/ %patch206 -p0 %patch207 -p0 %patch208 -p1 +%patch209 -p0 +%patch210 -p0 +%patch211 -p0 +%patch212 -p0 +%patch213 -p0 +%patch214 -p0 +%patch215 -p0 +%patch216 -p0 +%patch217 -p0 +%patch218 -p0 +%patch219 -p1 # udev patches %patch1001 -p1