From 29c1e49ffc9148d21e2aff18118303fe827287cca10c95745a17fc96d7e4cc3e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 12:11:12 +0000 Subject: [PATCH 01/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=565 --- ...or-don-t-return-OOM-on-parentless-de.patch | 20 + ...emory-leak-when-kdbus-is-not-enabled.patch | 26 ++ ...k-for-a-64bit-value-when-we-only-hav.patch | 181 ++++++++ ...-return-1-EINVAL-on-allocation-error.patch | 35 ++ 0007-networkd-fix-typo.patch | 26 ++ ...ess-invalid-memory-if-a-signal-match.patch | 27 ++ ...ke-if-somebody-sends-us-a-message-wi.patch | 47 ++ ...nstall-_sd_machines-with-_machinectl.patch | 28 ++ ...ve-stray-reset-of-error-return-value.patch | 24 ++ ...systemd-timedate-udev-spelling-fixes.patch | 118 +++++ systemctl-set-default-target.patch | 28 ++ systemd-mini.changes | 28 +- systemd-mini.spec | 30 ++ systemd.changes | 28 +- systemd.spec | 30 ++ udev-generate-peristent-rule.sh | 405 ++++++++++++++++++ 16 files changed, 1079 insertions(+), 2 deletions(-) create mode 100644 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch create mode 100644 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch create mode 100644 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch create mode 100644 0006-Do-not-return-1-EINVAL-on-allocation-error.patch create mode 100644 0007-networkd-fix-typo.patch create mode 100644 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch create mode 100644 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch create mode 100644 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch create mode 100644 0012-journald-remove-stray-reset-of-error-return-value.patch create mode 100644 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch create mode 100644 systemctl-set-default-target.patch create mode 100644 udev-generate-peristent-rule.sh diff --git a/0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch b/0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch new file mode 100644 index 0000000..be9add4 --- /dev/null +++ b/0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch @@ -0,0 +1,20 @@ +From 9c4495ca561624c2f0085507dd1288ed5f1247c5 Mon Sep 17 00:00:00 2001 +From: Tomasz Torcz +Date: Wed, 12 Mar 2014 19:25:11 +0100 +Subject: [PATCH] gpt-auto-generator: don't return OOM on parentless devices + +--- + src/gpt-auto-generator/gpt-auto-generator.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- src/gpt-auto-generator/gpt-auto-generator.c ++++ src/gpt-auto-generator/gpt-auto-generator.c 2014-03-18 13:35:11.438235125 +0000 +@@ -254,7 +254,7 @@ static int enumerate_partitions(struct u + + parent = udev_device_get_parent(d); + if (!parent) +- return log_oom(); ++ return 0; + + r = udev_enumerate_add_match_parent(e, parent); + if (r < 0) diff --git a/0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch b/0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch new file mode 100644 index 0000000..718f686 --- /dev/null +++ b/0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch @@ -0,0 +1,26 @@ +From 82923adfe5c4fa09cc91fd2a2e374c936cd4a186 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Thu, 13 Mar 2014 20:00:50 +0100 +Subject: [PATCH] bus: fix memory leak when kdbus is not enabled + +--- + src/libsystemd/sd-bus/sd-bus.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git src/libsystemd/sd-bus/sd-bus.c src/libsystemd/sd-bus/sd-bus.c +index ffa3369..ca7c428 100644 +--- src/libsystemd/sd-bus/sd-bus.c ++++ src/libsystemd/sd-bus/sd-bus.c +@@ -1189,7 +1189,8 @@ _public_ int sd_bus_open_user(sd_bus **ret) { + #ifdef ENABLE_KDBUS + asprintf(&b->address, KERNEL_USER_BUS_FMT, (unsigned long) getuid()); + #else +- return -ECONNREFUSED; ++ r = -ECONNREFUSED; ++ goto fail; + #endif + } + +-- +1.7.9.2 + diff --git a/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch b/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch new file mode 100644 index 0000000..456de40 --- /dev/null +++ b/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch @@ -0,0 +1,181 @@ +From 42c4ebcbd4cbd7b27667eb8081ee4dc46f9ece17 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Thu, 13 Mar 2014 20:33:22 +0100 +Subject: [PATCH] sd-bus: don't look for a 64bit value when we only have 32bit + value on reply cookie hash table access + +This broke hashtable lookups for the message cookies on s390x, which is +a 64bit BE machine where accessing 32bit values as 64bit and vice versa +will explode. + +Also, while we are at it, be a bit more careful when dealing with the +64bit cookies we expose and the 32bit serial numbers dbus uses in its +payload. + +Problem identified by Fridrich Strba. +--- + src/libsystemd/sd-bus/bus-dump.c | 4 ++-- + src/libsystemd/sd-bus/bus-kernel.c | 2 +- + src/libsystemd/sd-bus/bus-message.c | 15 ++++++++++----- + src/libsystemd/sd-bus/bus-message.h | 5 +++-- + src/libsystemd/sd-bus/sd-bus.c | 12 ++++++------ + 5 files changed, 22 insertions(+), 16 deletions(-) + +diff --git src/libsystemd/sd-bus/bus-dump.c src/libsystemd/sd-bus/bus-dump.c +index 0e41549..ea81644 100644 +--- src/libsystemd/sd-bus/bus-dump.c ++++ src/libsystemd/sd-bus/bus-dump.c +@@ -69,10 +69,10 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) { + if (BUS_MESSAGE_COOKIE(m) == 0xFFFFFFFFULL) + fprintf(f, " Cookie=-1"); + else +- fprintf(f, " Cookie=%lu", (unsigned long) BUS_MESSAGE_COOKIE(m)); ++ fprintf(f, " Cookie=%" PRIu64, BUS_MESSAGE_COOKIE(m)); + + if (m->reply_cookie != 0) +- fprintf(f, " ReplyCookie=%lu", (unsigned long) m->reply_cookie); ++ fprintf(f, " ReplyCookie=%" PRIu64, m->reply_cookie); + + fputs("\n", f); + +diff --git src/libsystemd/sd-bus/bus-kernel.c src/libsystemd/sd-bus/bus-kernel.c +index 8a2ca02..80ef15b 100644 +--- src/libsystemd/sd-bus/bus-kernel.c ++++ src/libsystemd/sd-bus/bus-kernel.c +@@ -266,7 +266,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { + well_known ? 0 : + m->destination ? unique : KDBUS_DST_ID_BROADCAST; + m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS; +- m->kdbus->cookie = m->header->serial; ++ m->kdbus->cookie = (uint64_t) m->header->serial; + m->kdbus->priority = m->priority; + + if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) +diff --git src/libsystemd/sd-bus/bus-message.c src/libsystemd/sd-bus/bus-message.c +index fb894ef..97ab0e3 100644 +--- src/libsystemd/sd-bus/bus-message.c ++++ src/libsystemd/sd-bus/bus-message.c +@@ -617,7 +617,7 @@ static int message_new_reply( + t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; + t->reply_cookie = BUS_MESSAGE_COOKIE(call); + +- r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, t->reply_cookie); ++ r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); + if (r < 0) + goto fail; + +@@ -752,7 +752,7 @@ int bus_message_new_synthetic_error( + t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; + t->reply_cookie = cookie; + +- r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, t->reply_cookie); ++ r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); + if (r < 0) + goto fail; + +@@ -5075,21 +5075,26 @@ int bus_message_parse_fields(sd_bus_message *m) { + break; + } + +- case BUS_MESSAGE_HEADER_REPLY_SERIAL: ++ case BUS_MESSAGE_HEADER_REPLY_SERIAL: { ++ uint32_t serial; ++ + if (m->reply_cookie != 0) + return -EBADMSG; + + if (!streq(signature, "u")) + return -EBADMSG; + +- r = message_peek_field_uint32(m, &ri, item_size, &m->reply_cookie); ++ r = message_peek_field_uint32(m, &ri, item_size, &serial); + if (r < 0) + return r; + ++ m->reply_cookie = serial; ++ + if (m->reply_cookie == 0) + return -EBADMSG; + + break; ++ } + + case BUS_MESSAGE_HEADER_UNIX_FDS: + if (unix_fds != 0) +@@ -5489,7 +5494,7 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) { + return -ENOMEM; + + n->reply_cookie = (*m)->reply_cookie; +- r = message_append_field_uint32(n, BUS_MESSAGE_HEADER_REPLY_SERIAL, n->reply_cookie); ++ r = message_append_field_uint32(n, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) n->reply_cookie); + if (r < 0) + return r; + +diff --git src/libsystemd/sd-bus/bus-message.h src/libsystemd/sd-bus/bus-message.h +index 5fbe3e6..df79294 100644 +--- src/libsystemd/sd-bus/bus-message.h ++++ src/libsystemd/sd-bus/bus-message.h +@@ -84,7 +84,7 @@ struct sd_bus_message { + + sd_bus *bus; + +- uint32_t reply_cookie; ++ uint64_t reply_cookie; + + const char *path; + const char *interface; +@@ -162,7 +162,8 @@ static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) { + return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u; + } + +-static inline uint32_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { ++static inline uint64_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { ++ /* Note that we return the serial converted to a 64bit value here */ + return BUS_MESSAGE_BSWAP32(m, m->header->serial); + } + +diff --git src/libsystemd/sd-bus/sd-bus.c src/libsystemd/sd-bus/sd-bus.c +index ca7c428..8e44e50 100644 +--- src/libsystemd/sd-bus/sd-bus.c ++++ src/libsystemd/sd-bus/sd-bus.c +@@ -1486,15 +1486,15 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call + return r; + + if (bus->is_kernel || *idx >= BUS_MESSAGE_SIZE(m)) +- log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", ++ log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", + bus_message_type_to_string(m->header->type), + strna(sd_bus_message_get_sender(m)), + strna(sd_bus_message_get_destination(m)), + strna(sd_bus_message_get_path(m)), + strna(sd_bus_message_get_interface(m)), + strna(sd_bus_message_get_member(m)), +- (unsigned long) BUS_MESSAGE_COOKIE(m), +- (unsigned long) m->reply_cookie, ++ BUS_MESSAGE_COOKIE(m), ++ m->reply_cookie, + strna(m->error.message)); + + return r; +@@ -2253,15 +2253,15 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { + bus->current = m; + bus->iteration_counter++; + +- log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", ++ log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", + bus_message_type_to_string(m->header->type), + strna(sd_bus_message_get_sender(m)), + strna(sd_bus_message_get_destination(m)), + strna(sd_bus_message_get_path(m)), + strna(sd_bus_message_get_interface(m)), + strna(sd_bus_message_get_member(m)), +- (unsigned long) BUS_MESSAGE_COOKIE(m), +- (unsigned long) m->reply_cookie, ++ BUS_MESSAGE_COOKIE(m), ++ m->reply_cookie, + strna(m->error.message)); + + r = process_hello(bus, m); +-- +1.7.9.2 + diff --git a/0006-Do-not-return-1-EINVAL-on-allocation-error.patch b/0006-Do-not-return-1-EINVAL-on-allocation-error.patch new file mode 100644 index 0000000..bf1db2c --- /dev/null +++ b/0006-Do-not-return-1-EINVAL-on-allocation-error.patch @@ -0,0 +1,35 @@ +From 315db1a8aed226a51a4cf700172249cfd10ae115 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 14 Mar 2014 09:05:56 -0400 +Subject: [PATCH] Do not return -1 (EINVAL) on allocation error + +--- + src/core/socket.c | 8 +++----- + +diff --git src/core/socket.c src/core/socket.c +index 8ecc9f9..b39bec2 100644 +--- src/core/socket.c ++++ src/core/socket.c +@@ -198,16 +198,14 @@ static int socket_instantiate_service(Socket *s) { + + assert(s->accept); + +- if (!(prefix = unit_name_to_prefix(UNIT(s)->id))) ++ prefix = unit_name_to_prefix(UNIT(s)->id); ++ if (!prefix) + return -ENOMEM; + +- r = asprintf(&name, "%s@%u.service", prefix, s->n_accepted); +- +- if (r < 0) ++ if (asprintf(&name, "%s@%u.service", prefix, s->n_accepted) < 0) + return -ENOMEM; + + r = manager_load_unit(UNIT(s)->manager, name, NULL, NULL, &u); +- + if (r < 0) + return r; + +-- +1.7.9.2 + diff --git a/0007-networkd-fix-typo.patch b/0007-networkd-fix-typo.patch new file mode 100644 index 0000000..8bd6732 --- /dev/null +++ b/0007-networkd-fix-typo.patch @@ -0,0 +1,26 @@ +From eed0eee85ac34abd81cd9e81fdb6a19f47b6c8a3 Mon Sep 17 00:00:00 2001 +From: Michael Olbrich +Date: Fri, 14 Mar 2014 18:19:29 +0100 +Subject: [PATCH] networkd: fix typo + +It's HAVE_SPLIT_USR not HAVE_SPLIT_USER +--- + src/network/networkd-manager.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/network/networkd-manager.c src/network/networkd-manager.c +index c730e71..ea414b1 100644 +--- src/network/networkd-manager.c ++++ src/network/networkd-manager.c +@@ -33,7 +33,7 @@ const char* const network_dirs[] = { + "/etc/systemd/network", + "/run/systemd/network", + "/usr/lib/systemd/network", +-#ifdef HAVE_SPLIT_USER ++#ifdef HAVE_SPLIT_USR + "/lib/systemd/network", + #endif + NULL}; +-- +1.7.9.2 + diff --git a/0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch b/0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch new file mode 100644 index 0000000..d2eac44 --- /dev/null +++ b/0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch @@ -0,0 +1,27 @@ +From bbb6ff0216a7c081a2e63e01b1f121592b0165bb Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 14 Mar 2014 21:12:36 +0100 +Subject: [PATCH] sd-bus: don't access invalid memory if a signal matcher was + freed from its own callback + +--- + src/libsystemd/sd-bus/bus-match.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git src/libsystemd/sd-bus/bus-match.c src/libsystemd/sd-bus/bus-match.c +index 8280488..c54ca8d 100644 +--- src/libsystemd/sd-bus/bus-match.c ++++ src/libsystemd/sd-bus/bus-match.c +@@ -293,6 +293,9 @@ int bus_match_run( + r = bus_maybe_reply_error(m, r, &error_buffer); + if (r != 0) + return r; ++ ++ if (bus && bus->match_callbacks_modified) ++ return 0; + } + + return bus_match_run(bus, node->next, m); +-- +1.7.9.2 + diff --git a/0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch b/0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch new file mode 100644 index 0000000..f9e9369 --- /dev/null +++ b/0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch @@ -0,0 +1,47 @@ +From 5a4d665ad679a8436f1210ba67d713a8f0b91b96 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Fri, 14 Mar 2014 21:15:32 +0100 +Subject: [PATCH] sd-bus: don't choke if somebody sends us a message with a + unix fd count of 0 + +It's kinda pointless to include a unix fd header field in messages if it +carries the value 0, but let's do this anyway... +--- + src/libsystemd/sd-bus/bus-message.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git src/libsystemd/sd-bus/bus-message.c src/libsystemd/sd-bus/bus-message.c +index 97ab0e3..b9d7f6d 100644 +--- src/libsystemd/sd-bus/bus-message.c ++++ src/libsystemd/sd-bus/bus-message.c +@@ -4885,6 +4885,7 @@ int bus_message_parse_fields(sd_bus_message *m) { + size_t ri; + int r; + uint32_t unix_fds = 0; ++ bool unix_fds_set = false; + void *offsets = NULL; + unsigned n_offsets = 0; + size_t sz = 0; +@@ -5097,7 +5098,7 @@ int bus_message_parse_fields(sd_bus_message *m) { + } + + case BUS_MESSAGE_HEADER_UNIX_FDS: +- if (unix_fds != 0) ++ if (unix_fds_set) + return -EBADMSG; + + if (!streq(signature, "u")) +@@ -5107,9 +5108,7 @@ int bus_message_parse_fields(sd_bus_message *m) { + if (r < 0) + return -EBADMSG; + +- if (unix_fds == 0) +- return -EBADMSG; +- ++ unix_fds_set = true; + break; + + default: +-- +1.7.9.2 + diff --git a/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch b/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch new file mode 100644 index 0000000..9093b00 --- /dev/null +++ b/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch @@ -0,0 +1,28 @@ +From d895500c478c6ad7904905bb4c08176d5a6c0763 Mon Sep 17 00:00:00 2001 +From: Wieland Hoffmann +Date: Mon, 10 Mar 2014 15:17:31 +0100 +Subject: [PATCH] zsh completion: Install _sd_machines with _machinectl + +_machinectl uses _sd_machines to provide a list of all available +machines. +--- + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git Makefile.am Makefile.am +index 60cb991..9e01cd5 100644 +--- Makefile.am ++++ Makefile.am +@@ -4067,7 +4067,8 @@ dist_dbuspolicy_DATA += \ + src/machine/org.freedesktop.machine1.conf + + dist_zshcompletion_DATA += \ +- shell-completion/zsh/_machinectl ++ shell-completion/zsh/_machinectl \ ++ shell-completion/zsh/_sd_machines + + SYSTEM_UNIT_ALIASES += \ + systemd-machined.service dbus-org.freedesktop.machine1.service +-- +1.7.9.2 + diff --git a/0012-journald-remove-stray-reset-of-error-return-value.patch b/0012-journald-remove-stray-reset-of-error-return-value.patch new file mode 100644 index 0000000..f15237f --- /dev/null +++ b/0012-journald-remove-stray-reset-of-error-return-value.patch @@ -0,0 +1,24 @@ +From 2fc74bf4336eb7a7e40c0b355d19966cd97d4b3c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 10 Mar 2014 21:19:23 -0400 +Subject: [PATCH] journald: remove stray reset of error return value + +--- + src/journal/journald.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git src/journal/journald.c src/journal/journald.c +index 37896d0..c8c0801 100644 +--- src/journal/journald.c ++++ src/journal/journald.c +@@ -110,7 +110,6 @@ int main(int argc, char *argv[]) { + r = sd_event_run(server.event, t); + if (r < 0) { + log_error("Failed to run event loop: %s", strerror(-r)); +- r = -errno; + goto finish; + } + +-- +1.7.9.2 + diff --git a/0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch b/0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch new file mode 100644 index 0000000..0343c2a --- /dev/null +++ b/0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch @@ -0,0 +1,118 @@ +From 6f285378aa6e4b5b23c939d1fea16f9ab0a57efb Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Fri, 14 Mar 2014 21:13:38 +0100 +Subject: [PATCH] core, libsystemd, systemd, timedate, udev: spelling fixes + +--- + src/core/service.c | 2 +- + src/core/unit.c | 2 +- + src/libsystemd/sd-bus/bus-message.c | 2 +- + src/libsystemd/sd-bus/sd-bus.c | 4 ++-- + src/systemd/sd-resolve.h | 2 +- + src/timedate/timedated.c | 2 +- + src/udev/udevadm-settle.c | 2 +- + 7 files changed, 8 insertions(+), 8 deletions(-) + +diff --git src/core/service.c src/core/service.c +index 41b95ab..386692a 100644 +--- src/core/service.c ++++ src/core/service.c +@@ -3416,7 +3416,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { + free(t); + } + +- /* Interpet WATCHDOG= */ ++ /* Interpret WATCHDOG= */ + if (strv_find(tags, "WATCHDOG=1")) { + log_debug_unit(u->id, "%s: got WATCHDOG=1", u->id); + service_reset_watchdog(s); +diff --git src/core/unit.c src/core/unit.c +index 5c98843..4fb0d9c 100644 +--- src/core/unit.c ++++ src/core/unit.c +@@ -1537,7 +1537,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su + unit_destroy_cgroup(u); + + /* Note that this doesn't apply to RemainAfterExit services exiting +- * sucessfully, since there's no change of state in that case. Which is ++ * successfully, since there's no change of state in that case. Which is + * why it is handled in service_set_state() */ + if (UNIT_IS_INACTIVE_OR_FAILED(os) != UNIT_IS_INACTIVE_OR_FAILED(ns)) { + ExecContext *ec; +diff --git src/libsystemd/sd-bus/bus-message.c src/libsystemd/sd-bus/bus-message.c +index b9d7f6d..e32f2b8 100644 +--- src/libsystemd/sd-bus/bus-message.c ++++ src/libsystemd/sd-bus/bus-message.c +@@ -4215,7 +4215,7 @@ static int message_read_ap( + * in a single stackframe. We hence implement our own + * home-grown stack in an array. */ + +- n_array = (unsigned) -1; /* lenght of current array entries */ ++ n_array = (unsigned) -1; /* length of current array entries */ + n_struct = strlen(types); /* length of current struct contents signature */ + + for (;;) { +diff --git src/libsystemd/sd-bus/sd-bus.c src/libsystemd/sd-bus/sd-bus.c +index 8e44e50..ba8a8a2 100644 +--- src/libsystemd/sd-bus/sd-bus.c ++++ src/libsystemd/sd-bus/sd-bus.c +@@ -1447,7 +1447,7 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) { + static int bus_remarshal_message(sd_bus *b, sd_bus_message **m) { + assert(b); + +- /* Do packet version and endianess already match? */ ++ /* Do packet version and endianness already match? */ + if ((b->message_version == 0 || b->message_version == (*m)->header->version) && + (b->message_endian == 0 || b->message_endian == (*m)->header->endian)) + return 0; +@@ -1464,7 +1464,7 @@ int bus_seal_synthetic_message(sd_bus *b, sd_bus_message *m) { + * hence let's fill something in for synthetic messages. Since + * synthetic messages might have a fake sender and we don't + * want to interfere with the real sender's serial numbers we +- * pick a fixed, artifical one. We use (uint32_t) -1 rather ++ * pick a fixed, artificial one. We use (uint32_t) -1 rather + * than (uint64_t) -1 since dbus1 only had 32bit identifiers, + * even though kdbus can do 64bit. */ + +diff --git src/systemd/sd-resolve.h src/systemd/sd-resolve.h +index df69e4b..3c1d482 100644 +--- src/systemd/sd-resolve.h ++++ src/systemd/sd-resolve.h +@@ -129,7 +129,7 @@ int sd_resolve_get_next(sd_resolve *resolve, sd_resolve_query **q); + int sd_resolve_get_n_queries(sd_resolve *resolve); + + /** Cancel a currently running query. q is is destroyed by this call +- * and may not be used any futher. */ ++ * and may not be used any further. */ + int sd_resolve_cancel(sd_resolve_query* q); + + /** Returns non-zero when the query operation specified by q has been completed */ +diff --git src/timedate/timedated.c src/timedate/timedated.c +index d85ce57..c4a797a 100644 +--- src/timedate/timedated.c ++++ src/timedate/timedated.c +@@ -468,7 +468,7 @@ static int property_get_rtc_time( + zero(tm); + r = hwclock_get_time(&tm); + if (r == -EBUSY) { +- log_warning("/dev/rtc is busy, is somebody keeping it open continously? That's not a good idea... Returning a bogus RTC timestamp."); ++ log_warning("/dev/rtc is busy, is somebody keeping it open continuously? That's not a good idea... Returning a bogus RTC timestamp."); + t = 0; + } else if (r == -ENOENT) { + log_debug("Not /dev/rtc found."); +diff --git src/udev/udevadm-settle.c src/udev/udevadm-settle.c +index b026155..927ea2a 100644 +--- src/udev/udevadm-settle.c ++++ src/udev/udevadm-settle.c +@@ -100,7 +100,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) + case '?': + exit(EXIT_FAILURE); + default: +- assert_not_reached("Unkown argument"); ++ assert_not_reached("Unknown argument"); + } + + if (optind < argc) { +-- +1.7.9.2 + diff --git a/systemctl-set-default-target.patch b/systemctl-set-default-target.patch new file mode 100644 index 0000000..a8f0bb8 --- /dev/null +++ b/systemctl-set-default-target.patch @@ -0,0 +1,28 @@ +Mention that --force is required to override an already existing default.target + +This solves the bug bnc#868439 + +--- + systemctl.xml | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- systemd-210/man/systemctl.xml ++++ systemd-210/man/systemctl.xml 2014-03-19 09:54:37.946235696 +0000 +@@ -371,7 +371,7 @@ along with systemd; If not, see + + +- When used with enable, overwrite ++ When used with enable or set-default, overwrite + any existing conflicting symlinks. + + When used with halt, +@@ -1036,6 +1036,8 @@ kobject-uevent 1 systemd-udevd-kernel.so + + Set the default target to boot into. Command links + default.target to the given unit. ++ If combined with , overwrite ++ an already existing symlink for the default target. + + + diff --git a/systemd-mini.changes b/systemd-mini.changes index 8028277..0639153 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Wed Mar 19 12:09:31 UTC 2014 - werner@suse.de + +- Add patch systemctl-set-default-target.patch which explain how + to override the default.target by using --force (bnc#868439) + +------------------------------------------------------------------- +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: + 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch + 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch + 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch + 0004-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch + 0005-networkd-fix-creation-of-runtime-dirs-at-startup.patch + 0006-Do-not-return-1-EINVAL-on-allocation-error.patch + 0007-networkd-fix-typo.patch + 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch + 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch + 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch + 0011-_sd_machines-Use-machinectl-no-legend.patch + 0012-journald-remove-stray-reset-of-error-return-value.patch + 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch + ------------------------------------------------------------------- Fri Mar 14 14:24:56 UTC 2014 - werner@suse.de @@ -789,7 +815,7 @@ Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de - Change patch 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch to check if XDG_RUNTIME_DIR is set before the call of pam_putenv() - may fix bnc#855160 + may fix bnc#855160 ------------------------------------------------------------------- Fri Dec 20 09:40:01 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd-mini.spec b/systemd-mini.spec index c554b30..faa9385 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -149,6 +149,7 @@ Source11: after-local.service Source1060: boot.udev Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink +Source1063: udev-generate-peristent-rule.sh ############################################################################## # @@ -308,6 +309,22 @@ Patch151: 0005-logind-fix-policykit-checks.patch Patch152: 0006-rules-mark-loop-device-as-SYSTEMD_READY-0-if-no-file.patch # PATCH-FIX-USTREAM added at 2014/03/11 Patch153: 0008-man-multiple-sleep-modes-are-to-be-separated-by-whit.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch154: 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch155: 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch157: 0006-Do-not-return-1-EINVAL-on-allocation-error.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch158: 0007-networkd-fix-typo.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch159: 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch160: 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch161: 0012-journald-remove-stray-reset-of-error-return-value.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch162: 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch # PATCH-FIX-OPENSUSE 1009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844) Patch1009: 1009-make-xsltproc-use-correct-ROFF-links.patch # PATCH-FIX-OPENSUSE 1010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071) @@ -326,6 +343,8 @@ Patch1020: 0001-add-network-device-after-NFS-mount-units.patch Patch1022: 1022-systemd-tmpfiles-ownerkeep.patch # PATCH-FIX-SUSE systemd-powerd-initctl-support.patch Patch1023: systemd-powerd-initctl-support.patch +# PATCH-FIX-SUSE systemctl-set-default-target.patch +Patch1024: systemctl-set-default-target.patch # PATCH-FIX-SUSE systemd-install-compat_pkgconfig-always.patch Patch1999: systemd-install-compat_pkgconfig-always.patch # PATCH-FIX-OPENSUSE systemd-dbus-system-bus-address.patch always use /run/dbus not /var/run @@ -657,6 +676,14 @@ cp %{SOURCE7} m4/ %patch151 -p0 %patch152 -p0 %patch153 -p0 +%patch154 -p0 +%patch155 -p0 +%patch157 -p0 +%patch158 -p0 +%patch159 -p0 +%patch160 -p0 +%patch161 -p0 +%patch162 -p0 %patch1009 -p1 %patch1010 -p1 %patch1012 -p1 @@ -668,6 +695,7 @@ cp %{SOURCE7} m4/ %endif %patch1022 -p1 %patch1023 -p1 +%patch1024 -p1 %if ! 0%{?bootstrap} %patch1999 -p1 %endif @@ -776,6 +804,7 @@ sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061} install -m755 -D %{S:1061} %{buildroot}/%{_prefix}/lib/udev/write_dev_root_rule sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} %{buildroot}/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service +install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-peristent-rule mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants rm -rf %{buildroot}%{_sysconfdir}/rpm @@ -1376,6 +1405,7 @@ exit 0 %{_prefix}/lib/udev/scsi_id %{_prefix}/lib/udev/v4l_id %{_prefix}/lib/udev/write_dev_root_rule +%{_prefix}/lib/udev/udev-generate-peristent-rule %dir %{_prefix}/lib/udev/rules.d/ %exclude %{_prefix}/lib/udev/rules.d/70-uaccess.rules %exclude %{_prefix}/lib/udev/rules.d/71-seat.rules diff --git a/systemd.changes b/systemd.changes index 8028277..0639153 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Wed Mar 19 12:09:31 UTC 2014 - werner@suse.de + +- Add patch systemctl-set-default-target.patch which explain how + to override the default.target by using --force (bnc#868439) + +------------------------------------------------------------------- +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: + 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch + 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch + 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch + 0004-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch + 0005-networkd-fix-creation-of-runtime-dirs-at-startup.patch + 0006-Do-not-return-1-EINVAL-on-allocation-error.patch + 0007-networkd-fix-typo.patch + 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch + 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch + 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch + 0011-_sd_machines-Use-machinectl-no-legend.patch + 0012-journald-remove-stray-reset-of-error-return-value.patch + 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch + ------------------------------------------------------------------- Fri Mar 14 14:24:56 UTC 2014 - werner@suse.de @@ -789,7 +815,7 @@ Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de - Change patch 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch to check if XDG_RUNTIME_DIR is set before the call of pam_putenv() - may fix bnc#855160 + may fix bnc#855160 ------------------------------------------------------------------- Fri Dec 20 09:40:01 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd.spec b/systemd.spec index 7be75e0..557956b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -144,6 +144,7 @@ Source11: after-local.service Source1060: boot.udev Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink +Source1063: udev-generate-peristent-rule.sh ############################################################################## # @@ -303,6 +304,22 @@ Patch151: 0005-logind-fix-policykit-checks.patch Patch152: 0006-rules-mark-loop-device-as-SYSTEMD_READY-0-if-no-file.patch # PATCH-FIX-USTREAM added at 2014/03/11 Patch153: 0008-man-multiple-sleep-modes-are-to-be-separated-by-whit.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch154: 0001-gpt-auto-generator-don-t-return-OOM-on-parentless-de.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch155: 0002-bus-fix-memory-leak-when-kdbus-is-not-enabled.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch157: 0006-Do-not-return-1-EINVAL-on-allocation-error.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch158: 0007-networkd-fix-typo.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch159: 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch160: 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch161: 0012-journald-remove-stray-reset-of-error-return-value.patch +# PATCH-FIX-USTREAM added at 2014/03/18 +Patch162: 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch # PATCH-FIX-OPENSUSE 1009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844) Patch1009: 1009-make-xsltproc-use-correct-ROFF-links.patch # PATCH-FIX-OPENSUSE 1010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071) @@ -321,6 +338,8 @@ Patch1020: 0001-add-network-device-after-NFS-mount-units.patch Patch1022: 1022-systemd-tmpfiles-ownerkeep.patch # PATCH-FIX-SUSE systemd-powerd-initctl-support.patch Patch1023: systemd-powerd-initctl-support.patch +# PATCH-FIX-SUSE systemctl-set-default-target.patch +Patch1024: systemctl-set-default-target.patch # PATCH-FIX-SUSE systemd-install-compat_pkgconfig-always.patch Patch1999: systemd-install-compat_pkgconfig-always.patch # PATCH-FIX-OPENSUSE systemd-dbus-system-bus-address.patch always use /run/dbus not /var/run @@ -652,6 +671,14 @@ cp %{SOURCE7} m4/ %patch151 -p0 %patch152 -p0 %patch153 -p0 +%patch154 -p0 +%patch155 -p0 +%patch157 -p0 +%patch158 -p0 +%patch159 -p0 +%patch160 -p0 +%patch161 -p0 +%patch162 -p0 %patch1009 -p1 %patch1010 -p1 %patch1012 -p1 @@ -663,6 +690,7 @@ cp %{SOURCE7} m4/ %endif %patch1022 -p1 %patch1023 -p1 +%patch1024 -p1 %if ! 0%{?bootstrap} %patch1999 -p1 %endif @@ -771,6 +799,7 @@ sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061} install -m755 -D %{S:1061} %{buildroot}/%{_prefix}/lib/udev/write_dev_root_rule sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} %{buildroot}/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service +install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-peristent-rule mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants rm -rf %{buildroot}%{_sysconfdir}/rpm @@ -1371,6 +1400,7 @@ exit 0 %{_prefix}/lib/udev/scsi_id %{_prefix}/lib/udev/v4l_id %{_prefix}/lib/udev/write_dev_root_rule +%{_prefix}/lib/udev/udev-generate-peristent-rule %dir %{_prefix}/lib/udev/rules.d/ %exclude %{_prefix}/lib/udev/rules.d/70-uaccess.rules %exclude %{_prefix}/lib/udev/rules.d/71-seat.rules diff --git a/udev-generate-peristent-rule.sh b/udev-generate-peristent-rule.sh new file mode 100644 index 0000000..ee6a5e6 --- /dev/null +++ b/udev-generate-peristent-rule.sh @@ -0,0 +1,405 @@ +#!/bin/bash +# +# Copyright (C) 2014 Robert Milasan +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation version 2 of the License. +# +# This script run manually by user, will generate a persistent rule for +# a given network interface to rename it to new interface name. +# + +prj=${0##*/} + +log_info() +{ + local msg="$1" + echo "$prj: $msg" +} + +log_error() +{ + local msg=$1 + echo "$prj: $msg" >&2 +} + +usage() +{ + set -f + cat << EOF +$prj: udev persistent rule generator + +Usage: $prj [OPTION] ... + + -h show this help + -m generate the persistent rule based on interface MAC address + -p generate the persistent rule based on interface PCI slot + -v be verbose + -c current interface name (ex: "ip a s") + -n new interface name (ex: net0) + -o where to write the new generate rule (default: /dev/stdout) + prefered location is /etc/udev/rules.d/70-persistent-net.rules + +Example: + $prj -m -c enp0s4 -n net0 -o /etc/udev/rules.d/70-persistent-net.rules + or + $prj -p -c wlp3s0 -n wlan0 -o /etc/udev/rules.d/50-mynet.rules + +EOF +} + +display_note() +{ + cat <<'EOF' + +NOTE: Using the generate persistent rule might mean you will need to do extra +work to ensure that it will work accordingly. This mean, regenerating the +initramfs/initrd image and/or using 'net.ifnames=0' option at boot time. + +In openSUSE/SUSE, the user will need to regenerate the initramfs/initrd image, +but usually there is no need for 'net.ifnames=0' option if the persistent rule +is available in initramfs/initrd image. + +EOF +} + +get_pci() +{ + local path=$1 + local pci="" + + if [ -L "$path/device" ]; then + local pci_link="$(readlink -f $path/device 2>/dev/null)" + pci="$(basename $pci_link 2>/dev/null)" + fi + echo $pci +} + +get_pci_id() +{ + local path=$1 + local pci_id="" + + if [ -r "$path/device/uevent" ]; then + local _pci_id="$(cat $path/device/uevent|grep ^PCI_ID 2>/dev/null)" + pci_id="${_pci_id#*=}" + fi + echo $pci_id +} + +get_macaddr() +{ + local path=$1 + local macaddr="" + + if [ -r "$path/address" ]; then + macaddr="$(cat $path/address 2>/dev/null)" + fi + echo $macaddr +} + +get_type() +{ + local path=$1 + local dev_type="" + + if [ -r "$path/type" ]; then + dev_type="$(cat $path/type 2>/dev/null)" + fi + echo $dev_type +} + +get_dev_id() +{ + local path=$1 + local dev_id="" + + if [ -r "$path/dev_id" ]; then + dev_id="$(cat $path/dev_id 2>/dev/null)" + fi + echo $dev_id +} + +get_devtype() +{ + local path=$1 + local devtype="" + if [ -r "$path/uevent" ]; then + local _devtype="$(cat $path/uevent|grep ^DEVTYPE 2>/dev/null)" + devtype="${_devtype#*=}" + fi + echo $devtype +} + +get_subsystem() +{ + local path=$1 + local subsystem="" + + if [ -L "$path/subsystem" ]; then + local subsystem_link="$(readlink -f $path/subsystem 2>/dev/null)" + subsystem="$(basename $subsystem_link 2>/dev/null)" + fi + echo $subsystem +} + +get_driver() +{ + local path=$1 + local driver="" + + if [ -L "$path/device/driver" ]; then + local driver_link="$(readlink -f $path/device/driver 2>/dev/null)" + driver="$(basename $driver_link 2>/dev/null)" + fi + echo $driver +} + +valid_mac() +{ + local macaddr=$1 + local valid_macaddr="" + + if [ -n "$macaddr" ]; then + valid_macaddr="$(echo $macaddr | sed -n '/^\([0-9a-z][0-9a-z]:\)\{5\}[0-9a-z][0-9a-z]$/p')" + fi + echo $valid_macaddr +} + +generate_comment() +{ + local pci_id=$1 + local driver=$2 + local output=$3 + + if [ -z "$pci_id" ]; then + log_error "\$pci_id empty." + exit 1 + elif [ -z "$driver" ]; then + log_error "\$driver empty." + exit 1 + elif [ -z "$output" ]; then + log_error "\$output empty." + exit 1 + else + echo "# PCI device $pci_id ($driver) with official udev name $interface renamed to unsupported $new_interface" >> $output + fi +} + +generate_rule() +{ + local _subsystem=$1 + local _mac=$2 + local _pci=$3 + local _dev_id=$4 + local _dev_type=$5 + local _kernel=$6 + local _interface=$7 + local output=$8 + + if [ -z "$_subsystem" ]; then + log_error "\$_subsystem empty." + exit 1 + elif [ -z "$_dev_id" ]; then + log_error "\$_dev_id empty." + exit 1 + elif [ -z "$_dev_type" ]; then + log_error "\$_dev_type empty." + exit 1 + elif [ -z "$_kernel" ]; then + log_error "\$_kernel empty." + exit 1 + elif [ -z "$_interface" ]; then + log_error "\$_interface empty." + exit 1 + elif [ -z "$output" ]; then + output="/dev/stdout" + fi + + if [ "$_mac" != "none" ]; then + echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$_mac\", \ +ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output} + elif [ "$_pci" != "none" ]; then + echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", KERNELS==\"$_pci\", \ +ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output} + else + log_error "MAC address or PCI slot information missing." + exit 1 + fi +} + +if [ $# -eq 0 ]; then + usage + log_error "missing option(s)." + exit 1 +fi + +use_mac=0 +use_pci=0 +use_verbose=0 + +while getopts "hmpvc:n:o:" opt; do + case "$opt" in + h) + usage; exit 0;; + m) + use_mac=1 ;; + p) + use_pci=1 ;; + v) + use_verbose=1 ;; + c) + ifcur="$OPTARG" ;; + n) + ifnew="$OPTARG" ;; + o) + output="$OPTARG" ;; + \?) + exit 1 ;; + esac +done + +if [[ "$use_mac" -eq 1 ]] && [[ "$use_pci" -eq 1 ]]; then + log_error "generating a persistent rule can be done only using one of the option, -m or -p, not both." + exit 1 +fi + +outfile=$output +if [ -z "$output" ]; then + outfile=/dev/stdout +else + dir="$(dirname $outfile 2>/dev/null)" + tmpfile="$dir/.tmp_file" + if [ -d "$dir" ]; then + touch "$tmpfile" >/dev/null 2>&1 + if [ $? -ne 0 ]; then + log_error "no write access for $outfile. make sure you have write permissions to $dir." + exit 1 + fi + rm -f "$tmpfile" >/dev/null 2>&1 + else + log_error "$dir not a directory." + exit 1 + fi +fi + +interface=$ifcur +if [ -z "$interface" ]; then + log_error "current interface must be specified." + exit 1 +elif [ "$interface" == "lo" ]; then + log_error "loopback interface is not a valid interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: INTERFACE=$interface" + +new_interface=$ifnew +if [ -z "$new_interface" ]; then + log_error "new interface must be specified." + exit 1 +elif [ "$new_interface" == "lo" ]; then + log_error "new interface cant be named loopback interface." + exit +fi +[ "$use_verbose" -eq 1 ] && echo "I: INTERFACE_NEW=$new_interface" + +path="/sys/class/net/$interface" +if [ ! -d "$path" ]; then + log_error "devpath $path not a directory." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: DEVPATH=$path" + +devtype="$(get_devtype $path)" +if [ -n "$devtype" ]; then + [ "$use_verbose" -eq 1 ] && echo "I: DEVTYPE=$devtype" +fi + +subsystem="$(get_subsystem $path)" +if [ -z "$subsystem" ]; then + log_error "unable to retrieve subsystem for interface $interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: SUBSYSTEM=$subsystem" + +pci_id="$(get_pci_id $path)" +if [ -z "$pci_id" ]; then + log_error "unable to retrieve PCI_ID for interface $interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: PCI_ID=$pci_id" + +driver="$(get_driver $path)" +if [ -z "$driver" ]; then + log_error "unable to retrieve driver for interface $interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: DRIVER=$driver" + +if [ "$use_mac" -eq 1 ]; then + macaddr="$(get_macaddr $path)" + if [ -z "$macaddr" ]; then + log_error "unable to retrieve MAC address for interface $interface." + exit 1 + fi + if [ "$(valid_mac $macaddr)" != "$macaddr" ]; then + log_error "$macaddr invalid MAC address." + exit 1 + fi + [ "$use_verbose" -eq 1 ] && echo "I: MACADDR=$macaddr" +fi + +if [ "$use_pci" -eq 1 ]; then + pci="$(get_pci $path)" + if [ -z "$pci" ]; then + log_error "unable to retrieve PCI slot for interface $interface." + exit 1 + fi + [ "$use_verbose" -eq 1 ] && echo "I: KERNELS=$pci" +fi + +dev_id="$(get_dev_id $path)" +if [ -z "$dev_id" ]; then + log_error "unable to retrieve dev_id for interface $interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: DEV_ID=$dev_id" + +dev_type="$(get_type $path)" +if [ -z "$dev_type" ]; then + log_error "unable to retrieve dev_type for interface $interface." + exit 1 +fi +[ "$use_verbose" -eq 1 ] && echo "I: TYPE=$dev_type" + +if [ "$devtype" == "wlan" ]; then + kernel="wlan*" +else + kernel="eth*" +fi + +if [ -n "$output" ]; then + echo "Persistent rule saved in "$outfile"" + echo + generate_comment "$pci_id" "$driver" "$output" +fi + +set -f +if [ "$use_mac" -eq 1 ]; then + generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface" + if [ -n "$output" ]; then + generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$output" + fi +elif [ "$use_pci" -eq 1 ]; then + generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface" + if [ -n "$output" ]; then + generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$outfile" + fi +fi + +if [ -n "$output" ]; then + display_note +fi + +exit 0 From e930a884e145a5fcf5668f7beb1560c8786381f5250a06aebb403169f2ff5cf2 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 12:20:20 +0000 Subject: [PATCH 02/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=566 --- systemctl-set-default-target.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemctl-set-default-target.patch b/systemctl-set-default-target.patch index a8f0bb8..4dd058d 100644 --- a/systemctl-set-default-target.patch +++ b/systemctl-set-default-target.patch @@ -7,7 +7,7 @@ This solves the bug bnc#868439 1 file changed, 3 insertions(+), 1 deletion(-) --- systemd-210/man/systemctl.xml -+++ systemd-210/man/systemctl.xml 2014-03-19 09:54:37.946235696 +0000 ++++ systemd-210/man/systemctl.xml 2014-03-19 12:19:53.182235657 +0000 @@ -371,7 +371,7 @@ along with systemd; If not, see @@ -21,7 +21,7 @@ This solves the bug bnc#868439 Set the default target to boot into. Command links default.target to the given unit. -+ If combined with , overwrite ++ If combined with , override + an already existing symlink for the default target. From dfcca8375eaf4267f3e1c0d31f8382822918f9910229899ed5aa5c3ee7d0a193 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 13:37:37 +0000 Subject: [PATCH 03/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=567 --- systemd-mini.changes | 5 +++++ systemd-mini.spec | 16 ++++++++++++++++ systemd.changes | 5 +++++ systemd.spec | 16 ++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/systemd-mini.changes b/systemd-mini.changes index 0639153..8d47d3f 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 19 13:21:37 UTC 2014 - werner@suse.de + +- Be sure that the refreshed manual pages are installed + ------------------------------------------------------------------- Wed Mar 19 12:09:31 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index faa9385..a901625 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -772,8 +772,24 @@ export V=1 --disable-kdbus \ CFLAGS="%{optflags}" make %{?_smp_mflags} +%if ! 0%{?bootstrap} +make %{?_smp_mflags} update-man-list man +%endif %install +# Use refreshed manual pages +for man in man/*.[0-9] +do + section=${man##*.} + test -d man/man${section} || continue + new=man/man${section}/${man##*/} + if test -s $new -a $new -nt $man + then + cp -p $new $man + else + sed -ri 's@"(systemd) 209"@"\1 210"@' $man + fi +done make install DESTDIR="%buildroot" # move to %{_lib} diff --git a/systemd.changes b/systemd.changes index 0639153..8d47d3f 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 19 13:21:37 UTC 2014 - werner@suse.de + +- Be sure that the refreshed manual pages are installed + ------------------------------------------------------------------- Wed Mar 19 12:09:31 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 557956b..f871ac2 100644 --- a/systemd.spec +++ b/systemd.spec @@ -767,8 +767,24 @@ export V=1 --disable-kdbus \ CFLAGS="%{optflags}" make %{?_smp_mflags} +%if ! 0%{?bootstrap} +make %{?_smp_mflags} update-man-list man +%endif %install +# Use refreshed manual pages +for man in man/*.[0-9] +do + section=${man##*.} + test -d man/man${section} || continue + new=man/man${section}/${man##*/} + if test -s $new -a $new -nt $man + then + cp -p $new $man + else + sed -ri 's@"(systemd) 209"@"\1 %{version}"@' $man + fi +done make install DESTDIR="%buildroot" # move to %{_lib} From 2c4c818523aff8b79c28218e207d0864fee5f6c1cdc37fcc0953de5a4c2e4d9f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 13:56:12 +0000 Subject: [PATCH 04/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=568 --- systemd-mini.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd-mini.spec b/systemd-mini.spec index a901625..e446912 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -787,7 +787,7 @@ do then cp -p $new $man else - sed -ri 's@"(systemd) 209"@"\1 210"@' $man + sed -ri 's@"(systemd) 209"@"\1 %{version}"@' $man fi done make install DESTDIR="%buildroot" From 0ee795cdbda1972f128ba951c04423abe2e9541f7670c7cfd80474fffa02f3a8 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 14:06:11 +0000 Subject: [PATCH 05/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=569 --- udev-generate-peristent-rule.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/udev-generate-peristent-rule.sh b/udev-generate-peristent-rule.sh index ee6a5e6..4c83919 100644 --- a/udev-generate-peristent-rule.sh +++ b/udev-generate-peristent-rule.sh @@ -2,9 +2,18 @@ # # Copyright (C) 2014 Robert Milasan # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation version 2 of the License. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # # This script run manually by user, will generate a persistent rule for # a given network interface to rename it to new interface name. From 9b89f6b74cdd3a8d23a624613ec889cc68cd51e5ec1a1d4a04e3cb6e5604363d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 19 Mar 2014 14:23:50 +0000 Subject: [PATCH 06/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=570 --- ...k-for-a-64bit-value-when-we-only-hav.patch | 181 ------------------ ...nstall-_sd_machines-with-_machinectl.patch | 28 --- 2 files changed, 209 deletions(-) delete mode 100644 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch delete mode 100644 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch diff --git a/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch b/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch deleted file mode 100644 index 456de40..0000000 --- a/0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch +++ /dev/null @@ -1,181 +0,0 @@ -From 42c4ebcbd4cbd7b27667eb8081ee4dc46f9ece17 Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Thu, 13 Mar 2014 20:33:22 +0100 -Subject: [PATCH] sd-bus: don't look for a 64bit value when we only have 32bit - value on reply cookie hash table access - -This broke hashtable lookups for the message cookies on s390x, which is -a 64bit BE machine where accessing 32bit values as 64bit and vice versa -will explode. - -Also, while we are at it, be a bit more careful when dealing with the -64bit cookies we expose and the 32bit serial numbers dbus uses in its -payload. - -Problem identified by Fridrich Strba. ---- - src/libsystemd/sd-bus/bus-dump.c | 4 ++-- - src/libsystemd/sd-bus/bus-kernel.c | 2 +- - src/libsystemd/sd-bus/bus-message.c | 15 ++++++++++----- - src/libsystemd/sd-bus/bus-message.h | 5 +++-- - src/libsystemd/sd-bus/sd-bus.c | 12 ++++++------ - 5 files changed, 22 insertions(+), 16 deletions(-) - -diff --git src/libsystemd/sd-bus/bus-dump.c src/libsystemd/sd-bus/bus-dump.c -index 0e41549..ea81644 100644 ---- src/libsystemd/sd-bus/bus-dump.c -+++ src/libsystemd/sd-bus/bus-dump.c -@@ -69,10 +69,10 @@ int bus_message_dump(sd_bus_message *m, FILE *f, bool with_header) { - if (BUS_MESSAGE_COOKIE(m) == 0xFFFFFFFFULL) - fprintf(f, " Cookie=-1"); - else -- fprintf(f, " Cookie=%lu", (unsigned long) BUS_MESSAGE_COOKIE(m)); -+ fprintf(f, " Cookie=%" PRIu64, BUS_MESSAGE_COOKIE(m)); - - if (m->reply_cookie != 0) -- fprintf(f, " ReplyCookie=%lu", (unsigned long) m->reply_cookie); -+ fprintf(f, " ReplyCookie=%" PRIu64, m->reply_cookie); - - fputs("\n", f); - -diff --git src/libsystemd/sd-bus/bus-kernel.c src/libsystemd/sd-bus/bus-kernel.c -index 8a2ca02..80ef15b 100644 ---- src/libsystemd/sd-bus/bus-kernel.c -+++ src/libsystemd/sd-bus/bus-kernel.c -@@ -266,7 +266,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { - well_known ? 0 : - m->destination ? unique : KDBUS_DST_ID_BROADCAST; - m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS; -- m->kdbus->cookie = m->header->serial; -+ m->kdbus->cookie = (uint64_t) m->header->serial; - m->kdbus->priority = m->priority; - - if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) -diff --git src/libsystemd/sd-bus/bus-message.c src/libsystemd/sd-bus/bus-message.c -index fb894ef..97ab0e3 100644 ---- src/libsystemd/sd-bus/bus-message.c -+++ src/libsystemd/sd-bus/bus-message.c -@@ -617,7 +617,7 @@ static int message_new_reply( - t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; - t->reply_cookie = BUS_MESSAGE_COOKIE(call); - -- r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, t->reply_cookie); -+ r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); - if (r < 0) - goto fail; - -@@ -752,7 +752,7 @@ int bus_message_new_synthetic_error( - t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED; - t->reply_cookie = cookie; - -- r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, t->reply_cookie); -+ r = message_append_field_uint32(t, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) t->reply_cookie); - if (r < 0) - goto fail; - -@@ -5075,21 +5075,26 @@ int bus_message_parse_fields(sd_bus_message *m) { - break; - } - -- case BUS_MESSAGE_HEADER_REPLY_SERIAL: -+ case BUS_MESSAGE_HEADER_REPLY_SERIAL: { -+ uint32_t serial; -+ - if (m->reply_cookie != 0) - return -EBADMSG; - - if (!streq(signature, "u")) - return -EBADMSG; - -- r = message_peek_field_uint32(m, &ri, item_size, &m->reply_cookie); -+ r = message_peek_field_uint32(m, &ri, item_size, &serial); - if (r < 0) - return r; - -+ m->reply_cookie = serial; -+ - if (m->reply_cookie == 0) - return -EBADMSG; - - break; -+ } - - case BUS_MESSAGE_HEADER_UNIX_FDS: - if (unix_fds != 0) -@@ -5489,7 +5494,7 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) { - return -ENOMEM; - - n->reply_cookie = (*m)->reply_cookie; -- r = message_append_field_uint32(n, BUS_MESSAGE_HEADER_REPLY_SERIAL, n->reply_cookie); -+ r = message_append_field_uint32(n, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) n->reply_cookie); - if (r < 0) - return r; - -diff --git src/libsystemd/sd-bus/bus-message.h src/libsystemd/sd-bus/bus-message.h -index 5fbe3e6..df79294 100644 ---- src/libsystemd/sd-bus/bus-message.h -+++ src/libsystemd/sd-bus/bus-message.h -@@ -84,7 +84,7 @@ struct sd_bus_message { - - sd_bus *bus; - -- uint32_t reply_cookie; -+ uint64_t reply_cookie; - - const char *path; - const char *interface; -@@ -162,7 +162,8 @@ static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) { - return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u; - } - --static inline uint32_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { -+static inline uint64_t BUS_MESSAGE_COOKIE(sd_bus_message *m) { -+ /* Note that we return the serial converted to a 64bit value here */ - return BUS_MESSAGE_BSWAP32(m, m->header->serial); - } - -diff --git src/libsystemd/sd-bus/sd-bus.c src/libsystemd/sd-bus/sd-bus.c -index ca7c428..8e44e50 100644 ---- src/libsystemd/sd-bus/sd-bus.c -+++ src/libsystemd/sd-bus/sd-bus.c -@@ -1486,15 +1486,15 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call - return r; - - if (bus->is_kernel || *idx >= BUS_MESSAGE_SIZE(m)) -- log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", -+ log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", - bus_message_type_to_string(m->header->type), - strna(sd_bus_message_get_sender(m)), - strna(sd_bus_message_get_destination(m)), - strna(sd_bus_message_get_path(m)), - strna(sd_bus_message_get_interface(m)), - strna(sd_bus_message_get_member(m)), -- (unsigned long) BUS_MESSAGE_COOKIE(m), -- (unsigned long) m->reply_cookie, -+ BUS_MESSAGE_COOKIE(m), -+ m->reply_cookie, - strna(m->error.message)); - - return r; -@@ -2253,15 +2253,15 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { - bus->current = m; - bus->iteration_counter++; - -- log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%lu reply_cookie=%lu error=%s", -+ log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", - bus_message_type_to_string(m->header->type), - strna(sd_bus_message_get_sender(m)), - strna(sd_bus_message_get_destination(m)), - strna(sd_bus_message_get_path(m)), - strna(sd_bus_message_get_interface(m)), - strna(sd_bus_message_get_member(m)), -- (unsigned long) BUS_MESSAGE_COOKIE(m), -- (unsigned long) m->reply_cookie, -+ BUS_MESSAGE_COOKIE(m), -+ m->reply_cookie, - strna(m->error.message)); - - r = process_hello(bus, m); --- -1.7.9.2 - diff --git a/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch b/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch deleted file mode 100644 index 9093b00..0000000 --- a/0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d895500c478c6ad7904905bb4c08176d5a6c0763 Mon Sep 17 00:00:00 2001 -From: Wieland Hoffmann -Date: Mon, 10 Mar 2014 15:17:31 +0100 -Subject: [PATCH] zsh completion: Install _sd_machines with _machinectl - -_machinectl uses _sd_machines to provide a list of all available -machines. ---- - Makefile.am | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git Makefile.am Makefile.am -index 60cb991..9e01cd5 100644 ---- Makefile.am -+++ Makefile.am -@@ -4067,7 +4067,8 @@ dist_dbuspolicy_DATA += \ - src/machine/org.freedesktop.machine1.conf - - dist_zshcompletion_DATA += \ -- shell-completion/zsh/_machinectl -+ shell-completion/zsh/_machinectl \ -+ shell-completion/zsh/_sd_machines - - SYSTEM_UNIT_ALIASES += \ - systemd-machined.service dbus-org.freedesktop.machine1.service --- -1.7.9.2 - From d58892e030a3d8851c708c3cc9795ebfaed91a27933cdf07d22413f23a3d684d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 20 Mar 2014 12:11:21 +0000 Subject: [PATCH 07/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=571 --- systemd-mini.changes | 5 ----- systemd.changes | 5 ----- 2 files changed, 10 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index 8d47d3f..b71a4b1 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -17,15 +17,10 @@ Tue Mar 18 13:23:43 UTC 2014 - werner@suse.de - Add or port upstram 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 - 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch - 0004-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch - 0005-networkd-fix-creation-of-runtime-dirs-at-startup.patch 0006-Do-not-return-1-EINVAL-on-allocation-error.patch 0007-networkd-fix-typo.patch 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch - 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch - 0011-_sd_machines-Use-machinectl-no-legend.patch 0012-journald-remove-stray-reset-of-error-return-value.patch 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch diff --git a/systemd.changes b/systemd.changes index 8d47d3f..b71a4b1 100644 --- a/systemd.changes +++ b/systemd.changes @@ -17,15 +17,10 @@ Tue Mar 18 13:23:43 UTC 2014 - werner@suse.de - Add or port upstram 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 - 0003-sd-bus-don-t-look-for-a-64bit-value-when-we-only-hav.patch - 0004-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch - 0005-networkd-fix-creation-of-runtime-dirs-at-startup.patch 0006-Do-not-return-1-EINVAL-on-allocation-error.patch 0007-networkd-fix-typo.patch 0008-sd-bus-don-t-access-invalid-memory-if-a-signal-match.patch 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch - 0010-zsh-completion-Install-_sd_machines-with-_machinectl.patch - 0011-_sd_machines-Use-machinectl-no-legend.patch 0012-journald-remove-stray-reset-of-error-return-value.patch 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch From da5ebdb2e3909dec2d0edf25538f24a86c898d3093248d23c41fc6bbc53e9699 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 24 Mar 2014 11:36:29 +0000 Subject: [PATCH 08/16] Accepting request 227295 from openSUSE:Factory:Staging:Gcc49 - also autoreconf in systemd-mini to simplify spec file logic and fix build in staging:gcc49 (obsoleting 0002-make-209-working-on-older-dist.patch) OBS-URL: https://build.opensuse.org/request/show/227295 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=572 --- 0002-make-209-working-on-older-dist.patch | 65 ----------------------- pre_checkin.sh | 12 ----- systemd-mini.changes | 7 +++ systemd-mini.spec | 49 ----------------- systemd.changes | 7 +++ systemd.spec | 49 ----------------- 6 files changed, 14 insertions(+), 175 deletions(-) delete mode 100644 0002-make-209-working-on-older-dist.patch diff --git a/0002-make-209-working-on-older-dist.patch b/0002-make-209-working-on-older-dist.patch deleted file mode 100644 index 502c6a4..0000000 --- a/0002-make-209-working-on-older-dist.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- systemd-209/units/kmod-static-nodes.service.in -+++ systemd-209/units/kmod-static-nodes.service.in 2014-02-27 15:04:30.378236539 +0000 -@@ -15,4 +15,5 @@ ConditionPathExists=/lib/modules/%v/modu - [Service] - Type=oneshot - RemainAfterExit=yes -+ExecStartPre=@MKDIR_P@ /run/tmpfiles.d - ExecStart=@KMOD@ static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf ---- systemd-209/configure -+++ systemd-209/configure 2014-02-28 17:13:50.770735397 +0000 -@@ -15999,12 +15999,12 @@ if test -n "$KMOD_CFLAGS"; then - pkg_cv_KMOD_CFLAGS="$KMOD_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libkmod >= 15 \""; } >&5 -- ($PKG_CONFIG --exists --print-errors " libkmod >= 15 ") 2>&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libkmod >= 14 \""; } >&5 -+ ($PKG_CONFIG --exists --print-errors " libkmod >= 14 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then -- pkg_cv_KMOD_CFLAGS=`$PKG_CONFIG --cflags " libkmod >= 15 " 2>/dev/null` -+ pkg_cv_KMOD_CFLAGS=`$PKG_CONFIG --cflags " libkmod >= 14 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes - else - pkg_failed=yes -@@ -16016,12 +16016,12 @@ if test -n "$KMOD_LIBS"; then - pkg_cv_KMOD_LIBS="$KMOD_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libkmod >= 15 \""; } >&5 -- ($PKG_CONFIG --exists --print-errors " libkmod >= 15 ") 2>&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libkmod >= 14 \""; } >&5 -+ ($PKG_CONFIG --exists --print-errors " libkmod >= 14 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then -- pkg_cv_KMOD_LIBS=`$PKG_CONFIG --libs " libkmod >= 15 " 2>/dev/null` -+ pkg_cv_KMOD_LIBS=`$PKG_CONFIG --libs " libkmod >= 14 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes - else - pkg_failed=yes -@@ -16042,18 +16042,18 @@ else - _pkg_short_errors_supported=no - fi - if test $_pkg_short_errors_supported = yes; then -- KMOD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " libkmod >= 15 " 2>&1` -+ KMOD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " libkmod >= 14 " 2>&1` - else -- KMOD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " libkmod >= 15 " 2>&1` -+ KMOD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " libkmod >= 14 " 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$KMOD_PKG_ERRORS" >&5 - -- as_fn_error $? "*** kmod version >= 15 not found" "$LINENO" 5 -+ as_fn_error $? "*** kmod version >= 14 not found" "$LINENO" 5 - elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - $as_echo "no" >&6; } -- as_fn_error $? "*** kmod version >= 15 not found" "$LINENO" 5 -+ as_fn_error $? "*** kmod version >= 14 not found" "$LINENO" 5 - else - KMOD_CFLAGS=$pkg_cv_KMOD_CFLAGS - KMOD_LIBS=$pkg_cv_KMOD_LIBS diff --git a/pre_checkin.sh b/pre_checkin.sh index 6937326..1870630 100644 --- a/pre_checkin.sh +++ b/pre_checkin.sh @@ -4,18 +4,6 @@ # create a -mini spec for systemd for bootstrapping ORIG_SPEC=systemd -for patch in $(grep -lE 'Makefile.(am|in)|configure\.ac' *.patch) -do - sed -rn 's/^Patch([0-9]+):\s+'${patch}'/patch\1/p' $ORIG_SPEC.spec -done | while read patch -do - grep -1E '^%'${patch}'[^0-9]' $ORIG_SPEC.spec | grep -q bootstrap - if ((${PIPESTATUS[1]} != 0)) - then - echo Patch ${patch} does trigger 'auto(re)configure' 1>&2 - exit 1 - fi -done EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${ORIG_SPEC}.spec! #####\n" sed "s/^%define bootstrap.*$/${EDIT_WARNING}%define bootstrap 1/; s/^%define udevpkgname.*$/${EDIT_WARNING}%define udevpkgname udev-mini/; diff --git a/systemd-mini.changes b/systemd-mini.changes index b71a4b1..05a8fd3 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Mar 24 11:19:38 UTC 2014 - coolo@suse.com + +- also autoreconf in systemd-mini to simplify spec file logic + and fix build in staging:gcc49 + (obsoleting 0002-make-209-working-on-older-dist.patch) + ------------------------------------------------------------------- Wed Mar 19 13:21:37 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index e446912..4263ca9 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -151,20 +151,6 @@ Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh -############################################################################## -# -# WARNING: For the case of for bootstrapping patch should not affect -# the files -# -# Makefile.am, Makefile.in, and configure.ac -# -# as this triggers an (re)autoconfigure. Please check patches with the command -# -# grep -lE 'Makefile.(am|in)|configure\.ac' *.patch -# -# to surround them with %if ! 0%{?bootstrap} ... %endif -# -############################################################################## # # PATCH-FIX-UPSTREAM avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch lnussel@suse.com bnc#791101 -- avoid assertion if invalid address familily is passed to gethostbyaddr_r Patch0: avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch @@ -238,7 +224,6 @@ Patch93: 0001-Don-t-snprintf-a-potentially-NULL-pointer.patch Patch114: 0001-systemd-empty-sigmask-on-reexec.patch # PATCH-FIX-SUSE 0001-make-209-working-on-older-dist.patch werner@suse.com Patch117: 0001-make-209-working-on-older-dist.patch -Patch118: 0002-make-209-working-on-older-dist.patch # PATCH-FIX-SUSE 0001-make-fortify-happy-with-ppoll.patch werner@suse.com Patch119: 0001-make-fortify-happy-with-ppoll.patch # PATCH-FIX-SUSE 0001-avoid-abort-due-timeout-at-user-service.patch werner@suse.com @@ -579,18 +564,11 @@ cp %{SOURCE7} m4/ # systemd patches %patch0 -p1 -%if ! 0%{?bootstrap} %patch1 -p1 -%endif %patch3 -p1 -# don't apply when bootstrapping to not modify configure.in -%if ! 0%{?bootstrap} %patch4 -p1 -%endif %patch5 -p1 -%if ! 0%{?bootstrap} %patch6 -p1 -%endif %patch7 -p1 %patch8 -p1 %patch9 -p1 @@ -600,9 +578,7 @@ cp %{SOURCE7} m4/ %patch14 -p1 %patch15 -p1 %patch16 -p1 -%if ! 0%{?bootstrap} %patch17 -p1 -%endif %patch18 -p1 %patch19 -p1 %patch20 -p1 @@ -625,19 +601,13 @@ cp %{SOURCE7} m4/ %patch46 -p1 %patch47 -p1 %patch84 -p1 -%if ! 0%{?bootstrap} %patch86 -p1 -%endif %patch90 -p1 %patch91 -p1 %patch93 -p1 %patch114 -p0 %if 0%{?suse_version} <= 1310 -%if ! 0%{?bootstrap} %patch117 -p1 -%else -%patch118 -p1 -%endif %endif %patch119 -p1 %patch120 -p1 @@ -654,9 +624,7 @@ cp %{SOURCE7} m4/ %patch131 -p0 %patch132 -p0 %patch133 -p0 -%if ! 0%{?bootstrap} %patch134 -p0 -%endif %patch135 -p0 %patch136 -p0 %patch137 -p0 @@ -690,19 +658,13 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1018 -p1 %patch1019 -p1 -%if ! 0%{?bootstrap} %patch1020 -p1 -%endif %patch1022 -p1 %patch1023 -p1 %patch1024 -p1 -%if ! 0%{?bootstrap} %patch1999 -p1 -%endif %patch2000 -p1 -%if ! 0%{?bootstrap} %patch2001 -p1 -%endif # udev patches %patch1034 -p0 %patch1035 -p0 @@ -711,23 +673,16 @@ cp %{SOURCE7} m4/ %patch1003 -p1 %patch1005 -p1 %patch1006 -p1 -# don't apply when bootstrapping to not modify Makefile.am -%if ! 0%{?bootstrap} %patch1007 -p1 -%endif %if 0%{?suse_version} <= 1310 -%if ! 0%{?bootstrap} %patch1008 -p1 %endif -%endif # ensure generate files are removed rm -f units/emergency.service %build -%if ! 0%{?bootstrap} autoreconf -fiv -%endif # prevent pre-generated and distributed files from re-building find . -name "*.[1-8]" -exec touch '{}' '+'; export V=1 @@ -1250,9 +1205,7 @@ exit 0 %{_prefix}/lib/systemd/system-generators/systemd-rc-local-generator %{_prefix}/lib/systemd/system-generators/systemd-fstab-generator %{_prefix}/lib/systemd/system-generators/systemd-system-update-generator -%if ! 0%{?bootstrap} %{_prefix}/lib/systemd/system-generators/systemd-insserv-generator -%endif %{_prefix}/lib/systemd/system-generators/systemd-gpt-auto-generator /%{_lib}/security/pam_systemd.so /etc/pam.d/systemd-user @@ -1338,9 +1291,7 @@ exit 0 %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules %endif %{_prefix}/lib/udev/rules.d/99-systemd.rules -%if ! 0%{?bootstrap} %{_prefix}/lib/udev/numlock-on -%endif %if 0%{suse_version} < 1310 %{_sysconfdir}/rpm/macros.systemd %endif diff --git a/systemd.changes b/systemd.changes index b71a4b1..05a8fd3 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Mar 24 11:19:38 UTC 2014 - coolo@suse.com + +- also autoreconf in systemd-mini to simplify spec file logic + and fix build in staging:gcc49 + (obsoleting 0002-make-209-working-on-older-dist.patch) + ------------------------------------------------------------------- Wed Mar 19 13:21:37 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index f871ac2..53196c4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -146,20 +146,6 @@ Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh -############################################################################## -# -# WARNING: For the case of for bootstrapping patch should not affect -# the files -# -# Makefile.am, Makefile.in, and configure.ac -# -# as this triggers an (re)autoconfigure. Please check patches with the command -# -# grep -lE 'Makefile.(am|in)|configure\.ac' *.patch -# -# to surround them with %if ! 0%{?bootstrap} ... %endif -# -############################################################################## # # PATCH-FIX-UPSTREAM avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch lnussel@suse.com bnc#791101 -- avoid assertion if invalid address familily is passed to gethostbyaddr_r Patch0: avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch @@ -233,7 +219,6 @@ Patch93: 0001-Don-t-snprintf-a-potentially-NULL-pointer.patch Patch114: 0001-systemd-empty-sigmask-on-reexec.patch # PATCH-FIX-SUSE 0001-make-209-working-on-older-dist.patch werner@suse.com Patch117: 0001-make-209-working-on-older-dist.patch -Patch118: 0002-make-209-working-on-older-dist.patch # PATCH-FIX-SUSE 0001-make-fortify-happy-with-ppoll.patch werner@suse.com Patch119: 0001-make-fortify-happy-with-ppoll.patch # PATCH-FIX-SUSE 0001-avoid-abort-due-timeout-at-user-service.patch werner@suse.com @@ -574,18 +559,11 @@ cp %{SOURCE7} m4/ # systemd patches %patch0 -p1 -%if ! 0%{?bootstrap} %patch1 -p1 -%endif %patch3 -p1 -# don't apply when bootstrapping to not modify configure.in -%if ! 0%{?bootstrap} %patch4 -p1 -%endif %patch5 -p1 -%if ! 0%{?bootstrap} %patch6 -p1 -%endif %patch7 -p1 %patch8 -p1 %patch9 -p1 @@ -595,9 +573,7 @@ cp %{SOURCE7} m4/ %patch14 -p1 %patch15 -p1 %patch16 -p1 -%if ! 0%{?bootstrap} %patch17 -p1 -%endif %patch18 -p1 %patch19 -p1 %patch20 -p1 @@ -620,19 +596,13 @@ cp %{SOURCE7} m4/ %patch46 -p1 %patch47 -p1 %patch84 -p1 -%if ! 0%{?bootstrap} %patch86 -p1 -%endif %patch90 -p1 %patch91 -p1 %patch93 -p1 %patch114 -p0 %if 0%{?suse_version} <= 1310 -%if ! 0%{?bootstrap} %patch117 -p1 -%else -%patch118 -p1 -%endif %endif %patch119 -p1 %patch120 -p1 @@ -649,9 +619,7 @@ cp %{SOURCE7} m4/ %patch131 -p0 %patch132 -p0 %patch133 -p0 -%if ! 0%{?bootstrap} %patch134 -p0 -%endif %patch135 -p0 %patch136 -p0 %patch137 -p0 @@ -685,19 +653,13 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1018 -p1 %patch1019 -p1 -%if ! 0%{?bootstrap} %patch1020 -p1 -%endif %patch1022 -p1 %patch1023 -p1 %patch1024 -p1 -%if ! 0%{?bootstrap} %patch1999 -p1 -%endif %patch2000 -p1 -%if ! 0%{?bootstrap} %patch2001 -p1 -%endif # udev patches %patch1034 -p0 %patch1035 -p0 @@ -706,23 +668,16 @@ cp %{SOURCE7} m4/ %patch1003 -p1 %patch1005 -p1 %patch1006 -p1 -# don't apply when bootstrapping to not modify Makefile.am -%if ! 0%{?bootstrap} %patch1007 -p1 -%endif %if 0%{?suse_version} <= 1310 -%if ! 0%{?bootstrap} %patch1008 -p1 %endif -%endif # ensure generate files are removed rm -f units/emergency.service %build -%if ! 0%{?bootstrap} autoreconf -fiv -%endif # prevent pre-generated and distributed files from re-building find . -name "*.[1-8]" -exec touch '{}' '+'; export V=1 @@ -1245,9 +1200,7 @@ exit 0 %{_prefix}/lib/systemd/system-generators/systemd-rc-local-generator %{_prefix}/lib/systemd/system-generators/systemd-fstab-generator %{_prefix}/lib/systemd/system-generators/systemd-system-update-generator -%if ! 0%{?bootstrap} %{_prefix}/lib/systemd/system-generators/systemd-insserv-generator -%endif %{_prefix}/lib/systemd/system-generators/systemd-gpt-auto-generator /%{_lib}/security/pam_systemd.so /etc/pam.d/systemd-user @@ -1333,9 +1286,7 @@ exit 0 %{_prefix}/lib/udev/rules.d/73-seat-numlock.rules %endif %{_prefix}/lib/udev/rules.d/99-systemd.rules -%if ! 0%{?bootstrap} %{_prefix}/lib/udev/numlock-on -%endif %if 0%{suse_version} < 1310 %{_sysconfdir}/rpm/macros.systemd %endif From 35f3cd2dabdca3e3003b1392901784687f7a6f156464c72acdd269d0eae89d3c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 25 Mar 2014 13:47:22 +0000 Subject: [PATCH 09/16] Accepting request 227461 from home:tsaupe:branches:Base:System add feature 316824 and address bug 869142 OBS-URL: https://build.opensuse.org/request/show/227461 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=573 --- ...-suspend-hibernate-calls-to-pm-utils.patch | 94 -------- boot-local-start.patch | 12 ++ prepare-suspend-to-disk.patch | 28 +++ systemd-mini.spec | 3 - systemd-sleep-grub | 204 ++++++++++++++++++ systemd.changes | 11 + systemd.spec | 13 +- 7 files changed, 265 insertions(+), 100 deletions(-) delete mode 100644 Forward-suspend-hibernate-calls-to-pm-utils.patch create mode 100644 boot-local-start.patch create mode 100644 prepare-suspend-to-disk.patch create mode 100644 systemd-sleep-grub diff --git a/Forward-suspend-hibernate-calls-to-pm-utils.patch b/Forward-suspend-hibernate-calls-to-pm-utils.patch deleted file mode 100644 index 0c06b4d..0000000 --- a/Forward-suspend-hibernate-calls-to-pm-utils.patch +++ /dev/null @@ -1,94 +0,0 @@ -From: Frederic Crozat -Date: Tue, 19 Feb 2013 11:20:31 +0100 -Subject: Forward suspend / hibernate calls to pm-utils - -forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) ---- - src/sleep/sleep.c | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) - ---- systemd-206.orig/src/sleep/sleep.c -+++ systemd-206/src/sleep/sleep.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #include "systemd/sd-id128.h" - #include "systemd/sd-messages.h" -@@ -35,6 +36,8 @@ - #include "sleep-config.h" - - static char* arg_verb = NULL; -+static bool delegate_to_pmutils = false; -+static const char *pmtools; - - static int write_mode(char **modes) { - int r = 0; -@@ -50,9 +53,6 @@ static int write_mode(char **modes) { - r = k; - } - -- if (r < 0) -- log_error("Failed to write mode to /sys/power/disk: %s", -- strerror(-r)); - - return r; - } -@@ -90,6 +90,8 @@ static int execute(char **modes, char ** - _cleanup_fclose_ FILE *f = NULL; - const char* note = strappenda("SLEEP=", arg_verb); - -+ if (!delegate_to_pmutils) { -+ - /* This file is opened first, so that if we hit an error, - * we can abort before modifying any state. */ - f = fopen("/sys/power/state", "we"); -@@ -102,6 +104,7 @@ static int execute(char **modes, char ** - r = write_mode(modes); - if (r < 0) - return r; -+ } - - arguments[0] = NULL; - arguments[1] = (char*) "pre"; -@@ -114,8 +117,10 @@ static int execute(char **modes, char ** - "MESSAGE=Suspending system...", - note, - NULL); -- -+ if (!delegate_to_pmutils) - r = write_state(&f, states); -+ else -+ r = -system(pmtools); - if (r < 0) - return r; - -@@ -158,6 +163,7 @@ static int parse_argv(int argc, char *ar - }; - - int c; -+ struct stat buf; - - assert(argc >= 0); - assert(argv); -@@ -196,6 +202,18 @@ static int parse_argv(int argc, char *ar - return -EINVAL; - } - -+ if (streq(arg_verb, "suspend")) { -+ pmtools = "/usr/sbin/pm-suspend"; -+ } -+ else if (streq(arg_verb, "hibernate") || streq(arg_verb, "hybrid-sleep")) { -+ if (streq(arg_verb, "hibernate")) -+ pmtools = "/usr/sbin/pm-hibernate"; -+ else -+ pmtools = "/usr/sbin/pm-suspend-hybrid"; -+ } -+ -+ delegate_to_pmutils = (stat(pmtools, &buf) >= 0 && S_ISREG(buf.st_mode) && (buf.st_mode & 0111)); -+ - return 1 /* work to do */; - } - diff --git a/boot-local-start.patch b/boot-local-start.patch new file mode 100644 index 0000000..2f9e9d5 --- /dev/null +++ b/boot-local-start.patch @@ -0,0 +1,12 @@ +diff -Naur systemd-210/units/rc-local.service.in systemd-210-mod/units/rc-local.service.in +--- systemd-210/units/rc-local.service.in 2013-08-13 22:02:52.788756123 +0200 ++++ systemd-210-mod/units/rc-local.service.in 2014-03-25 08:34:40.317587764 +0100 +@@ -10,7 +10,7 @@ + [Unit] + Description=@RC_LOCAL_SCRIPT_PATH_START@ Compatibility + ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_START@ +-After=network.target ++After=basic.target + + [Service] + Type=forking diff --git a/prepare-suspend-to-disk.patch b/prepare-suspend-to-disk.patch new file mode 100644 index 0000000..01f95f9 --- /dev/null +++ b/prepare-suspend-to-disk.patch @@ -0,0 +1,28 @@ +diff -Naur systemd-210/units/systemd-hibernate.service.in systemd-210-mod/units/systemd-hibernate.service.in +--- systemd-210/units/systemd-hibernate.service.in 2013-08-13 22:02:52.808756274 +0200 ++++ systemd-210-mod/units/systemd-hibernate.service.in 2014-03-25 12:27:44.995995220 +0100 +@@ -11,7 +11,10 @@ + DefaultDependencies=no + Requires=sleep.target + After=sleep.target ++ConditionKernelCommandLine=resume + + [Service] + Type=oneshot ++ExecStart=@rootbindir@/systemd-sleep-grub pre + ExecStart=@rootlibexecdir@/systemd-sleep hibernate ++ExecStopPost=@rootbindir@/systemd-sleep-grub post +diff -Naur systemd-210/units/systemd-hybrid-sleep.service.in systemd-210-mod/units/systemd-hybrid-sleep.service.in +--- systemd-210/units/systemd-hybrid-sleep.service.in 2013-08-13 22:02:52.809756282 +0200 ++++ systemd-210-mod/units/systemd-hybrid-sleep.service.in 2014-03-25 12:27:56.115994902 +0100 +@@ -11,7 +11,10 @@ + DefaultDependencies=no + Requires=sleep.target + After=sleep.target ++ConditionKernelCommandLine=resume + + [Service] + Type=oneshot ++ExecStart=@rootbindir@/systemd-sleep-grub pre + ExecStart=@rootlibexecdir@/systemd-sleep hybrid-sleep ++ExecStopPost=@rootbindir@/systemd-sleep-grub post diff --git a/systemd-mini.spec b/systemd-mini.spec index 4263ca9..2437e15 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -202,8 +202,6 @@ Patch42: systemd-pam_config.patch Patch23: disable-nss-myhostname-warning-bnc-783841.patch # PATCH-FIX-OPENSUSE handle-HOSTNAME.patch fcrozat@suse.com -- handle /etc/HOSTNAME (bnc#803653) Patch24: handle-etc-HOSTNAME.patch -# PATCH-FIX-OPENSUSE Forward-suspend-hibernate-calls-to-pm-utils.patch fcrozat@suse.com bnc#790157 -- forward to pm-utils -Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch # PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin @@ -586,7 +584,6 @@ cp %{SOURCE7} m4/ %patch22 -p1 %patch23 -p1 %patch24 -p1 -%patch25 -p1 # check if this is still needed, or can be derived from fbdev uaccess rule # http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html %patch27 -p1 diff --git a/systemd-sleep-grub b/systemd-sleep-grub new file mode 100644 index 0000000..beeed38 --- /dev/null +++ b/systemd-sleep-grub @@ -0,0 +1,204 @@ +#!/bin/bash +# +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. + +set -x + +prepare-parameters() +{ + eval `grep LOADER_TYPE= /etc/sysconfig/bootloader` + + if [ x"$LOADER_TYPE" = "xgrub2" -o x"$LOADER_TYPE" = "xgrub2-efi" ]; then + GRUBONCE="/usr/sbin/grub2-once" + GRUBDEFAULT="/boot/grub2/grubenv" + GRUB2EDITENV="/usr/bin/grub2-editenv" + GRUB2CONF="/boot/grub2/grub.cfg" + BLKID="/usr/sbin/blkid" + getkernels="getkernels-grub2" + fi +} + +##################################################################### +# gets a list of available kernels from /boot/grub2/grub.cfg +# kernels are in the array $KERNELS, output to stdout to be eval-ed. +getkernels-grub2() +{ + local I DUMMY MNT ROOTDEV + declare -i I=0 J=-1 + + # we need the root partition later to decide if this is the kernel to select + while read ROOTDEV MNT DUMMY; do + [ "$ROOTDEV" = "rootfs" ] && continue # not what we are searching for + if [ "$MNT" = "/" ]; then + break + fi + done < /proc/mounts + + while read LINE; do + case $LINE in + menuentry\ *) + let J++ + ;; + set\ default*) + local DEFAULT=${LINE#*default=} + + if echo $DEFAULT | grep -q saved_entry ; then + local SAVED=`$GRUB2EDITENV $GRUBDEFAULT list | sed -n s/^saved_entry=//p` + if [ -n "$SAVED" ]; then + DEFAULT_BOOT=$($GRUBONCE --show-mapped "$SAVED") + fi + fi + + ;; + linux*noresume*) + echo " Skipping grub entry #${J}, because it has the noresume option" >&2 + ;; + linux*root=*) + local ROOT + ROOT=${LINE#*root=} + DUMMY=($ROOT) + ROOT=${DUMMY[0]} + + if [ x"${ROOT:0:5}" = "xUUID=" ]; then + UUID=${ROOT#UUID=} + if [ -n "$UUID" ]; then + ROOT=$($BLKID -U $UUID) + fi + fi + + if [ "$(stat -Lc '%t:%T' $ROOT)" != "$(stat -Lc '%t:%T' $ROOTDEV)" ]; then + echo " Skipping grub entry #${J}, because its root= parameter ($ROOT)" >&2 + echo " does not match the current root device ($ROOTDEV)." >&2 + continue + fi + DUMMY=($LINE) # kernel (hd0,1)/boot/vmlinuz-ABC root=/dev/hda2 + echo "KERNELS[$I]='${DUMMY[1]##*/}'" # vmlinuz-ABC + echo "MENU_ENTRIES[$I]=$J" + # DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO + let I++ + ;; + linux*) + # a kernel without "root="? We better skip that one... + echo " Skipping grub entry #${J}, because it has no root= option" >&2 + ;; + *) ;; + esac + done < "$GRUB2CONF" +} + +############################################################# +# runs grubonce from the grub package to select which kernel +# to boot on next startup +grub-once() +{ + if [ -x "$GRUBONCE" ]; then + echo " running '$GRUBONCE $1'" + $GRUBONCE $1 + else + echo "WARNING: $GRUBONCE not found, not preparing bootloader" + fi +} + +############################################################# +# restore grub default after (eventually failed) resume +grub-once-restore() +{ + echo "INFO: running grub-once-restore" + prepare-parameters + $GRUB2EDITENV $GRUBDEFAULT unset next_entry +} + +############################################################################# +# try to find a kernel image that matches the actually running kernel. +# We need this, if more than one kernel is installed. This works reasonably +# well with grub, if all kernels are named "vmlinuz-`uname -r`" and are +# located in /boot. If they are not, good luck ;-) +find-kernel-entry() +{ + NEXT_BOOT=-1 + ARCH=`uname -m` + declare -i I=0 + # DEBUG "running kernel: $RUNNING" DIAG + while [ -n "${KERNELS[$I]}" ]; do + BOOTING="${KERNELS[$I]}" + if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then + # DEBUG "Found kernel symlink $BOOTING => $IMAGE" INFO + BOOTING=$IMAGE + fi + case $ARCH in + ppc*) BOOTING="${BOOTING#*vmlinux-}" ;; + *) BOOTING="${BOOTING#*vmlinuz-}" ;; + esac + if [ "$RUNNING" == "$BOOTING" ]; then + NEXT_BOOT=${MENU_ENTRIES[$I]} + echo " running kernel is grub menu entry $NEXT_BOOT (${KERNELS[$I]})" + break + fi + let I++ + done + # if we have not found a kernel, issue a warning. + # if we have found a kernel, we'll do "grub-once" later, after + # prepare_suspend finished. + if [ $NEXT_BOOT -eq -1 ]; then + echo "WARNING: no kernelfile matching the running kernel found" + fi +} + +############################################################################# +# if we did not find a kernel (or BOOT_LOADER is not GRUB) check, +# if the running kernel is still the one that will (probably) be booted for +# resume (default entry in menu.lst or, if there is none, the kernel file +# /boot/vmlinuz points to.) +# This will only work, if you use "original" SUSE kernels. +# you can always override with the config variable set to "yes" +prepare-grub() +{ + echo "INFO: running prepare-grub" + prepare-parameters + eval `$getkernels` + RUNNING=`uname -r` + find-kernel-entry + + RET=0 + + if [ $NEXT_BOOT -eq -1 ]; then + # which kernel is booted with the default entry? + BOOTING="${KERNELS[$DEFAULT_BOOT]}" + # if there is no default entry (no menu.lst?) we fall back to + # the default of /boot/vmlinuz. + [ -z "$BOOTING" ] && BOOTING="vmlinuz" + if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then + BOOTING=$IMAGE + fi + BOOTING="${BOOTING#*vmlinuz-}" + echo "running kernel: '$RUNNING', probably booting kernel: '$BOOTING'" + if [ "$BOOTING" != "$RUNNING" ]; then + echo "ERROR: kernel version mismatch, cannot suspend to disk" + echo "running: $RUNNING booting: $BOOTING" >> $INHIBIT + RET=1 + fi + else + # set the bootloader to the running kernel + echo " preparing boot-loader: selecting entry $NEXT_BOOT, kernel /boot/$BOOTING" + T1=`date +"%s%N"` + sync; sync; sync # this is needed to speed up grub-once on reiserfs + T2=`date +"%s%N"` + echo " grub-once: `grub-once $NEXT_BOOT`" + T3=`date +"%s%N"` + S=$(((T2-T1)/100000000)); S="$((S/10)).${S:0-1}" + G=$(((T3-T2)/100000000)); G="$((G/10)).${G:0-1}" + echo " time needed for sync: $S seconds, time needed for grub: $G seconds." + fi + + return $RET +} + + +###### main() + +if [ "$1" = pre ] ; then + prepare-grub +fi +if [ "$1" = post ] ; then + grub-once-restore +fi diff --git a/systemd.changes b/systemd.changes index 05a8fd3..67a6c41 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Mar 25 13:08:56 UTC 2014 - thomas.blume@suse.com + +- add prepare-suspend-to-disk.patch + enable suspend conditions check and preparation for systemd-sleep + (fate#316824, bnc#856389, bnc#856392) +- remove Forward-suspend-hibernate-calls-to-pm-utils.patch since it is obsolete + (bnc#856392#c20) +- add boot-local-start.patch + fix startup for /etc/init.d/boot.local (bnc#869142) + ------------------------------------------------------------------- Mon Mar 24 11:19:38 UTC 2014 - coolo@suse.com diff --git a/systemd.spec b/systemd.spec index 53196c4..ab0ab6c 100644 --- a/systemd.spec +++ b/systemd.spec @@ -145,6 +145,7 @@ Source1060: boot.udev Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh +Source1064: systemd-sleep-grub # # PATCH-FIX-UPSTREAM avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch lnussel@suse.com bnc#791101 -- avoid assertion if invalid address familily is passed to gethostbyaddr_r @@ -197,8 +198,6 @@ Patch42: systemd-pam_config.patch Patch23: disable-nss-myhostname-warning-bnc-783841.patch # PATCH-FIX-OPENSUSE handle-HOSTNAME.patch fcrozat@suse.com -- handle /etc/HOSTNAME (bnc#803653) Patch24: handle-etc-HOSTNAME.patch -# PATCH-FIX-OPENSUSE Forward-suspend-hibernate-calls-to-pm-utils.patch fcrozat@suse.com bnc#790157 -- forward to pm-utils -Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch # PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin @@ -325,6 +324,11 @@ Patch1022: 1022-systemd-tmpfiles-ownerkeep.patch Patch1023: systemd-powerd-initctl-support.patch # PATCH-FIX-SUSE systemctl-set-default-target.patch Patch1024: systemctl-set-default-target.patch +# PATCH-FIX-SUSE prepare-suspend-to-disk.patch (fate #316824) +Patch1025: prepare-suspend-to-disk.patch +# PATCH-FIX-SUSE boot-local-start.patch (bnc #869142) +Patch1026: boot-local-start.patch + # PATCH-FIX-SUSE systemd-install-compat_pkgconfig-always.patch Patch1999: systemd-install-compat_pkgconfig-always.patch # PATCH-FIX-OPENSUSE systemd-dbus-system-bus-address.patch always use /run/dbus not /var/run @@ -581,7 +585,6 @@ cp %{SOURCE7} m4/ %patch22 -p1 %patch23 -p1 %patch24 -p1 -%patch25 -p1 # check if this is still needed, or can be derived from fbdev uaccess rule # http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html %patch27 -p1 @@ -657,6 +660,8 @@ cp %{SOURCE7} m4/ %patch1022 -p1 %patch1023 -p1 %patch1024 -p1 +%patch1025 -p1 +%patch1026 -p1 %patch1999 -p1 %patch2000 -p1 %patch2001 -p1 @@ -771,6 +776,7 @@ install -m755 -D %{S:1061} %{buildroot}/%{_prefix}/lib/udev/write_dev_root_rule sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} %{buildroot}/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-peristent-rule +install -m755 -D %{S:1064} %{buildroot}/%{_bindir}/systemd-sleep-grub mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants rm -rf %{buildroot}%{_sysconfdir}/rpm @@ -1107,6 +1113,7 @@ exit 0 /bin/systemd /bin/systemd-ask-password /bin/systemctl +%{_bindir}/systemd-sleep-grub %{_bindir}/bootctl %{_bindir}/busctl %{_bindir}/kernel-install From 3556bf6f5f6a648146a4538ec7a47813c08ad250719764e9a53c520e7507d856 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 25 Mar 2014 17:29:50 +0000 Subject: [PATCH 10/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=574 --- ...-suspend-hibernate-calls-to-pm-utils.patch | 94 +++++++++++++++++++ ...andom-hangs-on-timeouts-due-lost-cwd.patch | 23 +++++ systemd-mini.changes | 20 ++++ systemd-mini.spec | 18 ++++ systemd.changes | 9 ++ systemd.spec | 8 ++ 6 files changed, 172 insertions(+) create mode 100644 Forward-suspend-hibernate-calls-to-pm-utils.patch create mode 100644 avoid-random-hangs-on-timeouts-due-lost-cwd.patch diff --git a/Forward-suspend-hibernate-calls-to-pm-utils.patch b/Forward-suspend-hibernate-calls-to-pm-utils.patch new file mode 100644 index 0000000..3b50d50 --- /dev/null +++ b/Forward-suspend-hibernate-calls-to-pm-utils.patch @@ -0,0 +1,94 @@ +From: Frederic Crozat +Date: Tue, 19 Feb 2013 11:20:31 +0100 +Subject: Forward suspend / hibernate calls to pm-utils + +forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) +--- + src/sleep/sleep.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +--- systemd-206.orig/src/sleep/sleep.c ++++ systemd-206/src/sleep/sleep.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "systemd/sd-id128.h" + #include "systemd/sd-messages.h" +@@ -35,6 +36,8 @@ + #include "sleep-config.h" + + static char* arg_verb = NULL; ++static bool delegate_to_pmutils = false; ++static const char *pmtools; + + static int write_mode(char **modes) { + int r = 0; +@@ -50,9 +53,6 @@ static int write_mode(char **modes) { + r = k; + } + +- if (r < 0) +- log_error("Failed to write mode to /sys/power/disk: %s", +- strerror(-r)); + + return r; + } +@@ -90,6 +90,8 @@ static int execute(char **modes, char ** + FILE *f; + const char* note = strappenda("SLEEP=", arg_verb); + ++ if (!delegate_to_pmutils) { ++ + /* This file is opened first, so that if we hit an error, + * we can abort before modyfing any state. */ + f = fopen("/sys/power/state", "we"); +@@ -102,6 +104,7 @@ static int execute(char **modes, char ** + r = write_mode(modes); + if (r < 0) + return r; ++ } + + arguments[0] = NULL; + arguments[1] = (char*) "pre"; +@@ -114,8 +117,10 @@ static int execute(char **modes, char ** + "MESSAGE=Suspending system...", + note, + NULL); +- ++ if (!delegate_to_pmutils) + r = write_state(f, states); ++ else ++ r = -system(pmtools); + if (r < 0) + return r; + +@@ -158,6 +163,7 @@ static int parse_argv(int argc, char *ar + }; + + int c; ++ struct stat buf; + + assert(argc >= 0); + assert(argv); +@@ -196,6 +202,18 @@ static int parse_argv(int argc, char *ar + return -EINVAL; + } + ++ if (streq(arg_verb, "suspend")) { ++ pmtools = "/usr/sbin/pm-suspend"; ++ } ++ else if (streq(arg_verb, "hibernate") || streq(arg_verb, "hybrid-sleep")) { ++ if (streq(arg_verb, "hibernate")) ++ pmtools = "/usr/sbin/pm-hibernate"; ++ else ++ pmtools = "/usr/sbin/pm-suspend-hybrid"; ++ } ++ ++ delegate_to_pmutils = (stat(pmtools, &buf) >= 0 && S_ISREG(buf.st_mode) && (buf.st_mode & 0111)); ++ + return 1 /* work to do */; + } + diff --git a/avoid-random-hangs-on-timeouts-due-lost-cwd.patch b/avoid-random-hangs-on-timeouts-due-lost-cwd.patch new file mode 100644 index 0000000..3e11c29 --- /dev/null +++ b/avoid-random-hangs-on-timeouts-due-lost-cwd.patch @@ -0,0 +1,23 @@ +Found this during debugging an other problem. The issue was that +after ``sudo -i'' and a ``cd /usr/lib/systemd/system/'' followed +later by a shutdown may fail with (journalctl -b -1): + + systemd-exit.service: Failed at step CHDIR spawning: /usr/bin/kill + +which then caused the subsequent fault that umounting the users +home directories done by automount are busy. + +--- systemd-210/units/user/systemd-exit.service.in ++++ systemd-210/units/user/systemd-exit.service.in 2014-03-25 16:59:20.406235916 +0000 +@@ -10,8 +10,9 @@ Description=Exit the Session + Documentation=man:systemd.special(7) + DefaultDependencies=no + Requires=shutdown.target +-After=shutdown.target ++After=shutdown.target multi-user.target + + [Service] + Type=oneshot +-ExecStart=@KILL@ -s 58 $MANAGERPID ++WorkingDirectory=/ ++ExecStart=@KILL@ -s SIGRTMIN+24 $MANAGERPID diff --git a/systemd-mini.changes b/systemd-mini.changes index 05a8fd3..0d51ff1 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Tue Mar 25 17:28:18 UTC 2014 - werner@suse.de + +- Readd patch Forward-suspend-hibernate-calls-to-pm-utils.patch + older code base as 13.1 only +- Add patch avoid-random-hangs-on-timeouts-due-lost-cwd.patch + to be able to terminate the user manager even if cwd of the + user is gone + +------------------------------------------------------------------- +Tue Mar 25 13:08:56 UTC 2014 - thomas.blume@suse.com + +- add prepare-suspend-to-disk.patch + enable suspend conditions check and preparation for systemd-sleep + (fate#316824, bnc#856389, bnc#856392) +- remove Forward-suspend-hibernate-calls-to-pm-utils.patch since it is obsolete + (bnc#856392#c20) +- add boot-local-start.patch + fix startup for /etc/init.d/boot.local (bnc#869142) + ------------------------------------------------------------------- Mon Mar 24 11:19:38 UTC 2014 - coolo@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 2437e15..96f4a24 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -150,6 +150,7 @@ Source1060: boot.udev Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh +Source1064: systemd-sleep-grub # # PATCH-FIX-UPSTREAM avoid-assertion-if-invalid-address-familily-is-passed-to-g.patch lnussel@suse.com bnc#791101 -- avoid assertion if invalid address familily is passed to gethostbyaddr_r @@ -202,6 +203,8 @@ Patch42: systemd-pam_config.patch Patch23: disable-nss-myhostname-warning-bnc-783841.patch # PATCH-FIX-OPENSUSE handle-HOSTNAME.patch fcrozat@suse.com -- handle /etc/HOSTNAME (bnc#803653) Patch24: handle-etc-HOSTNAME.patch +# PATCH-FIX-OPENSUSE forward to pm-utils -- for code base <= 1310 +Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch # PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin @@ -328,6 +331,13 @@ Patch1022: 1022-systemd-tmpfiles-ownerkeep.patch Patch1023: systemd-powerd-initctl-support.patch # PATCH-FIX-SUSE systemctl-set-default-target.patch Patch1024: systemctl-set-default-target.patch +# PATCH-FIX-SUSE prepare-suspend-to-disk.patch (fate #316824) +Patch1025: prepare-suspend-to-disk.patch +# PATCH-FIX-SUSE boot-local-start.patch (bnc #869142) +Patch1026: boot-local-start.patch +# PATCH-FIX-SUSE avoid random hangs on timeouts due lost cwd at terminating user manager +Patch1027: avoid-random-hangs-on-timeouts-due-lost-cwd.patch + # PATCH-FIX-SUSE systemd-install-compat_pkgconfig-always.patch Patch1999: systemd-install-compat_pkgconfig-always.patch # PATCH-FIX-OPENSUSE systemd-dbus-system-bus-address.patch always use /run/dbus not /var/run @@ -584,6 +594,9 @@ cp %{SOURCE7} m4/ %patch22 -p1 %patch23 -p1 %patch24 -p1 +%if 0%{?suse_version} <= 1310 +%patch25 -p1 +%endif # check if this is still needed, or can be derived from fbdev uaccess rule # http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html %patch27 -p1 @@ -659,6 +672,9 @@ cp %{SOURCE7} m4/ %patch1022 -p1 %patch1023 -p1 %patch1024 -p1 +%patch1025 -p1 +%patch1026 -p1 +%patch1027 -p1 %patch1999 -p1 %patch2000 -p1 %patch2001 -p1 @@ -773,6 +789,7 @@ install -m755 -D %{S:1061} %{buildroot}/%{_prefix}/lib/udev/write_dev_root_rule sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1062} install -m644 -D %{S:1062} %{buildroot}/%{_prefix}/lib/systemd/system/systemd-udev-root-symlink.service install -m755 -D %{S:1063} %{buildroot}/%{_prefix}/lib/udev/udev-generate-peristent-rule +install -m755 -D %{S:1064} %{buildroot}/%{_bindir}/systemd-sleep-grub mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants ln -sf ../systemd-udev-root-symlink.service %{buildroot}/%{_prefix}/lib/systemd/system/basic.target.wants rm -rf %{buildroot}%{_sysconfdir}/rpm @@ -1109,6 +1126,7 @@ exit 0 /bin/systemd /bin/systemd-ask-password /bin/systemctl +%{_bindir}/systemd-sleep-grub %{_bindir}/bootctl %{_bindir}/busctl %{_bindir}/kernel-install diff --git a/systemd.changes b/systemd.changes index 67a6c41..0d51ff1 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Mar 25 17:28:18 UTC 2014 - werner@suse.de + +- Readd patch Forward-suspend-hibernate-calls-to-pm-utils.patch + older code base as 13.1 only +- Add patch avoid-random-hangs-on-timeouts-due-lost-cwd.patch + to be able to terminate the user manager even if cwd of the + user is gone + ------------------------------------------------------------------- Tue Mar 25 13:08:56 UTC 2014 - thomas.blume@suse.com diff --git a/systemd.spec b/systemd.spec index ab0ab6c..40d19eb 100644 --- a/systemd.spec +++ b/systemd.spec @@ -198,6 +198,8 @@ Patch42: systemd-pam_config.patch Patch23: disable-nss-myhostname-warning-bnc-783841.patch # PATCH-FIX-OPENSUSE handle-HOSTNAME.patch fcrozat@suse.com -- handle /etc/HOSTNAME (bnc#803653) Patch24: handle-etc-HOSTNAME.patch +# PATCH-FIX-OPENSUSE forward to pm-utils -- for code base <= 1310 +Patch25: Forward-suspend-hibernate-calls-to-pm-utils.patch # PATCH-FIX-UPSTREAM rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch rjschwei@suse.com -- add lid switch of ARM based Chromebook as a power switch to logind Patch38: rules-add-lid-switch-of-ARM-based-Chromebook-as-a-power-sw.patch # PATCH-FIX-OPENSUSE use-usr-sbin-sulogin-for-emergency-service.patch arvidjaar@gmail.com -- fix path to sulogin @@ -328,6 +330,8 @@ Patch1024: systemctl-set-default-target.patch Patch1025: prepare-suspend-to-disk.patch # PATCH-FIX-SUSE boot-local-start.patch (bnc #869142) Patch1026: boot-local-start.patch +# PATCH-FIX-SUSE avoid random hangs on timeouts due lost cwd at terminating user manager +Patch1027: avoid-random-hangs-on-timeouts-due-lost-cwd.patch # PATCH-FIX-SUSE systemd-install-compat_pkgconfig-always.patch Patch1999: systemd-install-compat_pkgconfig-always.patch @@ -585,6 +589,9 @@ cp %{SOURCE7} m4/ %patch22 -p1 %patch23 -p1 %patch24 -p1 +%if 0%{?suse_version} <= 1310 +%patch25 -p1 +%endif # check if this is still needed, or can be derived from fbdev uaccess rule # http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html %patch27 -p1 @@ -662,6 +669,7 @@ cp %{SOURCE7} m4/ %patch1024 -p1 %patch1025 -p1 %patch1026 -p1 +%patch1027 -p1 %patch1999 -p1 %patch2000 -p1 %patch2001 -p1 From 0a942ee324e60de4e769704a3db5fc8c3943933750c1165389b16b96e20f84eb Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 25 Mar 2014 17:32:44 +0000 Subject: [PATCH 11/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=575 --- Forward-suspend-hibernate-calls-to-pm-utils.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Forward-suspend-hibernate-calls-to-pm-utils.patch b/Forward-suspend-hibernate-calls-to-pm-utils.patch index 3b50d50..0c06b4d 100644 --- a/Forward-suspend-hibernate-calls-to-pm-utils.patch +++ b/Forward-suspend-hibernate-calls-to-pm-utils.patch @@ -37,13 +37,13 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) return r; } @@ -90,6 +90,8 @@ static int execute(char **modes, char ** - FILE *f; + _cleanup_fclose_ FILE *f = NULL; const char* note = strappenda("SLEEP=", arg_verb); + if (!delegate_to_pmutils) { + /* This file is opened first, so that if we hit an error, - * we can abort before modyfing any state. */ + * we can abort before modifying any state. */ f = fopen("/sys/power/state", "we"); @@ -102,6 +104,7 @@ static int execute(char **modes, char ** r = write_mode(modes); @@ -59,7 +59,7 @@ forward suspend/hibernation calls to pm-utils, if installed (bnc#790157) NULL); - + if (!delegate_to_pmutils) - r = write_state(f, states); + r = write_state(&f, states); + else + r = -system(pmtools); if (r < 0) From a21641449afca4664bb419626737574db68b2f707c7f5f184105ee2a1bb3bb99 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 28 Mar 2014 08:11:51 +0000 Subject: [PATCH 12/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=576 --- 1006-udev-always-rename-network.patch | 103 ++++++++++++++++---------- systemd.changes | 5 ++ 2 files changed, 67 insertions(+), 41 deletions(-) diff --git a/1006-udev-always-rename-network.patch b/1006-udev-always-rename-network.patch index 1cbbda7..2187203 100644 --- a/1006-udev-always-rename-network.patch +++ b/1006-udev-always-rename-network.patch @@ -9,55 +9,76 @@ Date: Tue, 4 Mar 2014 10:29:21 +0000 Port the patch of Robert to systemd v210 and test it out. --- - udev-event.c | 40 ++++++++++++++++++++++++++++++++++++---- - 1 file changed, 36 insertions(+), 4 deletions(-) + udev-event.c | 43 +++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 39 insertions(+), 4 deletions(-) ---- systemd-210/src/udev/udev-event.c -+++ systemd-210/src/udev/udev-event.c 2014-03-04 11:19:50.583710411 +0100 -@@ -765,10 +765,42 @@ static int rename_netif(struct udev_even +--- src/udev/udev-event.c ++++ src/udev/udev-event.c 2014-03-27 13:19:06.727748307 +0000 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "udev.h" + #include "rtnl-util.h" +@@ -750,8 +751,9 @@ static int rename_netif(struct udev_even + struct udev_device *dev = event->dev; + _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; + char name[IFNAMSIZ]; ++ char interim[IFNAMSIZ], *ptr = &interim[0]; + const char *oldname; +- int r; ++ int r, loop; + + oldname = udev_device_get_sysname(dev); + +@@ -765,12 +767,45 @@ static int rename_netif(struct udev_even return r; r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name); - if (r < 0) -- log_error("error changing net interface name %s to %s: %s", -- oldname, name, strerror(-r)); ++ if (r == 0) { ++ print_kmsg("renamed network interface %s to %s\n", oldname, name); ++ return r; ++ } else if (r != -EEXIST) { + log_error("error changing net interface name %s to %s: %s", + oldname, name, strerror(-r)); - else -+ if (r < 0) { -+ char interim[IFNAMSIZ], *ptr = &interim[0]; -+ int loop = 90; +- print_kmsg("renamed network interface %s to %s", oldname, name); ++ return r; ++ } ++ ++ /* free our own name, another process may wait for us */ ++ strpcpyf(&ptr, IFNAMSIZ, "rename%u", udev_device_get_ifindex(dev)); ++ ++ r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), interim); ++ if (r < 0) { ++ log_error("error changing net interface name %s to %s: %s", ++ oldname, interim, strerror(-r)); ++ return r; ++ } + ++ /* log temporary name */ ++ print_kmsg("renamed network interface %s to %s\n", oldname, interim); ++ ++ loop = 90 * 20; ++ while (loop--) { ++ const struct timespec duration = { 0, 1000 * 1000 * 1000 / 20 }; ++ nanosleep(&duration, NULL); ++ ++ r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name); ++ if (r == 0) { ++ print_kmsg("renamed network interface %s to %s\n", interim, name); ++ break; ++ } + -+ /* keep trying if the destination interface name already exists */ + if (r != -EEXIST) { + log_error("error changing net interface name %s to %s: %s", -+ oldname, name, strerror(-r)); -+ return r; ++ interim, name, strerror(-r)); ++ break; + } -+ -+ /* free our own name, another process may wait for us */ -+ strpcpyf(&ptr, IFNAMSIZ, "rename%u", udev_device_get_ifindex(dev)); -+ -+ r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), interim); -+ if (r < 0) { -+ log_error("error changing net interface name %s to %s: %s", -+ oldname, name, strerror(-r)); -+ return r; -+ } -+ -+ /* log temporary name */ -+ print_kmsg("renamed network interface %s to %s", oldname, interim); -+ do { -+ r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name); -+ if (r == 0) { -+ print_kmsg("renamed network interface %s to %s", oldname, name); -+ return r; -+ } -+ if (r != -EEXIST) { -+ log_error("error changing net interface name %s to %s: %s", -+ oldname, name, strerror(-r)); -+ return r; -+ } -+ } while (loop-- > 0); -+ } else - print_kmsg("renamed network interface %s to %s", oldname, name); - ++ } return r; + } + diff --git a/systemd.changes b/systemd.changes index 0d51ff1..294911d 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 28 08:10:13 UTC 2014 - werner@suse.de + +- Use Robert's revised 1006-udev-always-rename-network.patch + ------------------------------------------------------------------- Tue Mar 25 17:28:18 UTC 2014 - werner@suse.de From 49e36e2499cc21f9d918709a8b5419b836f606255d881096455c3c009275fda1 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 28 Mar 2014 08:17:23 +0000 Subject: [PATCH 13/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=577 --- 1006-udev-always-rename-network.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1006-udev-always-rename-network.patch b/1006-udev-always-rename-network.patch index 2187203..09a9066 100644 --- a/1006-udev-always-rename-network.patch +++ b/1006-udev-always-rename-network.patch @@ -12,8 +12,8 @@ Port the patch of Robert to systemd v210 and test it out. udev-event.c | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) ---- src/udev/udev-event.c -+++ src/udev/udev-event.c 2014-03-27 13:19:06.727748307 +0000 +--- systemd-210/src/udev/udev-event.c ++++ systemd-210/src/udev/udev-event.c 2014-03-27 13:19:06.727748307 +0000 @@ -30,6 +30,7 @@ #include #include From 32f45e293f8a58bc74c1447573795195e86ad5e3b031334793b85fefcaa4d9a7 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 28 Mar 2014 08:34:59 +0000 Subject: [PATCH 14/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=578 --- 1006-udev-always-rename-network.patch | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/1006-udev-always-rename-network.patch b/1006-udev-always-rename-network.patch index 09a9066..eb98cc2 100644 --- a/1006-udev-always-rename-network.patch +++ b/1006-udev-always-rename-network.patch @@ -9,20 +9,13 @@ Date: Tue, 4 Mar 2014 10:29:21 +0000 Port the patch of Robert to systemd v210 and test it out. --- - udev-event.c | 43 +++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 39 insertions(+), 4 deletions(-) + udev-event.c | 42 ++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 38 insertions(+), 4 deletions(-) + --- systemd-210/src/udev/udev-event.c +++ systemd-210/src/udev/udev-event.c 2014-03-27 13:19:06.727748307 +0000 -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include "udev.h" - #include "rtnl-util.h" -@@ -750,8 +751,9 @@ static int rename_netif(struct udev_even +@@ -750,8 +750,9 @@ static int rename_netif(struct udev_even struct udev_device *dev = event->dev; _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL; char name[IFNAMSIZ]; @@ -33,7 +26,7 @@ Port the patch of Robert to systemd v210 and test it out. oldname = udev_device_get_sysname(dev); -@@ -765,12 +767,45 @@ static int rename_netif(struct udev_even +@@ -765,12 +766,45 @@ static int rename_netif(struct udev_even return r; r = rtnl_set_link_name(rtnl, udev_device_get_ifindex(dev), name); From f18e3e577797ad4ab9c3f0bf8a1039d1e0c06bdbe1a37c775fefa9905c8648ea Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 28 Mar 2014 09:05:36 +0000 Subject: [PATCH 15/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=579 --- systemd-mini.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/systemd-mini.changes b/systemd-mini.changes index 0d51ff1..294911d 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 28 08:10:13 UTC 2014 - werner@suse.de + +- Use Robert's revised 1006-udev-always-rename-network.patch + ------------------------------------------------------------------- Tue Mar 25 17:28:18 UTC 2014 - werner@suse.de From c48f3b32925cac92e4f491d8a0b0dba05b25e6a1b8e8d9d85be6c4aad6ad3d15 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 28 Mar 2014 12:59:18 +0000 Subject: [PATCH 16/16] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=580 --- ...t-s-not-OK-to-invoke-alloca-in-loops.patch | 80 +++ ...l-bus-call-on-machine-objects-when-w.patch | 70 +++ ...-assert_return-to-check-for-disconne.patch | 498 ++++++++++++++++++ ...o-relabel-mounts-before-we-loaded-th.patch | 29 + ...daemon-fix-incorrect-variable-access.patch | 25 + ...ization-perturbation-value-right-bef.patch | 75 +++ ...ccidentally-turn-of-watchdog-timer-e.patch | 29 + ...ode-is-long-long-gone-don-t-mention-.patch | 53 ++ ...n-the-user-types-a-overly-long-passw.patch | 33 ++ ...pletion-smart-to-be-able-to-redirect.patch | 2 +- systemd-mini.changes | 18 + systemd-mini.spec | 27 + systemd.changes | 18 + systemd.spec | 27 + 14 files changed, 983 insertions(+), 1 deletion(-) create mode 100644 0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch create mode 100644 0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch create mode 100644 0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch create mode 100644 0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch create mode 100644 0005-sd-daemon-fix-incorrect-variable-access.patch create mode 100644 0006-sd-event-initialization-perturbation-value-right-bef.patch create mode 100644 0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch create mode 100644 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch create mode 100644 0009-ask-password-when-the-user-types-a-overly-long-passw.patch diff --git a/0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch b/0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch new file mode 100644 index 0000000..0684536 --- /dev/null +++ b/0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch @@ -0,0 +1,80 @@ +From a641dcd9bf05418d6a6c165e1c0cff615b4a0f47 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 18 Mar 2014 04:06:36 +0100 +Subject: [PATCH] cgroup: it's not OK to invoke alloca() in loops + +--- + src/core/mount-setup.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git src/core/mount-setup.c src/core/mount-setup.c +index 387030a..c6d3f4b 100644 +--- src/core/mount-setup.c ++++ src/core/mount-setup.c +@@ -216,10 +216,10 @@ int mount_setup_early(void) { + } + + int mount_cgroup_controllers(char ***join_controllers) { +- int r; +- char buf[LINE_MAX]; + _cleanup_set_free_free_ Set *controllers = NULL; + _cleanup_fclose_ FILE *f; ++ char buf[LINE_MAX]; ++ int r; + + /* Mount all available cgroup controllers that are built into the kernel. */ + +@@ -262,6 +262,7 @@ int mount_cgroup_controllers(char ***join_controllers) { + } + + for (;;) { ++ _cleanup_free_ char *options = NULL, *controller = NULL, *where = NULL; + MountPoint p = { + .what = "cgroup", + .type = "cgroup", +@@ -269,7 +270,6 @@ int mount_cgroup_controllers(char ***join_controllers) { + .mode = MNT_IN_CONTAINER, + }; + char ***k = NULL; +- _cleanup_free_ char *options = NULL, *controller; + + controller = set_steal_first(controllers); + if (!controller) +@@ -286,7 +286,7 @@ int mount_cgroup_controllers(char ***join_controllers) { + for (i = *k, j = *k; *i; i++) { + + if (!streq(*i, controller)) { +- char _cleanup_free_ *t; ++ _cleanup_free_ char *t; + + t = set_remove(controllers, *i); + if (!t) { +@@ -308,7 +308,11 @@ int mount_cgroup_controllers(char ***join_controllers) { + controller = NULL; + } + +- p.where = strappenda("/sys/fs/cgroup/", options); ++ where = strappend("/sys/fs/cgroup/", options); ++ if (!where) ++ return log_oom(); ++ ++ p.where = where; + p.options = options; + + r = mount_one(&p, true); +@@ -319,7 +323,11 @@ int mount_cgroup_controllers(char ***join_controllers) { + char **i; + + for (i = *k; *i; i++) { +- char *t = strappenda("/sys/fs/cgroup/", *i); ++ _cleanup_free_ char *t = NULL; ++ ++ t = strappend("/sys/fs/cgroup/", *i); ++ if (!t) ++ return log_oom(); + + r = symlink(options, t); + if (r < 0 && errno != EEXIST) { +-- +1.7.9.2 + diff --git a/0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch b/0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch new file mode 100644 index 0000000..c3381ef --- /dev/null +++ b/0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch @@ -0,0 +1,70 @@ +From de58a50e24a0d55e3bbcc77f8f6170a7322acf52 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 18 Mar 2014 04:43:08 +0100 +Subject: [PATCH] machined: fix Kill() bus call on machine objects when "what" + is specified as "leader" + +--- + src/machine/machine.c | 10 +++++++++- + src/machine/machined-dbus.c | 4 ++-- + src/machine/machined.h | 2 +- + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git src/machine/machine.c src/machine/machine.c +index 4596a80..9a5cc9a 100644 +--- src/machine/machine.c ++++ src/machine/machine.c +@@ -410,7 +410,15 @@ int machine_kill(Machine *m, KillWho who, int signo) { + if (!m->unit) + return -ESRCH; + +- return manager_kill_unit(m->manager, m->unit, who, signo, NULL); ++ if (who == KILL_LEADER) { ++ /* If we shall simply kill the leader, do so directly */ ++ ++ if (kill(m->leader, signo) < 0) ++ return -errno; ++ } ++ ++ /* Otherwise make PID 1 do it for us, for the entire cgroup */ ++ return manager_kill_unit(m->manager, m->unit, signo, NULL); + } + + static const char* const machine_class_table[_MACHINE_CLASS_MAX] = { +diff --git src/machine/machined-dbus.c src/machine/machined-dbus.c +index 09d28bb..9473105 100644 +--- src/machine/machined-dbus.c ++++ src/machine/machined-dbus.c +@@ -655,7 +655,7 @@ int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, c + return 1; + } + +-int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error) { ++int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_error *error) { + assert(manager); + assert(unit); + +@@ -667,7 +667,7 @@ int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo + "KillUnit", + error, + NULL, +- "ssi", unit, who == KILL_LEADER ? "main" : "all", signo); ++ "ssi", unit, "all", signo); + } + + int manager_unit_is_active(Manager *manager, const char *unit) { +diff --git src/machine/machined.h src/machine/machined.h +index d4b581b..2dba303 100644 +--- src/machine/machined.h ++++ src/machine/machined.h +@@ -67,6 +67,6 @@ int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_b + + int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, sd_bus_message *more_properties, sd_bus_error *error, char **job); + int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); +-int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error); ++int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_error *error); + int manager_unit_is_active(Manager *manager, const char *unit); + int manager_job_is_active(Manager *manager, const char *path); +-- +1.7.9.2 + diff --git a/0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch b/0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch new file mode 100644 index 0000000..72455f2 --- /dev/null +++ b/0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch @@ -0,0 +1,498 @@ +From a3d59cd1b0a2738d06893948492113f2c35be0af Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 19 Mar 2014 21:41:21 +0100 +Subject: [PATCH] sd-bus: don't use assert_return() to check for disconnected + bus connections + +A terminated connection is a runtime error and not a developer mistake, +hence don't use assert_return() to check for it. +--- + src/libsystemd/sd-bus/bus-control.c | 20 +++++++++++++----- + src/libsystemd/sd-bus/bus-convenience.c | 58 +++++++++++++++++++++++++++++++++++++++++------------- + src/libsystemd/sd-bus/bus-objects.c | 23 +++++++++++++++------ + src/libsystemd/sd-bus/sd-bus.c | 49 +++++++++++++++++++++++++++++++++------------ + 4 files changed, 113 insertions(+), 37 deletions(-) + +--- src/libsystemd/sd-bus/bus-control.c ++++ src/libsystemd/sd-bus/bus-control.c 2014-03-28 00:00:00.000000000 +0000 +@@ -128,12 +128,14 @@ _public_ int sd_bus_request_name(sd_bus + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(bus->bus_client, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(!(flags & ~(SD_BUS_NAME_ALLOW_REPLACEMENT|SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_QUEUE)), -EINVAL); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(name[0] != ':', -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_request_name_kernel(bus, name, flags); + else +@@ -201,11 +203,13 @@ _public_ int sd_bus_release_name(sd_bus + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(bus->bus_client, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(name[0] != ':', -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_release_name_kernel(bus, name); + else +@@ -344,9 +348,11 @@ static int bus_list_names_dbus1(sd_bus * + _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable) { + assert_return(bus, -EINVAL); + assert_return(acquired || activatable, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_list_names_kernel(bus, acquired, activatable); + else +@@ -737,11 +743,13 @@ _public_ int sd_bus_get_owner( + assert_return(name, -EINVAL); + assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP); + assert_return(mask == 0 || creds, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + assert_return(bus->bus_client, -ENODATA); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (bus->is_kernel) + return bus_get_owner_kdbus(bus, name, mask, creds); + else +@@ -1198,10 +1206,12 @@ _public_ int sd_bus_get_owner_machine_id + assert_return(bus, -EINVAL); + assert_return(name, -EINVAL); + assert_return(machine, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + assert_return(service_name_is_valid(name), -EINVAL); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (streq_ptr(name, bus->unique_name)) + return sd_id128_get_machine(machine); + +--- src/libsystemd/sd-bus/bus-convenience.c ++++ src/libsystemd/sd-bus/bus-convenience.c 2014-03-28 00:00:00.000000000 +0000 +@@ -36,9 +36,11 @@ _public_ int sd_bus_emit_signal( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_signal(bus, &m, path, interface, member); + if (r < 0) + return r; +@@ -70,9 +72,11 @@ _public_ int sd_bus_call_method( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_method_call(bus, &m, destination, path, interface, member); + if (r < 0) + return r; +@@ -100,9 +104,12 @@ _public_ int sd_bus_reply_method_return( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -134,9 +141,12 @@ _public_ int sd_bus_reply_method_error( + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(sd_bus_error_is_set(e), -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -159,9 +169,12 @@ _public_ int sd_bus_reply_method_errorf( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -182,9 +195,12 @@ _public_ int sd_bus_reply_method_errno( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -208,9 +224,12 @@ _public_ int sd_bus_reply_method_errnof( + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); + assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) + return 0; + +@@ -239,9 +258,11 @@ _public_ int sd_bus_get_property( + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(reply, -EINVAL); + assert_return(signature_is_single(type, false), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &rep, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -273,9 +294,11 @@ _public_ int sd_bus_get_property_trivial + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(bus_type_is_trivial(type), -EINVAL); + assert_return(ptr, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -309,9 +332,11 @@ _public_ int sd_bus_get_property_string( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -348,9 +373,11 @@ _public_ int sd_bus_get_property_strv( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member); + if (r < 0) + return r; +@@ -383,9 +410,11 @@ _public_ int sd_bus_set_property( + assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL); + assert_return(member_name_is_valid(member), -EINVAL); + assert_return(signature_is_single(type, false), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = sd_bus_message_new_method_call(bus, &m, destination, path, "org.freedesktop.DBus.Properties", "Set"); + if (r < 0) + return r; +@@ -416,9 +445,12 @@ _public_ int sd_bus_query_sender_creds(s + + assert_return(call, -EINVAL); + assert_return(call->sealed, -EPERM); +- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN); ++ assert_return(call->bus, -EINVAL); + assert_return(!bus_pid_changed(call->bus), -ECHILD); + ++ if (!BUS_IS_OPEN(call->bus->state)) ++ return -ENOTCONN; ++ + c = sd_bus_message_get_creds(call); + + /* All data we need? */ +--- src/libsystemd/sd-bus/bus-objects.c ++++ src/libsystemd/sd-bus/bus-objects.c 2014-03-28 00:00:00.000000000 +0000 +@@ -2196,9 +2196,10 @@ _public_ int sd_bus_emit_properties_chan + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(interface_name_is_valid(interface), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + /* A non-NULL but empty names list means nothing needs to be + generated. A NULL list OTOH indicates that all properties +@@ -2241,9 +2242,11 @@ _public_ int sd_bus_emit_properties_chan + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); + assert_return(interface_name_is_valid(interface), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (!name) + return 0; + +@@ -2361,9 +2364,11 @@ _public_ int sd_bus_emit_interfaces_adde + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (strv_isempty(interfaces)) + return 0; + +@@ -2421,9 +2426,11 @@ _public_ int sd_bus_emit_interfaces_adde + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + interfaces = strv_from_stdarg_alloca(interface); + + return sd_bus_emit_interfaces_added_strv(bus, path, interfaces); +@@ -2435,9 +2442,11 @@ _public_ int sd_bus_emit_interfaces_remo + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (strv_isempty(interfaces)) + return 0; + +@@ -2461,9 +2470,11 @@ _public_ int sd_bus_emit_interfaces_remo + + assert_return(bus, -EINVAL); + assert_return(object_path_is_valid(path), -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + interfaces = strv_from_stdarg_alloca(interface); + + return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces); +--- src/libsystemd/sd-bus/sd-bus.c ++++ src/libsystemd/sd-bus/sd-bus.c 2014-03-28 12:19:27.146736146 +0000 +@@ -1592,10 +1592,12 @@ static int bus_send_internal(sd_bus *bus + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (m->n_fds > 0) { + r = sd_bus_can_send(bus, SD_BUS_TYPE_UNIX_FD); + if (r < 0) +@@ -1671,10 +1673,12 @@ _public_ int sd_bus_send_to(sd_bus *bus, + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + if (!streq_ptr(m->destination, destination)) { + + if (!destination) +@@ -1726,13 +1730,15 @@ _public_ int sd_bus_call_async( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL); + assert_return(callback, -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = hashmap_ensure_allocated(&bus->reply_callbacks, uint64_hash_func, uint64_compare_func); + if (r < 0) + return r; +@@ -1839,13 +1845,15 @@ _public_ int sd_bus_call( + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(m, -EINVAL); + assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL); + assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL); + assert_return(!bus_error_is_dirty(error), -EINVAL); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; ++ + r = bus_ensure_running(bus); + if (r < 0) + return r; +@@ -1971,9 +1979,11 @@ _public_ int sd_bus_get_events(sd_bus *b + int flags = 0; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING) ++ return -ENOTCONN; ++ + if (bus->state == BUS_OPENING) + flags |= POLLOUT; + else if (bus->state == BUS_AUTHENTICATING) { +@@ -1998,9 +2008,11 @@ _public_ int sd_bus_get_timeout(sd_bus * + + assert_return(bus, -EINVAL); + assert_return(timeout_usec, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); + ++ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING) ++ return -ENOTCONN; ++ + if (bus->state == BUS_CLOSING) { + *timeout_usec = 0; + return 1; +@@ -2510,7 +2522,8 @@ static int bus_poll(sd_bus *bus, bool ne + if (bus->state == BUS_CLOSING) + return 1; + +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + e = sd_bus_get_events(bus); + if (e < 0) +@@ -2565,7 +2578,8 @@ _public_ int sd_bus_wait(sd_bus *bus, ui + if (bus->state == BUS_CLOSING) + return 0; + +- assert_return(BUS_IS_OPEN(bus->state) , -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (bus->rqueue_size > 0) + return 0; +@@ -2582,7 +2596,8 @@ _public_ int sd_bus_flush(sd_bus *bus) { + if (bus->state == BUS_CLOSING) + return 0; + +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + r = bus_ensure_running(bus); + if (r < 0) +@@ -3058,9 +3073,13 @@ _public_ int sd_bus_get_peer_creds(sd_bu + assert_return(bus, -EINVAL); + assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP); + assert_return(ret, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); +- assert_return(!bus->is_kernel, -ENOTSUP); ++ ++ if (!bus->is_kernel) ++ return -ENOTSUP; ++ ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (!bus->ucred_valid && !isempty(bus->label)) + return -ENODATA; +@@ -3099,9 +3118,13 @@ _public_ int sd_bus_try_close(sd_bus *bu + int r; + + assert_return(bus, -EINVAL); +- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN); + assert_return(!bus_pid_changed(bus), -ECHILD); +- assert_return(bus->is_kernel, -ENOTSUP); ++ ++ if (!bus->is_kernel) ++ return -ENOTSUP; ++ ++ if (!BUS_IS_OPEN(bus->state)) ++ return -ENOTCONN; + + if (bus->rqueue_size > 0) + return -EBUSY; diff --git a/0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch b/0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch new file mode 100644 index 0000000..17d7f26 --- /dev/null +++ b/0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch @@ -0,0 +1,29 @@ +From c4bfd1691f4d3e26d6d7f34dbca941e119956e8a Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 24 Mar 2014 21:04:02 +0100 +Subject: [PATCH] core: don't try to relabel mounts before we loaded the + policy + +--- + src/core/mount-setup.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git src/core/mount-setup.c src/core/mount-setup.c +index 147333a..0a45b24 100644 +--- src/core/mount-setup.c ++++ src/core/mount-setup.c +@@ -172,7 +172,10 @@ static int mount_one(const MountPoint *p, bool relabel) { + + /* The access mode here doesn't really matter too much, since + * the mounted file system will take precedence anyway. */ +- mkdir_p_label(p->where, 0755); ++ if (relabel) ++ mkdir_p_label(p->where, 0755); ++ else ++ mkdir_p(p->where, 0755); + + log_debug("Mounting %s to %s of type %s with options %s.", + p->what, +-- +1.7.9.2 + diff --git a/0005-sd-daemon-fix-incorrect-variable-access.patch b/0005-sd-daemon-fix-incorrect-variable-access.patch new file mode 100644 index 0000000..99a923b --- /dev/null +++ b/0005-sd-daemon-fix-incorrect-variable-access.patch @@ -0,0 +1,25 @@ +From 56dc9aec21ab23f76fadf45585adf88e71aa8078 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 24 Mar 2014 23:54:14 +0100 +Subject: [PATCH] sd-daemon: fix incorrect variable access + +--- + src/libsystemd/sd-daemon/sd-daemon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/libsystemd/sd-daemon/sd-daemon.c src/libsystemd/sd-daemon/sd-daemon.c +index 21fb346..b013438 100644 +--- src/libsystemd/sd-daemon/sd-daemon.c ++++ src/libsystemd/sd-daemon/sd-daemon.c +@@ -517,7 +517,7 @@ _public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) { + r = -errno; + goto finish; + } +- if (!p || p == e || *p || l <= 0) { ++ if (!p || p == e || *p || ll <= 0) { + r = -EINVAL; + goto finish; + } +-- +1.7.9.2 + diff --git a/0006-sd-event-initialization-perturbation-value-right-bef.patch b/0006-sd-event-initialization-perturbation-value-right-bef.patch new file mode 100644 index 0000000..a561cab --- /dev/null +++ b/0006-sd-event-initialization-perturbation-value-right-bef.patch @@ -0,0 +1,75 @@ +From 52444dc478fe38b5b69a771923ab429a41927aa5 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 24 Mar 2014 23:54:21 +0100 +Subject: [PATCH] sd-event: initialization perturbation value right before we + use it + +That way, we don't forget to initialize it when the watchdog is +initialized before all event sources. +--- + src/libsystemd/sd-event/sd-event.c | 34 +++++++++++++++++++++------------- + 1 file changed, 21 insertions(+), 13 deletions(-) + +--- src/libsystemd/sd-event/sd-event.c ++++ src/libsystemd/sd-event/sd-event.c 2014-03-28 12:44:05.652327044 +0000 +@@ -648,13 +648,31 @@ _public_ int sd_event_add_io( + return 0; + } + ++static void initialize_perturb(sd_event *e) { ++ sd_id128_t bootid = {}; ++ ++ /* When we sleep for longer, we try to realign the wakeup to ++ the same time wihtin each minute/second/250ms, so that ++ events all across the system can be coalesced into a single ++ CPU wakeup. However, let's take some system-specific ++ randomness for this value, so that in a network of systems ++ with synced clocks timer events are distributed a ++ bit. Here, we calculate a perturbation usec offset from the ++ boot ID. */ ++ ++ if (_likely_(e->perturb != (usec_t) -1)) ++ return; ++ ++ if (sd_id128_get_boot(&bootid) >= 0) ++ e->perturb = (bootid.qwords[0] ^ bootid.qwords[1]) % USEC_PER_MINUTE; ++} ++ + static int event_setup_timer_fd( + sd_event *e, + EventSourceType type, + int *timer_fd, + clockid_t id) { + +- sd_id128_t bootid = {}; + struct epoll_event ev = {}; + int r, fd; + +@@ -677,18 +695,6 @@ static int event_setup_timer_fd( + return -errno; + } + +- /* When we sleep for longer, we try to realign the wakeup to +- the same time wihtin each minute/second/250ms, so that +- events all across the system can be coalesced into a single +- CPU wakeup. However, let's take some system-specific +- randomness for this value, so that in a network of systems +- with synced clocks timer events are distributed a +- bit. Here, we calculate a perturbation usec offset from the +- boot ID. */ +- +- if (sd_id128_get_boot(&bootid) >= 0) +- e->perturb = (bootid.qwords[0] ^ bootid.qwords[1]) % USEC_PER_MINUTE; +- + *timer_fd = fd; + return 0; + } +@@ -1506,6 +1512,8 @@ static usec_t sleep_between(sd_event *e, + if (b <= a + 1) + return a; + ++ initialize_perturb(e); ++ + /* + Find a good time to wake up again between times a and b. We + have two goals here: diff --git a/0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch b/0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch new file mode 100644 index 0000000..ee4c169 --- /dev/null +++ b/0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch @@ -0,0 +1,29 @@ +From 75145780813957ecbe6835f2c8bc20113a3605d2 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 25 Mar 2014 00:01:51 +0100 +Subject: [PATCH] sd-event: don't accidentally turn of watchdog timer event if + we determine 0 + +--- + src/libsystemd/sd-event/sd-event.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git src/libsystemd/sd-event/sd-event.c src/libsystemd/sd-event/sd-event.c +index d6a3d1c..4aabec1 100644 +--- src/libsystemd/sd-event/sd-event.c ++++ src/libsystemd/sd-event/sd-event.c +@@ -2087,6 +2087,11 @@ static int arm_watchdog(sd_event *e) { + + timespec_store(&its.it_value, t); + ++ /* Make sure we never set the watchdog to 0, which tells the ++ * kernel to disable it. */ ++ if (its.it_value.tv_sec == 0 && its.it_value.tv_nsec == 0) ++ its.it_value.tv_nsec = 1; ++ + r = timerfd_settime(e->watchdog_fd, TFD_TIMER_ABSTIME, &its, NULL); + if (r < 0) + return -errno; +-- +1.7.9.2 + diff --git a/0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch b/0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch new file mode 100644 index 0000000..b4564a5 --- /dev/null +++ b/0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch @@ -0,0 +1,53 @@ +From 0088d63151e088d62104d88f866e9eb049091c22 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 25 Mar 2014 00:31:48 +0100 +Subject: [PATCH] systemctl: --kill-mode is long long gone, don't mention it + in the man page + +--- + man/systemctl.xml | 5 ++--- + shell-completion/bash/systemctl | 5 +---- + 2 files changed, 3 insertions(+), 7 deletions(-) + +diff --git man/systemctl.xml man/systemctl.xml +index 77447dd..b4727d9 100644 +--- man/systemctl.xml ++++ man/systemctl.xml +@@ -664,9 +664,8 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service + + Send a signal to one or more processes of the + unit. Use to select which +- process to kill. Use to select +- the kill mode and to select the +- signal to send. ++ process to kill. Use to select ++ the signal to send. + + + +diff --git shell-completion/bash/systemctl shell-completion/bash/systemctl +index dc7ef66..0dfc868 100644 +--- shell-completion/bash/systemctl ++++ shell-completion/bash/systemctl +@@ -74,7 +74,7 @@ _systemctl () { + [STANDALONE]='--all -a --reverse --after --before --defaults --fail --ignore-dependencies --failed --force -f --full -l --global + --help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall + --quiet -q --privileged -P --system --user --version --runtime' +- [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --state --root' ++ [ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --root' + ) + + if __contains_word "--user" ${COMP_WORDS[*]}; then +@@ -99,9 +99,6 @@ _systemctl () { + --kill-who) + comps='all control main' + ;; +- --kill-mode) +- comps='control-group process' +- ;; + --root) + comps=$(compgen -A directory -- "$cur" ) + compopt -o filenames +-- +1.7.9.2 + diff --git a/0009-ask-password-when-the-user-types-a-overly-long-passw.patch b/0009-ask-password-when-the-user-types-a-overly-long-passw.patch new file mode 100644 index 0000000..840c4a1 --- /dev/null +++ b/0009-ask-password-when-the-user-types-a-overly-long-passw.patch @@ -0,0 +1,33 @@ +From 036eeac5a1799fa2c0ae11a14d8c667b5d303189 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 25 Mar 2014 01:27:05 +0100 +Subject: [PATCH] ask-password: when the user types a overly long password, + beep and refuse +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Based on a similar patch from David Härdeman. +--- + src/shared/ask-password-api.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git src/shared/ask-password-api.c src/shared/ask-password-api.c +index 117f0c6..96f16cc 100644 +--- src/shared/ask-password-api.c ++++ src/shared/ask-password-api.c +@@ -207,6 +207,11 @@ int ask_password_tty( + if (ttyfd >= 0) + loop_write(ttyfd, "(no echo) ", 10, false); + } else { ++ if (p >= sizeof(passphrase)-1) { ++ loop_write(ttyfd, "\a", 1, false); ++ continue; ++ } ++ + passphrase[p++] = c; + + if (!silent_mode && ttyfd >= 0) +-- +1.7.9.2 + diff --git a/1019-make-completion-smart-to-be-able-to-redirect.patch b/1019-make-completion-smart-to-be-able-to-redirect.patch index 90ca8ed..89d7918 100644 --- a/1019-make-completion-smart-to-be-able-to-redirect.patch +++ b/1019-make-completion-smart-to-be-able-to-redirect.patch @@ -108,7 +108,7 @@ --- systemd-208/shell-completion/bash/systemctl +++ systemd-208/shell-completion/bash/systemctl 2014-01-17 14:35:26.506235666 +0000 @@ -77,6 +77,10 @@ _systemctl () { - [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --state --root' + [ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --root' ) + if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then diff --git a/systemd-mini.changes b/systemd-mini.changes index 294911d..6e6334d 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Fri Mar 28 12:53:21 UTC 2014 - werner@suse.de + +- Add or port upstram 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 + 0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch + 0005-sd-daemon-fix-incorrect-variable-access.patch + 0006-sd-event-initialization-perturbation-value-right-bef.patch + 0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch + 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch + 0009-ask-password-when-the-user-types-a-overly-long-passw.patch +- Modify patch + 1019-make-completion-smart-to-be-able-to-redirect.patch + to work together with + 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch + ------------------------------------------------------------------- Fri Mar 28 08:10:13 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 96f4a24..1a24806 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -311,6 +311,24 @@ Patch160: 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch Patch161: 0012-journald-remove-stray-reset-of-error-return-value.patch # PATCH-FIX-USTREAM added at 2014/03/18 Patch162: 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch163: 0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch164: 0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch165: 0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch166: 0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch167: 0005-sd-daemon-fix-incorrect-variable-access.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch168: 0006-sd-event-initialization-perturbation-value-right-bef.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch169: 0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch170: 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch171: 0009-ask-password-when-the-user-types-a-overly-long-passw.patch # PATCH-FIX-OPENSUSE 1009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844) Patch1009: 1009-make-xsltproc-use-correct-ROFF-links.patch # PATCH-FIX-OPENSUSE 1010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071) @@ -662,6 +680,15 @@ cp %{SOURCE7} m4/ %patch160 -p0 %patch161 -p0 %patch162 -p0 +%patch163 -p0 +%patch164 -p0 +%patch165 -p0 +%patch166 -p0 +%patch167 -p0 +%patch168 -p0 +%patch169 -p0 +%patch170 -p0 +%patch171 -p0 %patch1009 -p1 %patch1010 -p1 %patch1012 -p1 diff --git a/systemd.changes b/systemd.changes index 294911d..6e6334d 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Fri Mar 28 12:53:21 UTC 2014 - werner@suse.de + +- Add or port upstram 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 + 0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch + 0005-sd-daemon-fix-incorrect-variable-access.patch + 0006-sd-event-initialization-perturbation-value-right-bef.patch + 0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch + 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch + 0009-ask-password-when-the-user-types-a-overly-long-passw.patch +- Modify patch + 1019-make-completion-smart-to-be-able-to-redirect.patch + to work together with + 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch + ------------------------------------------------------------------- Fri Mar 28 08:10:13 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 40d19eb..b5f4ba8 100644 --- a/systemd.spec +++ b/systemd.spec @@ -306,6 +306,24 @@ Patch160: 0009-sd-bus-don-t-choke-if-somebody-sends-us-a-message-wi.patch Patch161: 0012-journald-remove-stray-reset-of-error-return-value.patch # PATCH-FIX-USTREAM added at 2014/03/18 Patch162: 0013-core-libsystemd-systemd-timedate-udev-spelling-fixes.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch163: 0001-cgroup-it-s-not-OK-to-invoke-alloca-in-loops.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch164: 0002-machined-fix-Kill-bus-call-on-machine-objects-when-w.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch165: 0003-sd-bus-don-t-use-assert_return-to-check-for-disconne.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch166: 0004-core-don-t-try-to-relabel-mounts-before-we-loaded-th.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch167: 0005-sd-daemon-fix-incorrect-variable-access.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch168: 0006-sd-event-initialization-perturbation-value-right-bef.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch169: 0007-sd-event-don-t-accidentally-turn-of-watchdog-timer-e.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch170: 0008-systemctl-kill-mode-is-long-long-gone-don-t-mention-.patch +# PATCH-FIX-USTREAM added at 2014/03/28 +Patch171: 0009-ask-password-when-the-user-types-a-overly-long-passw.patch # PATCH-FIX-OPENSUSE 1009-make-xsltproc-use-correct-ROFF-links.patch -- Make ROFF links working again in manual pages (bnc#842844) Patch1009: 1009-make-xsltproc-use-correct-ROFF-links.patch # PATCH-FIX-OPENSUSE 1010-do-not-install-sulogin-unit-with-poweroff.patch -- Avoid installing console-shell.service (bnc#849071) @@ -657,6 +675,15 @@ cp %{SOURCE7} m4/ %patch160 -p0 %patch161 -p0 %patch162 -p0 +%patch163 -p0 +%patch164 -p0 +%patch165 -p0 +%patch166 -p0 +%patch167 -p0 +%patch168 -p0 +%patch169 -p0 +%patch170 -p0 +%patch171 -p0 %patch1009 -p1 %patch1010 -p1 %patch1012 -p1