diff --git a/0001-logind-ignore-lid-switch-if-more-than-1-display-is-c.patch b/0001-logind-ignore-lid-switch-if-more-than-1-display-is-c.patch new file mode 100644 index 00000000..382d4bf1 --- /dev/null +++ b/0001-logind-ignore-lid-switch-if-more-than-1-display-is-c.patch @@ -0,0 +1,168 @@ +From 6a79c58603ea816a1b4fa1520397b4e138bc1ca0 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 3 Mar 2014 19:30:16 +0100 +Subject: [PATCH] logind: ignore lid switch if more than 1 display is + connected + +Previously we expected the desktop environment to take an inhibitor +lock, but this opened a race on boot-up where logind might already be +running but no DE is active. + +Hence, let's move checking for additional displays into logind. This +also opens up this logic for other DEs, given that only GNOME +implemented the inhibitor logic so far. +--- + man/logind.conf.xml | 14 +++++++----- + src/login/logind-action.c | 8 +++++++ + src/login/logind-core.c | 55 +++++++++++++++++++++++++++++++++++++++++++-- + src/login/logind.h | 1 + + 4 files changed, 71 insertions(+), 7 deletions(-) + +diff --git man/logind.conf.xml man/logind.conf.xml +index 54cc379..7673201 100644 +--- man/logind.conf.xml ++++ man/logind.conf.xml +@@ -242,10 +242,10 @@ + ignore, logind will + never handle these keys. If + lock, all running +- sessions will be screen-locked; otherwise, +- the specified action +- will be taken in the respective +- event. Only input devices with the ++ sessions will be screen-locked; ++ otherwise, the specified action will ++ be taken in the respective event. Only ++ input devices with the + power-switch udev + tag will be watched for key/lid switch + events. HandlePowerKey= +@@ -257,7 +257,11 @@ + default to suspend. + HandleHibernateKey= + defaults to +- hibernate. ++ hibernate. Note ++ that the lid switch is ignored if the ++ system is inserted in a docking ++ station, or if more than one display ++ is connected. + + + +diff --git src/login/logind-action.c src/login/logind-action.c +index c04f210..da5a830 100644 +--- src/login/logind-action.c ++++ src/login/logind-action.c +@@ -72,10 +72,18 @@ int manager_handle_action( + + /* If we are docked don't react to lid closing */ + if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) { ++ int n; ++ + if (manager_is_docked(m)) { + log_debug("Ignoring lid switch request, system is docked."); + return 0; + } ++ ++ n = manager_count_displays(m); ++ if (n != 1) { ++ log_debug("Ignoring lid switch request, %s displays connected."); ++ return 0; ++ } + } + + /* If the key handling is inhibited, don't do anything */ +diff --git src/login/logind-core.c src/login/logind-core.c +index e4e593f..b8d03c3 100644 +--- src/login/logind-core.c ++++ src/login/logind-core.c +@@ -32,6 +32,7 @@ + #include "audit.h" + #include "bus-util.h" + #include "bus-error.h" ++#include "udev-util.h" + #include "logind.h" + + int manager_add_device(Manager *m, const char *sysfs, bool master, Device **_device) { +@@ -276,9 +277,11 @@ int manager_process_seat_device(Manager *m, struct udev_device *d) { + return 0; + } + +- /* ignore non-master devices for unknown seats */ ++ seat = hashmap_get(m->seats, sn); + master = udev_device_has_tag(d, "master-of-seat"); +- if (!master && !(seat = hashmap_get(m->seats, sn))) ++ ++ /* Ignore non-master devices for unknown seats */ ++ if (!master && !seat) + return 0; + + r = manager_add_device(m, udev_device_get_syspath(d), master, &device); +@@ -514,3 +517,51 @@ bool manager_is_docked(Manager *m) { + + return false; + } ++ ++int manager_count_displays(Manager *m) { ++ _cleanup_udev_enumerate_unref_ struct udev_enumerate *e = NULL; ++ struct udev_list_entry *item = NULL, *first = NULL; ++ int r; ++ int n = 0; ++ ++ e = udev_enumerate_new(m->udev); ++ if (!e) ++ return -ENOMEM; ++ ++ r = udev_enumerate_add_match_subsystem(e, "drm"); ++ if (r < 0) ++ return r; ++ ++ r = udev_enumerate_scan_devices(e); ++ if (r < 0) ++ return r; ++ ++ first = udev_enumerate_get_list_entry(e); ++ udev_list_entry_foreach(item, first) { ++ _cleanup_udev_device_unref_ struct udev_device *d = NULL; ++ struct udev_device *p; ++ const char *status; ++ ++ d = udev_device_new_from_syspath(m->udev, udev_list_entry_get_name(item)); ++ if (!d) ++ return -ENOMEM; ++ ++ p = udev_device_get_parent(d); ++ if (!p) ++ return -ENOMEM; ++ ++ /* If the parent shares the same subsystem as the ++ * device we are looking at then it is a connector, ++ * which is what we are interested in. */ ++ if (!streq_ptr(udev_device_get_subsystem(p), "drm")) ++ continue; ++ ++ /* We count any connector which is not explicitly ++ * "disconnected" as connected. */ ++ status = udev_device_get_sysattr_value(d, "status"); ++ if (!streq_ptr(status, "disconnected")) ++ n++; ++ } ++ ++ return n; ++} +diff --git src/login/logind.h src/login/logind.h +index 0344acc..74d6641 100644 +--- src/login/logind.h ++++ src/login/logind.h +@@ -149,6 +149,7 @@ int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); + int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); + + bool manager_is_docked(Manager *m); ++int manager_count_displays(Manager *m); + + extern const sd_bus_vtable manager_vtable[]; + +-- +1.7.9.2 + diff --git a/0002-logind-fix-printf-format.patch b/0002-logind-fix-printf-format.patch new file mode 100644 index 00000000..61bbc9aa --- /dev/null +++ b/0002-logind-fix-printf-format.patch @@ -0,0 +1,25 @@ +From 7e9110a29d90041b0364cb93a84aec9dd72363b6 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 3 Mar 2014 19:39:51 +0100 +Subject: [PATCH] logind: fix printf format + +--- + src/login/logind-action.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/login/logind-action.c src/login/logind-action.c +index da5a830..c9d8bc5 100644 +--- src/login/logind-action.c ++++ src/login/logind-action.c +@@ -81,7 +81,7 @@ int manager_handle_action( + + n = manager_count_displays(m); + if (n != 1) { +- log_debug("Ignoring lid switch request, %s displays connected."); ++ log_debug("Ignoring lid switch request, %i displays connected.", n); + return 0; + } + } +-- +1.7.9.2 + diff --git a/0003-logind-ignore-lid-switch-events-for-30s-after-each-s.patch b/0003-logind-ignore-lid-switch-events-for-30s-after-each-s.patch new file mode 100644 index 00000000..596702d6 --- /dev/null +++ b/0003-logind-ignore-lid-switch-events-for-30s-after-each-s.patch @@ -0,0 +1,174 @@ +From f9cd6be10ece07e10488c05e270a0b5860779864 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 3 Mar 2014 20:49:33 +0100 +Subject: [PATCH] logind: ignore lid switch events for 30s after each suspend + and 3min after startup + +This is needed to give USB docking stations and suchlike time to settle, +so that a display connected to an USB docking station can actually act +as a lid swith inhibitor correctly. + +With this change we should have somewhat reliable docking station +support in place. +--- + src/login/logind-action.c | 15 ++++++++++++++- + src/login/logind-dbus.c | 3 +++ + src/login/logind.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + src/login/logind.h | 7 +++++++ + 4 files changed, 69 insertions(+), 1 deletion(-) + +diff --git src/login/logind-action.c src/login/logind-action.c +index c9d8bc5..ae7b350 100644 +--- src/login/logind-action.c ++++ src/login/logind-action.c +@@ -70,20 +70,33 @@ int manager_handle_action( + return 0; + } + +- /* If we are docked don't react to lid closing */ + if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) { + int n; + ++ /* If we are docked don't react to lid closing */ + if (manager_is_docked(m)) { + log_debug("Ignoring lid switch request, system is docked."); + return 0; + } + ++ /* If we have more than one or no displays connected, ++ * don't react to lid closing. The no display case we ++ * treat like this under the assumption that there is ++ * no modern drm driver available. */ + n = manager_count_displays(m); + if (n != 1) { + log_debug("Ignoring lid switch request, %i displays connected.", n); + return 0; + } ++ ++ /* If the last system suspend or startup is too close, ++ * let's not suspend for now, to give USB docking ++ * stations some time to settle so that we can ++ * properly watch its displays. */ ++ if (m->lid_switch_ignore_event_source) { ++ log_debug("Ignoring lid switch request, system startup or resume too close."); ++ return 0; ++ } + } + + /* If the key handling is inhibited, don't do anything */ +diff --git src/login/logind-dbus.c src/login/logind-dbus.c +index fc89531..c9c58f3 100644 +--- src/login/logind-dbus.c ++++ src/login/logind-dbus.c +@@ -1337,6 +1337,9 @@ static int execute_shutdown_or_sleep( + m->action_job = c; + m->action_what = w; + ++ /* Make sure the lid switch is ignored for a while */ ++ manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + IGNORE_LID_SWITCH_SUSPEND_USEC); ++ + return 0; + } + +diff --git src/login/logind.c src/login/logind.c +index 10f61ab..fd113b3 100644 +--- src/login/logind.c ++++ src/login/logind.c +@@ -144,6 +144,7 @@ void manager_free(Manager *m) { + sd_event_source_unref(m->udev_device_event_source); + sd_event_source_unref(m->udev_vcsa_event_source); + sd_event_source_unref(m->udev_button_event_source); ++ sd_event_source_unref(m->lid_switch_ignore_event_source); + + if (m->console_active_fd >= 0) + close_nointr_nofail(m->console_active_fd); +@@ -959,6 +960,46 @@ static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us + return 0; + } + ++static int lid_switch_ignore_handler(sd_event_source *e, uint64_t usec, void *userdata) { ++ Manager *m = userdata; ++ ++ assert(e); ++ assert(m); ++ ++ m->lid_switch_ignore_event_source = sd_event_source_unref(m->lid_switch_ignore_event_source); ++ return 0; ++} ++ ++int manager_set_lid_switch_ignore(Manager *m, usec_t until) { ++ int r; ++ ++ assert(m); ++ ++ if (until <= now(CLOCK_MONOTONIC)) ++ return 0; ++ ++ /* We want to ignore the lid switch for a while after each ++ * suspend, and after boot-up. Hence let's install a timer for ++ * this. As long as the event source exists we ignore the lid ++ * switch. */ ++ ++ if (m->lid_switch_ignore_event_source) { ++ usec_t u; ++ ++ r = sd_event_source_get_time(m->lid_switch_ignore_event_source, &u); ++ if (r < 0) ++ return r; ++ ++ if (until <= u) ++ return 0; ++ ++ r = sd_event_source_set_time(m->lid_switch_ignore_event_source, until); ++ } else ++ r = sd_event_add_monotonic(m->event, &m->lid_switch_ignore_event_source, until, 0, lid_switch_ignore_handler, m); ++ ++ return r; ++} ++ + int manager_startup(Manager *m) { + int r; + Seat *seat; +@@ -994,6 +1035,10 @@ int manager_startup(Manager *m) { + return r; + } + ++ r = manager_set_lid_switch_ignore(m, 0 + IGNORE_LID_SWITCH_STARTUP_USEC); ++ if (r < 0) ++ log_warning("Failed to set up lid switch ignore event source: %s", strerror(-r)); ++ + /* Deserialize state */ + r = manager_enumerate_devices(m); + if (r < 0) +diff --git src/login/logind.h src/login/logind.h +index 74d6641..4bb8e7b 100644 +--- src/login/logind.h ++++ src/login/logind.h +@@ -42,6 +42,9 @@ typedef struct Manager Manager; + #include "logind-button.h" + #include "logind-action.h" + ++#define IGNORE_LID_SWITCH_STARTUP_USEC (3 * USEC_PER_MINUTE) ++#define IGNORE_LID_SWITCH_SUSPEND_USEC (30 * USEC_PER_SEC) ++ + struct Manager { + sd_event *event; + sd_bus *bus; +@@ -118,6 +121,8 @@ struct Manager { + bool lid_switch_ignore_inhibited; + + Hashmap *polkit_registry; ++ ++ sd_event_source *lid_switch_ignore_event_source; + }; + + Manager *manager_new(void); +@@ -178,3 +183,5 @@ const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned lengt + + int manager_watch_busname(Manager *manager, const char *name); + void manager_drop_busname(Manager *manager, const char *name); ++ ++int manager_set_lid_switch_ignore(Manager *m, usec_t until); +-- +1.7.9.2 + diff --git a/0004-logind-Do-not-fail-display-count-if-a-device-has-no-.patch b/0004-logind-Do-not-fail-display-count-if-a-device-has-no-.patch new file mode 100644 index 00000000..c19bfcee --- /dev/null +++ b/0004-logind-Do-not-fail-display-count-if-a-device-has-no-.patch @@ -0,0 +1,45 @@ +From 94036de887ad5b0dc805abe38b5c1c58b57d9465 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= +Date: Tue, 11 Mar 2014 17:49:00 +0200 +Subject: [PATCH] logind: Do not fail display count if a device has no parent + +udev_device_get_parent() may return NULL when the device doesn't have a +parent, as is the case with (for example) /sys/devices/virtual/drm/ttm. + +Also, log an actual error message instead of "-12 displays connected". +--- + src/login/logind-action.c | 4 +++- + src/login/logind-core.c | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git src/login/logind-action.c src/login/logind-action.c +index ae7b350..1928f43 100644 +--- src/login/logind-action.c ++++ src/login/logind-action.c +@@ -84,7 +84,9 @@ int manager_handle_action( + * treat like this under the assumption that there is + * no modern drm driver available. */ + n = manager_count_displays(m); +- if (n != 1) { ++ if (n < 0) ++ log_warning("Display counting failed: %s", strerror(-n)); ++ else if (n != 1) { + log_debug("Ignoring lid switch request, %i displays connected.", n); + return 0; + } +diff --git src/login/logind-core.c src/login/logind-core.c +index ca34d37..053d2ed 100644 +--- src/login/logind-core.c ++++ src/login/logind-core.c +@@ -520,7 +520,7 @@ int manager_count_displays(Manager *m) { + + p = udev_device_get_parent(d); + if (!p) +- return -ENOMEM; ++ continue; + + /* If the parent shares the same subsystem as the + * device we are looking at then it is a connector, +-- +1.7.9.2 + diff --git a/0005-logind-move-lid-switch-handling-from-logind-main-to-.patch b/0005-logind-move-lid-switch-handling-from-logind-main-to-.patch new file mode 100644 index 00000000..aaae9d12 --- /dev/null +++ b/0005-logind-move-lid-switch-handling-from-logind-main-to-.patch @@ -0,0 +1,119 @@ +From b5d3e1688133077ca20542a20dcd8919147e72e1 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 11 Mar 2014 22:38:54 +0100 +Subject: [PATCH] logind: move lid switch handling from logind-main to + logind-core + +../src/login/logind-dbus.c:1352: error: undefined reference to 'manager_set_lid_switch_ignore' +collect2: error: ld returned 1 exit status +make[2]: *** [test-login-tables] +--- + src/login/logind-dbus.c | 40 ++++++++++++++++++++++++++++++++++++++++ + src/login/logind.c | 40 ---------------------------------------- + 2 files changed, 40 insertions(+), 40 deletions(-) + +diff --git src/login/logind-dbus.c src/login/logind-dbus.c +index c5f9cb3..2ef87f7 100644 +--- src/login/logind-dbus.c ++++ src/login/logind-dbus.c +@@ -1305,6 +1305,46 @@ static int bus_manager_log_shutdown( + q, NULL); + } + ++static int lid_switch_ignore_handler(sd_event_source *e, uint64_t usec, void *userdata) { ++ Manager *m = userdata; ++ ++ assert(e); ++ assert(m); ++ ++ m->lid_switch_ignore_event_source = sd_event_source_unref(m->lid_switch_ignore_event_source); ++ return 0; ++} ++ ++int manager_set_lid_switch_ignore(Manager *m, usec_t until) { ++ int r; ++ ++ assert(m); ++ ++ if (until <= now(CLOCK_MONOTONIC)) ++ return 0; ++ ++ /* We want to ignore the lid switch for a while after each ++ * suspend, and after boot-up. Hence let's install a timer for ++ * this. As long as the event source exists we ignore the lid ++ * switch. */ ++ ++ if (m->lid_switch_ignore_event_source) { ++ usec_t u; ++ ++ r = sd_event_source_get_time(m->lid_switch_ignore_event_source, &u); ++ if (r < 0) ++ return r; ++ ++ if (until <= u) ++ return 0; ++ ++ r = sd_event_source_set_time(m->lid_switch_ignore_event_source, until); ++ } else ++ r = sd_event_add_monotonic(m->event, &m->lid_switch_ignore_event_source, until, 0, lid_switch_ignore_handler, m); ++ ++ return r; ++} ++ + static int execute_shutdown_or_sleep( + Manager *m, + InhibitWhat w, +diff --git src/login/logind.c src/login/logind.c +index 03b7753..2d734ff 100644 +--- src/login/logind.c ++++ src/login/logind.c +@@ -962,46 +962,6 @@ static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us + return 0; + } + +-static int lid_switch_ignore_handler(sd_event_source *e, uint64_t usec, void *userdata) { +- Manager *m = userdata; +- +- assert(e); +- assert(m); +- +- m->lid_switch_ignore_event_source = sd_event_source_unref(m->lid_switch_ignore_event_source); +- return 0; +-} +- +-int manager_set_lid_switch_ignore(Manager *m, usec_t until) { +- int r; +- +- assert(m); +- +- if (until <= now(CLOCK_MONOTONIC)) +- return 0; +- +- /* We want to ignore the lid switch for a while after each +- * suspend, and after boot-up. Hence let's install a timer for +- * this. As long as the event source exists we ignore the lid +- * switch. */ +- +- if (m->lid_switch_ignore_event_source) { +- usec_t u; +- +- r = sd_event_source_get_time(m->lid_switch_ignore_event_source, &u); +- if (r < 0) +- return r; +- +- if (until <= u) +- return 0; +- +- r = sd_event_source_set_time(m->lid_switch_ignore_event_source, until); +- } else +- r = sd_event_add_monotonic(m->event, &m->lid_switch_ignore_event_source, until, 0, lid_switch_ignore_handler, m); +- +- return r; +-} +- + int manager_startup(Manager *m) { + int r; + Seat *seat; +-- +1.7.9.2 + diff --git a/0006-man-clarify-that-the-ExecReload-command-should-be-sy.patch b/0006-man-clarify-that-the-ExecReload-command-should-be-sy.patch new file mode 100644 index 00000000..4313946b --- /dev/null +++ b/0006-man-clarify-that-the-ExecReload-command-should-be-sy.patch @@ -0,0 +1,39 @@ +From 33169701b0640d3629d4c36cf8c71dc26d2cb7e1 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 16 May 2014 01:33:22 +0200 +Subject: [PATCH] man: clarify that the ExecReload= command should be + synchronous + +http://lists.freedesktop.org/archives/systemd-devel/2014-May/019054.html +--- + man/systemd.service.xml | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git man/systemd.service.xml man/systemd.service.xml +index af32ccb..364ad7d 100644 +--- man/systemd.service.xml ++++ man/systemd.service.xml +@@ -519,6 +519,20 @@ ExecStart=/bin/echo $ONE $TWO ${TWO} + following: + + /bin/kill -HUP $MAINPID ++ ++ Note however that reloading a ++ daemon by sending a signal (as with ++ the example line above) is usually not ++ a good choice, because this is an ++ asynchronous operation and hence not ++ suitable to order reloads of multiple ++ services against each other. It is ++ strongly recommended to set ++ ExecReload= to a ++ command that no only triggers a ++ configuration reload of the daemon, ++ but also synchronously waits for it ++ complete. + + + +-- +1.7.9.2 + diff --git a/0007-man-readahead-fix-cmdline-switch-inconsistency-betwe.patch b/0007-man-readahead-fix-cmdline-switch-inconsistency-betwe.patch new file mode 100644 index 00000000..ee54ea31 --- /dev/null +++ b/0007-man-readahead-fix-cmdline-switch-inconsistency-betwe.patch @@ -0,0 +1,41 @@ +From 332bc31992acffc6f32e194c0122e01607bd0e27 Mon Sep 17 00:00:00 2001 +From: Alison Chaiken +Date: Fri, 16 May 2014 09:25:53 +0200 +Subject: [PATCH] man: readahead: fix cmdline switch inconsistency between + readahead.c and docs + +Source code has "files-max" and XML has --max-files. +--- + man/systemd-readahead-replay.service.xml | 2 +- + src/readahead/readahead.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git man/systemd-readahead-replay.service.xml man/systemd-readahead-replay.service.xml +index 67b41f5..669fe78 100644 +--- man/systemd-readahead-replay.service.xml ++++ man/systemd-readahead-replay.service.xml +@@ -117,7 +117,7 @@ + + + +- ++ + + Maximum number of + files to read ahead. Only valid +diff --git src/readahead/readahead.c src/readahead/readahead.c +index d6729ec..73cf538 100644 +--- src/readahead/readahead.c ++++ src/readahead/readahead.c +@@ -42,7 +42,7 @@ static int help(void) { + "Collect read-ahead data on early boot.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" +- " --max-files=INT Maximum number of files to read ahead\n" ++ " --files-max=INT Maximum number of files to read ahead\n" + " --file-size-max=BYTES Maximum size of files to read ahead\n" + " --timeout=USEC Maximum time to spend collecting data\n\n\n", + program_invocation_short_name); +-- +1.7.9.2 + diff --git a/0008-man-update-journald-rate-limit-defaults.patch b/0008-man-update-journald-rate-limit-defaults.patch new file mode 100644 index 00000000..54aad943 --- /dev/null +++ b/0008-man-update-journald-rate-limit-defaults.patch @@ -0,0 +1,28 @@ +From 8f18f550e7023948f199616fdfbb0f09711fd615 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= +Date: Wed, 30 Apr 2014 19:53:13 +0300 +Subject: [PATCH] man: update journald rate limit defaults + +This brings the man page back into sync with the actual code. +--- + man/journald.conf.xml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git man/journald.conf.xml man/journald.conf.xml +index 239a2ec..5cd09a2 100644 +--- man/journald.conf.xml ++++ man/journald.conf.xml +@@ -190,8 +190,8 @@ + limiting is applied per-service, so + that two services which log do not + interfere with each other's +- limits. Defaults to 200 messages in +- 10s. The time specification for ++ limits. Defaults to 1000 messages in ++ 30s. The time specification for + RateLimitInterval= + may be specified in the following + units: s, +-- +1.7.9.2 + diff --git a/0009-nspawn-properly-format-container_uuid-in-UUID-format.patch b/0009-nspawn-properly-format-container_uuid-in-UUID-format.patch new file mode 100644 index 00000000..a88af680 --- /dev/null +++ b/0009-nspawn-properly-format-container_uuid-in-UUID-format.patch @@ -0,0 +1,56 @@ +From 9f24adc288de142d6606fde3c5a5971613f3b6b9 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 16 May 2014 19:37:19 +0200 +Subject: [PATCH] nspawn: properly format container_uuid in UUID format + +http://lists.freedesktop.org/archives/systemd-devel/2014-April/018971.html +--- + src/nspawn/nspawn.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git src/nspawn/nspawn.c src/nspawn/nspawn.c +index 0bd52da..6be4dca 100644 +--- src/nspawn/nspawn.c ++++ src/nspawn/nspawn.c +@@ -769,6 +769,15 @@ static int setup_resolv_conf(const char *dest) { + return 0; + } + ++static char* id128_format_as_uuid(sd_id128_t id, char s[37]) { ++ ++ snprintf(s, 37, ++ "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", ++ SD_ID128_FORMAT_VAL(id)); ++ ++ return s; ++} ++ + static int setup_boot_id(const char *dest) { + _cleanup_free_ char *from = NULL, *to = NULL; + sd_id128_t rnd = {}; +@@ -794,10 +803,7 @@ static int setup_boot_id(const char *dest) { + return r; + } + +- snprintf(as_uuid, sizeof(as_uuid), +- "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", +- SD_ID128_FORMAT_VAL(rnd)); +- char_array_0(as_uuid); ++ id128_format_as_uuid(rnd, as_uuid); + + r = write_string_file(from, as_uuid); + if (r < 0) { +@@ -2954,7 +2960,9 @@ int main(int argc, char *argv[]) { + } + + if (!sd_id128_equal(arg_uuid, SD_ID128_NULL)) { +- if (asprintf((char**)(envp + n_env++), "container_uuid=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(arg_uuid)) < 0) { ++ char as_uuid[37]; ++ ++ if (asprintf((char**)(envp + n_env++), "container_uuid=%s", id128_format_as_uuid(arg_uuid, as_uuid)) < 0) { + log_oom(); + goto child_fail; + } +-- +1.7.9.2 + diff --git a/0010-logind-allow-suspending-if-there-are-no-displays.patch b/0010-logind-allow-suspending-if-there-are-no-displays.patch new file mode 100644 index 00000000..a12ff513 --- /dev/null +++ b/0010-logind-allow-suspending-if-there-are-no-displays.patch @@ -0,0 +1,42 @@ +From d36d90933a832bd1e1eb8e3d16b3de73f91636b4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= +Date: Mon, 28 Apr 2014 00:58:56 +0300 +Subject: [PATCH] logind: allow suspending if there are no displays + +With proprietary graphics drivers, there won't be any 'drm' devices in +sysfs, so logind will never suspend the system upon closing the lid, +even if only one (internal) display is connected. This has been reported +by multiple users so far. + +IMHO, it's better to suspend the system in this case for safety reasons, +to avoid having nvidia blob users' laptops overheat, for the same reason +that sleep inhibitors are overridden (LidSwitchIgnoreInhibited=yes). +--- + src/login/logind-action.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git src/login/logind-action.c src/login/logind-action.c +index ae9cd48..36ee441 100644 +--- src/login/logind-action.c ++++ src/login/logind-action.c +@@ -79,14 +79,12 @@ int manager_handle_action( + return 0; + } + +- /* If we have more than one or no displays connected, +- * don't react to lid closing. The no display case we +- * treat like this under the assumption that there is +- * no modern drm driver available. */ ++ /* If we have more than one display connected, ++ * don't react to lid closing. */ + n = manager_count_displays(m); + if (n < 0) + log_warning("Display counting failed: %s", strerror(-n)); +- else if (n != 1) { ++ else if (n > 1) { + log_debug("Ignoring lid switch request, %i displays connected.", n); + return 0; + } +-- +1.7.9.2 + diff --git a/systemd-mini.changes b/systemd-mini.changes index 6eea7ee7..61eeda7a 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 19 13:21:18 UTC 2014 - werner@suse.de + +- Add upstream patches mainly for better lid handling + ------------------------------------------------------------------- Fri May 16 12:00:12 UTC 2014 - werner@suse.de @@ -7,7 +12,7 @@ Fri May 16 12:00:12 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Fri May 16 11:47:06 UTC 2014 - werner@suse.de -- Add upstram patches +- Add upstream patches 0001-core-close-socket-fds-asynchronously.patch 0002-logind-bring-polkit-policy-for-hibernate-in-line-wit.patch 0003-core-make-sure-to-serialize-jobs-for-all-units.patch @@ -15,7 +20,7 @@ Fri May 16 11:47:06 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Wed May 14 07:37:08 UTC 2014 - werner@suse.de -- Add upstram patches +- Add upstream patches 0001-replace-more-dup-by-F_DUPFD_CLOEXEC.patch 0002-pam_systemd-use-F_DUPFD_CLOEXEC-when-dupping-session.patch to avoid that in pam session unwanted file descriptors are inherited @@ -30,7 +35,7 @@ Tue May 13 08:28:05 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Mon May 12 13:35:25 UTC 2014 - werner@suse.de -- Add upstram patches for backlight +- Add upstream 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 @@ -103,7 +108,7 @@ Wed Apr 30 10:55:54 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Mon Apr 28 09:51:35 UTC 2014 - werner@suse.de -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-bash-completion-fix-__get_startable_units.patch 0002-sysctl-replaces-some-slashes-with-dots.patch 0003-delta-do-not-use-unicode-chars-in-C-locale.patch @@ -188,7 +193,7 @@ Tue Apr 8 07:27:49 UTC 2014 - werner@suse.de - Add patch portmap-wants-rpcbind-socket.patch to make sure that rpcbind socket as well as service is up with the target -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-journal-fix-export-of-messages-containing-newlines.patch 0002-systemctl-update-NAME-to-PATTERN-in-help.patch 0003-tty-ask-password-agent-return-negative-errno.patch @@ -198,7 +203,7 @@ Tue Apr 8 07:27:49 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Fri Mar 28 12:53:21 UTC 2014 - werner@suse.de -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch 0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch 0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch @@ -261,7 +266,7 @@ Tue Mar 18 13:23:43 UTC 2014 - werner@suse.de - Add Robert's udev-generate-peristent-rule shell script to udev's tool library -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch 0006-Do-not-return-1-EINVAL-on-allocation-error.patch diff --git a/systemd-mini.spec b/systemd-mini.spec index af3e53e2..fc9d45e9 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -439,6 +439,26 @@ Patch222: 0001-core-close-socket-fds-asynchronously.patch Patch223: 0002-logind-bring-polkit-policy-for-hibernate-in-line-wit.patch # PATCH-FIX-UPSTREAM added at 2014/05/16 Patch224: 0003-core-make-sure-to-serialize-jobs-for-all-units.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch225: 0001-logind-ignore-lid-switch-if-more-than-1-display-is-c.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch226: 0002-logind-fix-printf-format.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch227: 0003-logind-ignore-lid-switch-events-for-30s-after-each-s.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch228: 0004-logind-Do-not-fail-display-count-if-a-device-has-no-.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch229: 0005-logind-move-lid-switch-handling-from-logind-main-to-.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch230: 0006-man-clarify-that-the-ExecReload-command-should-be-sy.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch231: 0007-man-readahead-fix-cmdline-switch-inconsistency-betwe.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch232: 0008-man-update-journald-rate-limit-defaults.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch233: 0009-nspawn-properly-format-container_uuid-in-UUID-format.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch234: 0010-logind-allow-suspending-if-there-are-no-displays.patch # UDEV PATCHES # ============ @@ -848,6 +868,16 @@ cp %{SOURCE7} m4/ %patch222 -p0 %patch223 -p0 %patch224 -p0 +%patch225 -p0 +%patch226 -p0 +%patch227 -p0 +%patch228 -p0 +%patch229 -p0 +%patch230 -p0 +%patch231 -p0 +%patch232 -p0 +%patch233 -p0 +%patch234 -p0 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 6eea7ee7..61eeda7a 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 19 13:21:18 UTC 2014 - werner@suse.de + +- Add upstream patches mainly for better lid handling + ------------------------------------------------------------------- Fri May 16 12:00:12 UTC 2014 - werner@suse.de @@ -7,7 +12,7 @@ Fri May 16 12:00:12 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Fri May 16 11:47:06 UTC 2014 - werner@suse.de -- Add upstram patches +- Add upstream patches 0001-core-close-socket-fds-asynchronously.patch 0002-logind-bring-polkit-policy-for-hibernate-in-line-wit.patch 0003-core-make-sure-to-serialize-jobs-for-all-units.patch @@ -15,7 +20,7 @@ Fri May 16 11:47:06 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Wed May 14 07:37:08 UTC 2014 - werner@suse.de -- Add upstram patches +- Add upstream patches 0001-replace-more-dup-by-F_DUPFD_CLOEXEC.patch 0002-pam_systemd-use-F_DUPFD_CLOEXEC-when-dupping-session.patch to avoid that in pam session unwanted file descriptors are inherited @@ -30,7 +35,7 @@ Tue May 13 08:28:05 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Mon May 12 13:35:25 UTC 2014 - werner@suse.de -- Add upstram patches for backlight +- Add upstream 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 @@ -103,7 +108,7 @@ Wed Apr 30 10:55:54 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Mon Apr 28 09:51:35 UTC 2014 - werner@suse.de -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-bash-completion-fix-__get_startable_units.patch 0002-sysctl-replaces-some-slashes-with-dots.patch 0003-delta-do-not-use-unicode-chars-in-C-locale.patch @@ -188,7 +193,7 @@ Tue Apr 8 07:27:49 UTC 2014 - werner@suse.de - Add patch portmap-wants-rpcbind-socket.patch to make sure that rpcbind socket as well as service is up with the target -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-journal-fix-export-of-messages-containing-newlines.patch 0002-systemctl-update-NAME-to-PATTERN-in-help.patch 0003-tty-ask-password-agent-return-negative-errno.patch @@ -198,7 +203,7 @@ Tue Apr 8 07:27:49 UTC 2014 - werner@suse.de ------------------------------------------------------------------- Fri Mar 28 12:53:21 UTC 2014 - werner@suse.de -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch 0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch 0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch @@ -261,7 +266,7 @@ Tue Mar 18 13:23:43 UTC 2014 - werner@suse.de - Add Robert's udev-generate-peristent-rule shell script to udev's tool library -- Add or port upstram bugfix patches: +- Add or port upstream bugfix patches: 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch 0006-Do-not-return-1-EINVAL-on-allocation-error.patch diff --git a/systemd.spec b/systemd.spec index 27df9a98..4278568c 100644 --- a/systemd.spec +++ b/systemd.spec @@ -434,6 +434,26 @@ Patch222: 0001-core-close-socket-fds-asynchronously.patch Patch223: 0002-logind-bring-polkit-policy-for-hibernate-in-line-wit.patch # PATCH-FIX-UPSTREAM added at 2014/05/16 Patch224: 0003-core-make-sure-to-serialize-jobs-for-all-units.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch225: 0001-logind-ignore-lid-switch-if-more-than-1-display-is-c.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch226: 0002-logind-fix-printf-format.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch227: 0003-logind-ignore-lid-switch-events-for-30s-after-each-s.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch228: 0004-logind-Do-not-fail-display-count-if-a-device-has-no-.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch229: 0005-logind-move-lid-switch-handling-from-logind-main-to-.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch230: 0006-man-clarify-that-the-ExecReload-command-should-be-sy.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch231: 0007-man-readahead-fix-cmdline-switch-inconsistency-betwe.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch232: 0008-man-update-journald-rate-limit-defaults.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch233: 0009-nspawn-properly-format-container_uuid-in-UUID-format.patch +# PATCH-FIX-UPSTREAM added at 2014/05/19 +Patch234: 0010-logind-allow-suspending-if-there-are-no-displays.patch # UDEV PATCHES # ============ @@ -843,6 +863,16 @@ cp %{SOURCE7} m4/ %patch222 -p0 %patch223 -p0 %patch224 -p0 +%patch225 -p0 +%patch226 -p0 +%patch227 -p0 +%patch228 -p0 +%patch229 -p0 +%patch230 -p0 +%patch231 -p0 +%patch232 -p0 +%patch233 -p0 +%patch234 -p0 # udev patches %patch1001 -p1