diff --git a/0001-event-pull-in-sd-event.h-from-event-util.h.patch b/0001-event-pull-in-sd-event.h-from-event-util.h.patch new file mode 100644 index 0000000..e9fc98c --- /dev/null +++ b/0001-event-pull-in-sd-event.h-from-event-util.h.patch @@ -0,0 +1,24 @@ +From 138992534878483de28417dfc61c546bba5cb8ad Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Thu, 10 Jul 2014 18:25:08 +0200 +Subject: [PATCH] event: pull in sd-event.h from event-util.h + +--- + src/libsystemd/sd-event/event-util.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git src/libsystemd/sd-event/event-util.h src/libsystemd/sd-event/event-util.h +index e58020d..e7cad9b 100644 +--- src/libsystemd/sd-event/event-util.h ++++ src/libsystemd/sd-event/event-util.h +@@ -22,6 +22,7 @@ + ***/ + + #include "util.h" ++#include "sd-event.h" + + DEFINE_TRIVIAL_CLEANUP_FUNC(sd_event*, sd_event_unref); + DEFINE_TRIVIAL_CLEANUP_FUNC(sd_event_source*, sd_event_source_unref); +-- +1.7.9.2 + diff --git a/0001-journal-compress-return-early-in-uncompress_startswi.patch b/0001-journal-compress-return-early-in-uncompress_startswi.patch new file mode 100644 index 0000000..5547678 --- /dev/null +++ b/0001-journal-compress-return-early-in-uncompress_startswi.patch @@ -0,0 +1,176 @@ +Based on 5e592c66bdf76dfc8445b332f7a5088ca504ee90 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 4 Jul 2014 19:53:58 -0400 +Subject: [PATCH] journal/compress: return early in uncompress_startswith + +uncompress_startswith would always decode the whole stream, even +if it did not start with the given prefix. + +Reallocation policy was also strange. +--- + src/journal/compress.c | 91 ++++++++++++++----------------------------------- + 1 file changed, 27 insertions(+), 64 deletions(-) + +--- src/journal/compress.c ++++ src/journal/compress.c 2014-07-09 00:00:00.000000000 +0000 +@@ -69,10 +69,9 @@ fail: + bool uncompress_blob(const void *src, uint64_t src_size, + void **dst, uint64_t *dst_alloc_size, uint64_t* dst_size, uint64_t dst_max) { + +- lzma_stream s = LZMA_STREAM_INIT; ++ _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT; + lzma_ret ret; + uint64_t space; +- bool b = false; + + assert(src); + assert(src_size > 0); +@@ -85,26 +84,18 @@ bool uncompress_blob(const void *src, ui + if (ret != LZMA_OK) + return false; + +- if (*dst_alloc_size <= src_size) { +- void *p; +- +- p = realloc(*dst, src_size*2); +- if (!p) +- return false; +- +- *dst = p; +- *dst_alloc_size = src_size*2; +- } ++ space = MIN(src_size * 2, dst_max ?: (uint64_t) -1); ++ if (!greedy_realloc(dst, dst_alloc_size, space, 1)) ++ return false; + + s.next_in = src; + s.avail_in = src_size; + + s.next_out = *dst; +- space = dst_max > 0 ? MIN(*dst_alloc_size, dst_max) : *dst_alloc_size; + s.avail_out = space; + + for (;;) { +- void *p; ++ uint64_t used; + + ret = lzma_code(&s, LZMA_FINISH); + +@@ -112,31 +103,25 @@ bool uncompress_blob(const void *src, ui + break; + + if (ret != LZMA_OK) +- goto fail; ++ return false; + + if (dst_max > 0 && (space - s.avail_out) >= dst_max) + break; + +- p = realloc(*dst, space*2); +- if (!p) +- goto fail; +- +- s.next_out = (uint8_t*) p + ((uint8_t*) s.next_out - (uint8_t*) *dst); +- s.avail_out += space; ++ if (dst_max > 0 && space == dst_max) ++ return false; + +- space *= 2; ++ used = space - s.avail_out; ++ space = MIN(2 * space, dst_max ?: (uint64_t) -1); ++ if (!greedy_realloc(dst, dst_alloc_size, space, 1)) ++ return false; + +- *dst = p; +- *dst_alloc_size = space; ++ s.avail_out = space - used; ++ s.next_out = *dst + used; + } + + *dst_size = space - s.avail_out; +- b = true; +- +-fail: +- lzma_end(&s); +- +- return b; ++ return true; + } + + bool uncompress_startswith(const void *src, uint64_t src_size, +@@ -144,9 +129,8 @@ bool uncompress_startswith(const void *s + const void *prefix, uint64_t prefix_len, + uint8_t extra) { + +- lzma_stream s = LZMA_STREAM_INIT; ++ _cleanup_(lzma_end) lzma_stream s = LZMA_STREAM_INIT; + lzma_ret ret; +- bool b = false; + + /* Checks whether the uncompressed blob starts with the + * mentioned prefix. The byte extra needs to follow the +@@ -163,16 +147,8 @@ bool uncompress_startswith(const void *s + if (ret != LZMA_OK) + return false; + +- if (*buffer_size <= prefix_len) { +- void *p; +- +- p = realloc(*buffer, prefix_len*2); +- if (!p) +- return false; +- +- *buffer = p; +- *buffer_size = prefix_len*2; +- } ++ if (!(greedy_realloc(buffer, buffer_size, prefix_len + 1, 1))) ++ return false; + + s.next_in = src; + s.avail_in = src_size; +@@ -181,36 +157,23 @@ bool uncompress_startswith(const void *s + s.avail_out = *buffer_size; + + for (;;) { +- void *p; +- + ret = lzma_code(&s, LZMA_FINISH); + + if (ret != LZMA_STREAM_END && ret != LZMA_OK) +- goto fail; ++ return false; + +- if ((*buffer_size - s.avail_out > prefix_len) && +- memcmp(*buffer, prefix, prefix_len) == 0 && +- ((const uint8_t*) *buffer)[prefix_len] == extra) +- break; ++ if (*buffer_size - s.avail_out >= prefix_len + 1) ++ return memcmp(*buffer, prefix, prefix_len) == 0 && ++ ((const uint8_t*) *buffer)[prefix_len] == extra; + + if (ret == LZMA_STREAM_END) +- goto fail; +- +- p = realloc(*buffer, *buffer_size*2); +- if (!p) +- goto fail; ++ return false; + +- s.next_out = (uint8_t*) p + ((uint8_t*) s.next_out - (uint8_t*) *buffer); + s.avail_out += *buffer_size; + +- *buffer = p; +- *buffer_size *= 2; +- } +- +- b = true; +- +-fail: +- lzma_end(&s); ++ if (!(greedy_realloc(buffer, buffer_size, *buffer_size * 2, 1))) ++ return false; + +- return b; ++ s.next_out = *buffer + *buffer_size - s.avail_out; ++ } + } diff --git a/0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch b/0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch new file mode 100644 index 0000000..269adab --- /dev/null +++ b/0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch @@ -0,0 +1,37 @@ +From 154034270c4643b7cfe61c0be1676d78bb1b7b07 Mon Sep 17 00:00:00 2001 +From: David Herrmann +Date: Tue, 8 Jul 2014 12:56:55 +0200 +Subject: [PATCH] logind: allow switching to unused VTs via SwitchTo() + +If compositors use the new SwitchTo() logic to map F1-F12, we should allow +them to switch to unregistered VTs, too. Otherwise, the auto-spawn logic +of gettys won't trigger. + +Reported-by: Jasper St. Pierre +Signed-off-by: David Herrmann +--- + src/login/logind-seat.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git src/login/logind-seat.c src/login/logind-seat.c +index 3114de8..9992195 100644 +--- src/login/logind-seat.c ++++ src/login/logind-seat.c +@@ -275,8 +275,13 @@ int seat_switch_to(Seat *s, unsigned int num) { + if (!num) + return -EINVAL; + +- if (num >= s->position_count || !s->positions[num]) ++ if (num >= s->position_count || !s->positions[num]) { ++ /* allow switching to unused VTs to trigger auto-activate */ ++ if (seat_has_vts(s) && num < 64) ++ return chvt(num); ++ + return -EINVAL; ++ } + + return session_activate(s->positions[num]); + } +-- +1.7.9.2 + diff --git a/0001-units-make-ExecStopPost-action-part-of-ExecStart.patch b/0001-units-make-ExecStopPost-action-part-of-ExecStart.patch new file mode 100644 index 0000000..bb9010b --- /dev/null +++ b/0001-units-make-ExecStopPost-action-part-of-ExecStart.patch @@ -0,0 +1,46 @@ +Based on d3381512282f2ca1c7669f77fb736a90fdce6982 Mon Sep 17 00:00:00 2001 +From: Michal Sekletar +Date: Tue, 8 Jul 2014 17:42:23 +0200 +Subject: [PATCH] units: make ExecStopPost action part of ExecStart + +Currently after exiting rescue shell we isolate default target. User +might want to isolate to some other target than default one. However +issuing systemctl isolate command to desired target would bring system +to default target as a consequence of running ExecStopPost action. + +Having common ancestor for rescue shell and possible followup systemctl +default command should fix this. If user exits rescue shell we will +proceed with isolating default target, otherwise, on manual isolate, +parent shell process is terminated and we don't isolate default target, +but target chosen by user. + +Suggested-by: Michal Schmidt +--- + units/emergency.service.in | 3 +-- + units/rescue.service.m4.in | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +--- units/emergency.service.in ++++ units/emergency.service.in 2014-07-10 13:31:50.662235825 +0000 +@@ -18,8 +18,7 @@ WorkingDirectory=/root + ExecStartPre=-/usr/bin/plymouth quit + ExecStartPre=-/usr/bin/plymouth --wait + ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.' +-ExecStart=-/usr/sbin/sulogin +-ExecStopPost=@SYSTEMCTL@ --fail --no-block default ++ExecStart=-/bin/sh -c "/usr/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" + Type=idle + StandardInput=tty-force + StandardOutput=inherit +--- units/rescue.service.m4.in ++++ units/rescue.service.m4.in 2014-07-10 13:32:15.678235509 +0000 +@@ -19,8 +19,7 @@ WorkingDirectory=/root + ExecStartPre=-/usr/bin/plymouth quit + ExecStartPre=-/usr/bin/plymouth --wait + ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.' +-ExecStart=-/usr/sbin/sulogin +-ExecStopPost=-@SYSTEMCTL@ --fail --no-block default ++ExecStart=-/bin/sh -c "/usr/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" + Type=idle + StandardInput=tty-force + StandardOutput=inherit diff --git a/0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch b/0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch new file mode 100644 index 0000000..9a6c97a --- /dev/null +++ b/0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch @@ -0,0 +1,54 @@ +From 3a8a916338d8446b938f3cf40f6aae0c611892e3 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 11:47:10 +0200 +Subject: [PATCH] util: consider 0x7F a control chracter (which it is: DEL) + +Let's better be safe than sorry. +--- + src/shared/util.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git src/shared/util.c src/shared/util.c +index 3d875c7..d25ee66 100644 +--- src/shared/util.c ++++ src/shared/util.c +@@ -1608,8 +1608,9 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) { + return -ETIMEDOUT; + } + ++ errno = 0; + if (!fgets(line, sizeof(line), f)) +- return -EIO; ++ return errno ? -errno : -EIO; + + truncate_nl(line); + +@@ -5355,6 +5356,9 @@ bool string_is_safe(const char *p) { + if (*t > 0 && *t < ' ') + return false; + ++ if (*t == 127) ++ return false; ++ + if (strchr("\\\"\'", *t)) + return false; + } +@@ -5371,10 +5375,14 @@ bool string_has_cc(const char *p) { + + assert(p); + +- for (t = p; *t; t++) ++ for (t = p; *t; t++) { + if (*t > 0 && *t < ' ' && *t != '\t') + return true; + ++ if (*t == 127) ++ return true; ++ } ++ + return false; + } + +-- +1.7.9.2 + diff --git a/0002-hostnamed-add-a-new-chassis-type-for-watches.patch b/0002-hostnamed-add-a-new-chassis-type-for-watches.patch new file mode 100644 index 0000000..a20c11c --- /dev/null +++ b/0002-hostnamed-add-a-new-chassis-type-for-watches.patch @@ -0,0 +1,26 @@ +From c49e59c1831f20fe02276d7bc6ba7d23d24c4ab3 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 9 Jul 2014 13:20:05 +0200 +Subject: [PATCH] hostnamed: add a new chassis type for watches + +--- + src/hostname/hostnamed.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git src/hostname/hostnamed.c src/hostname/hostnamed.c +index 514554d..eaae113 100644 +--- src/hostname/hostnamed.c ++++ src/hostname/hostnamed.c +@@ -144,7 +144,8 @@ static bool valid_chassis(const char *chassis) { + "laptop\0" + "server\0" + "tablet\0" +- "handset\0", ++ "handset\0" ++ "watch\0", + chassis); + } + +-- +1.7.9.2 + diff --git a/0002-journal-compress-improve-xz-compression-performance.patch b/0002-journal-compress-improve-xz-compression-performance.patch new file mode 100644 index 0000000..adccdaa --- /dev/null +++ b/0002-journal-compress-improve-xz-compression-performance.patch @@ -0,0 +1,82 @@ +Based on 1930eed2a7855d2df06ccf51f9e394428bf547e2 Mon Sep 17 00:00:00 2001 +From: Jon Severinsson +Date: Tue, 8 Jul 2014 18:29:46 +0200 +Subject: [PATCH] journal/compress: improve xz compression performance + +The new lzma2 compression options at the top of compress_blob_xz are +equivalent to using preset "0", exept for using a 1 MiB dictionary +(the same as preset "1"). This makes the memory usage at most 7.5 MiB +in the compressor, and 1 MiB in the decompressor, instead of the +previous 92 MiB in the compressor and 8 MiB in the decompressor. + +According to test-compress-benchmark this commit makes XZ compression +20 times faster, with no increase in compressed data size. +Using more realistic test data (an ELF binary rather than repeating +ASCII letters 'a' through 'z' in order) it only provides a factor 10 +speedup, and at a cost if a 10% increase in compressed data size. +But that is still a worthwhile trade-off. + +According to test-compress-benchmark XZ compression is still 25 times +slower than LZ4, but the compressed data is one eighth the size. +Using more realistic test data XZ compression is only 18 times slower +than LZ4, and the compressed data is only one quarter the size. + +--- + src/journal/compress.c | 33 ++++++++++++++------------------- + 1 file changed, 14 insertions(+), 19 deletions(-) + +--- src/journal/compress.c ++++ src/journal/compress.c 2014-07-09 12:09:45.814235274 +0000 +@@ -28,8 +28,15 @@ + #include "compress.h" + + bool compress_blob(const void *src, uint64_t src_size, void *dst, uint64_t *dst_size) { +- lzma_stream s = LZMA_STREAM_INIT; ++ static const lzma_options_lzma opt = { ++ 1u << 20u, NULL, 0, LZMA_LC_DEFAULT, LZMA_LP_DEFAULT, ++ LZMA_PB_DEFAULT, LZMA_MODE_FAST, 128, LZMA_MF_HC3, 4}; ++ static const lzma_filter filters[2] = { ++ {LZMA_FILTER_LZMA2, (lzma_options_lzma*) &opt}, ++ {LZMA_VLI_UNKNOWN, NULL} ++ }; + lzma_ret ret; ++ size_t out_pos = 0; + bool b = false; + + assert(src); +@@ -40,29 +47,17 @@ bool compress_blob(const void *src, uint + /* Returns false if we couldn't compress the data or the + * compressed result is longer than the original */ + +- ret = lzma_easy_encoder(&s, LZMA_PRESET_DEFAULT, LZMA_CHECK_NONE); +- if (ret != LZMA_OK) ++ if (src_size < 80) + return false; + +- s.next_in = src; +- s.avail_in = src_size; +- s.next_out = dst; +- s.avail_out = src_size; +- +- /* Does it fit? */ +- if (lzma_code(&s, LZMA_FINISH) != LZMA_STREAM_END) +- goto fail; +- +- /* Is it actually shorter? */ +- if (s.avail_out == 0) +- goto fail; ++ ret = lzma_stream_buffer_encode((lzma_filter*) filters, LZMA_CHECK_NONE, NULL, ++ src, src_size, dst, &out_pos, src_size - 1); ++ if (ret != LZMA_OK) ++ return false; + +- *dst_size = src_size - s.avail_out; ++ *dst_size = out_pos; + b = true; + +-fail: +- lzma_end(&s); +- + return b; + } + diff --git a/0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch b/0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch new file mode 100644 index 0000000..aeb7ab2 --- /dev/null +++ b/0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch @@ -0,0 +1,130 @@ +From 6294aa76d818e831de4592b41a37e225fd0871f9 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 12:04:55 +0200 +Subject: [PATCH] util: don't consider tabs special in string_has_cc() anymore + +Instead, take a list of exceptions to our usual CC check +--- + src/hostname/hostnamed.c | 3 +-- + src/shared/env-util.c | 4 +++- + src/shared/fileio.c | 2 +- + src/shared/util.c | 19 ++++++++++--------- + src/shared/util.h | 5 +++-- + 5 files changed, 18 insertions(+), 15 deletions(-) + +diff --git src/hostname/hostnamed.c src/hostname/hostnamed.c +index 14629dd..514554d 100644 +--- src/hostname/hostnamed.c ++++ src/hostname/hostnamed.c +@@ -550,8 +550,7 @@ static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop + + if (prop == PROP_ICON_NAME && !filename_is_safe(name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid icon name '%s'", name); +- if (prop == PROP_PRETTY_HOSTNAME && +- (string_has_cc(name) || chars_intersect(name, "\t"))) ++ if (prop == PROP_PRETTY_HOSTNAME && string_has_cc(name, NULL)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid pretty host name '%s'", name); + if (prop == PROP_CHASSIS && !valid_chassis(name)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid chassis '%s'", name); +diff --git src/shared/env-util.c src/shared/env-util.c +index b2e4553..20b208f 100644 +--- src/shared/env-util.c ++++ src/shared/env-util.c +@@ -78,7 +78,9 @@ bool env_value_is_valid(const char *e) { + if (!utf8_is_valid(e)) + return false; + +- if (string_has_cc(e)) ++ /* bash allows tabs in environment variables, and so should ++ * we */ ++ if (string_has_cc(e, "\t")) + return false; + + /* POSIX says the overall size of the environment block cannot +diff --git src/shared/fileio.c src/shared/fileio.c +index fb1c1bc..b1de590 100644 +--- src/shared/fileio.c ++++ src/shared/fileio.c +@@ -738,7 +738,7 @@ static void write_env_var(FILE *f, const char *v) { + p++; + fwrite(v, 1, p-v, f); + +- if (string_has_cc(p) || chars_intersect(p, WHITESPACE "\'\"\\`$")) { ++ if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE "\'\"\\`$")) { + fputc('\"', f); + + for (; *p; p++) { +diff --git src/shared/util.c src/shared/util.c +index d25ee66..d223ecf 100644 +--- src/shared/util.c ++++ src/shared/util.c +@@ -5350,16 +5350,14 @@ bool filename_is_safe(const char *p) { + bool string_is_safe(const char *p) { + const char *t; + +- assert(p); ++ if (!p) ++ return false; + + for (t = p; *t; t++) { + if (*t > 0 && *t < ' ') + return false; + +- if (*t == 127) +- return false; +- +- if (strchr("\\\"\'", *t)) ++ if (strchr("\\\"\'\0x7f", *t)) + return false; + } + +@@ -5367,16 +5365,19 @@ bool string_is_safe(const char *p) { + } + + /** +- * Check if a string contains control characters. +- * Spaces and tabs are not considered control characters. ++ * Check if a string contains control characters. If 'ok' is non-NULL ++ * it may be a string containing additional CCs to be considered OK. + */ +-bool string_has_cc(const char *p) { ++bool string_has_cc(const char *p, const char *ok) { + const char *t; + + assert(p); + + for (t = p; *t; t++) { +- if (*t > 0 && *t < ' ' && *t != '\t') ++ if (ok && strchr(ok, *t)) ++ return false; ++ ++ if (*t > 0 && *t < ' ') + return true; + + if (*t == 127) +diff --git src/shared/util.h src/shared/util.h +index e23069c..8544940 100644 +--- src/shared/util.h ++++ src/shared/util.h +@@ -382,7 +382,8 @@ bool fstype_is_network(const char *fstype); + int chvt(int vt); + + int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); +-int ask(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); ++int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); ++int ask_string(char **ret, const char *text, ...) _printf_(2, 3); + + int reset_terminal_fd(int fd, bool switch_to_text); + int reset_terminal(const char *name); +@@ -692,7 +693,7 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_ + bool filename_is_safe(const char *p) _pure_; + bool path_is_safe(const char *p) _pure_; + bool string_is_safe(const char *p) _pure_; +-bool string_has_cc(const char *p) _pure_; ++bool string_has_cc(const char *p, const char *ok) _pure_; + + /** + * Check if a string contains any glob patterns. +-- +1.7.9.2 + diff --git a/0002-util-fix-has-cc-check-and-add-test.patch b/0002-util-fix-has-cc-check-and-add-test.patch new file mode 100644 index 0000000..f39ad16 --- /dev/null +++ b/0002-util-fix-has-cc-check-and-add-test.patch @@ -0,0 +1,25 @@ +Based on 1cb1767a29458b3d16d6b161b4ee34dd496ff60d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 11 Jul 2014 09:21:15 -0400 +Subject: [PATCH] util: fix has cc check and add test + +--- + src/shared/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/shared/util.c src/shared/util.c +index 3342798..75dc58b 100644 +--- src/shared/util.c ++++ src/shared/util.c +@@ -5419,7 +5419,7 @@ bool string_has_cc(const char *p, const char *ok) { + + for (t = p; *t; t++) { + if (ok && strchr(ok, *t)) +- return false; ++ continue; + + if (*t > 0 && *t < ' ') + return true; +-- +1.7.9.2 + diff --git a/0003-architecture-add-string-table-entries-for-mips-le-ar.patch b/0003-architecture-add-string-table-entries-for-mips-le-ar.patch new file mode 100644 index 0000000..c394470 --- /dev/null +++ b/0003-architecture-add-string-table-entries-for-mips-le-ar.patch @@ -0,0 +1,52 @@ +Based on 037c26d0aeb750ca9c8d605884ea1db7baecfea8 Mon Sep 17 00:00:00 2001 +Based on 9a00f57a5ba7ed431e6bac8d8b36518708503b4e Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 14:59:06 +0200 +Subject: [PATCH] architecture: add string table entries for mips-le archs + which were missing + +--- + src/shared/architecture.c | 2 ++ + src/shared/architecture.h | 4 ++++ + 2 files changed, 6 insertions(+) + +diff --git src/shared/architecture.c src/shared/architecture.c +index 6cdca4e..dc45f35 100644 +--- src/shared/architecture.c ++++ src/shared/architecture.c +@@ -153,7 +153,9 @@ static const char *const architecture_table[_ARCHITECTURE_MAX] = { + [ARCHITECTURE_SPARC] = "sparc", + [ARCHITECTURE_SPARC64] = "sparc64", + [ARCHITECTURE_MIPS] = "mips", ++ [ARCHITECTURE_MIPS_LE] = "mips-le", + [ARCHITECTURE_MIPS64] = "mips64", ++ [ARCHITECTURE_MIPS64_LE] = "mips64-le", + [ARCHITECTURE_ALPHA] = "alpha", + [ARCHITECTURE_ARM] = "arm", + [ARCHITECTURE_ARM_BE] = "arm-be", +diff --git src/shared/architecture.h src/shared/architecture.h +index 20e848b..0807924 100644 +--- src/shared/architecture.h ++++ src/shared/architecture.h +@@ -23,6 +23,8 @@ + + #include "util.h" + ++/* A cleaned up architecture definition */ ++ + typedef enum Architecture { + ARCHITECTURE_X86 = 0, + ARCHITECTURE_X86_64, +@@ -38,7 +40,9 @@ typedef enum Architecture { + ARCHITECTURE_SPARC, + ARCHITECTURE_SPARC64, + ARCHITECTURE_MIPS, ++ ARCHITECTURE_MIPS_LE, + ARCHITECTURE_MIPS64, ++ ARCHITECTURE_MIPS64_LE, + ARCHITECTURE_ALPHA, + ARCHITECTURE_ARM, + ARCHITECTURE_ARM_BE, +-- +1.7.9.2 + diff --git a/0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch b/0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch new file mode 100644 index 0000000..f401411 --- /dev/null +++ b/0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch @@ -0,0 +1,46 @@ +From b63c8d4f0364457b0ead8793504012bb7113974f Mon Sep 17 00:00:00 2001 +From: David Herrmann +Date: Thu, 10 Jul 2014 00:47:23 +0200 +Subject: [PATCH] sd-event: always call epoll_ctl() on mask-updates if + edge-triggered + +A call to sd_event_source_set_io_events() skipps calling into the kernel +if the new event-mask matches the old one. This is safe for +level-triggered sources as the kernel moves them onto the ready-list +automatically if events change. However, edge-triggered sources might not +be on the ready-list even though events are present. + +A call to sd_event_source_set_io_events() with EPOLLET set might thus be +used to just move the io-source onto the ready-list so the next poll +will return it again. This is very useful to avoid starvation in +priority-based event queues. + +Imagine a read() loop on an edge-triggered fd. If we cannot read data fast +enough to drain the receive queue, we might decide to skip reading for now +and schedule it for later. On edge-triggered io-sources we have to make +sure it's put on the ready-list so the next dispatch-round will return it +again if it's still the highest priority task. We could make sd-event +handle edge-triggered sources directly and allow marking them ready again. +However, it's much simpler to let the kernel do that for now via +EPOLL_CTL_MOD. +--- + src/libsystemd/sd-event/sd-event.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git src/libsystemd/sd-event/sd-event.c src/libsystemd/sd-event/sd-event.c +index 53f1904..a21f7db 100644 +--- src/libsystemd/sd-event/sd-event.c ++++ src/libsystemd/sd-event/sd-event.c +@@ -1282,7 +1282,8 @@ _public_ int sd_event_source_set_io_events(sd_event_source *s, uint32_t events) + assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE); + assert_return(!event_pid_changed(s->event), -ECHILD); + +- if (s->io.events == events) ++ /* edge-triggered updates are never skipped, so we can reset edges */ ++ if (s->io.events == events && !(events & EPOLLET)) + return 0; + + if (s->enabled != SD_EVENT_OFF) { +-- +1.7.9.2 + diff --git a/0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch b/0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch new file mode 100644 index 0000000..3ae99a6 --- /dev/null +++ b/0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch @@ -0,0 +1,67 @@ +Based on 4774e357268e4a1e9fa82adb0563a538932a4c8e Mon Sep 17 00:00:00 2001 +From: Miguel Angel Ajo +Date: Mon, 7 Jul 2014 14:20:36 +0200 +Subject: [PATCH] core: Added support for ERRNO NOTIFY_SOCKET message parsing, + and added StatusErrno dbus property along StatusText to + allow notification of numeric status condition while + degraded service operation or any other special situation. + +--- + src/core/dbus-service.c | 1 + + src/core/service.c | 17 +++++++++++++++++ + src/core/service.h | 1 + + 3 files changed, 19 insertions(+) + +diff --git src/core/dbus-service.c src/core/dbus-service.c +index 093289f..5a881e8 100644 +--- src/core/dbus-service.c ++++ src/core/dbus-service.c +@@ -60,6 +60,7 @@ const sd_bus_vtable bus_service_vtable[] = { + SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Service, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + SD_BUS_PROPERTY("BusName", "s", NULL, offsetof(Service, bus_name), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("StatusText", "s", NULL, offsetof(Service, status_text), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), ++ SD_BUS_PROPERTY("StatusErrno", "i", NULL, offsetof(Service, status_errno), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Service, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + BUS_EXEC_STATUS_VTABLE("ExecMain", offsetof(Service, main_exec_status), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + BUS_EXEC_COMMAND_LIST_VTABLE("ExecStartPre", offsetof(Service, exec_command[SERVICE_EXEC_START_PRE]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION), +diff --git src/core/service.c src/core/service.c +index 0b19767..ace45e2 100644 +--- src/core/service.c ++++ src/core/service.c +@@ -2637,6 +2637,23 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { + free(t); + } + ++ /* Interpret ERRNO= */ ++ e = strv_find_prefix(tags, "ERRNO="); ++ if (e) { ++ int status_errno; ++ ++ if (safe_atoi(e + 6, &status_errno) < 0) ++ log_warning_unit(u->id, "Failed to parse ERRNO= field in notification message: %s", e); ++ else { ++ log_debug_unit(u->id, "%s: got %s", u->id, e); ++ ++ if (s->status_errno != status_errno) { ++ s->status_errno = status_errno; ++ notify_dbus = true; ++ } ++ } ++ } ++ + /* Interpret WATCHDOG= */ + if (strv_find(tags, "WATCHDOG=1")) { + log_debug_unit(u->id, "%s: got WATCHDOG=1", u->id); +--- src/core/service.h ++++ src/core/service.h 2014-07-08 12:54:39.238736046 +0200 +@@ -187,6 +187,7 @@ struct Service { + char *bus_name; + + char *status_text; ++ int status_errno; + + RateLimit start_limit; + StartLimitAction start_limit_action; +-- +1.7.9.2 + diff --git a/0004-fileio-quote-more-shell-characters-in-envfiles.patch b/0004-fileio-quote-more-shell-characters-in-envfiles.patch new file mode 100644 index 0000000..b4cd3e9 --- /dev/null +++ b/0004-fileio-quote-more-shell-characters-in-envfiles.patch @@ -0,0 +1,54 @@ +From 0ce5a80601597fe4d1a715a8f70ce8d5ccaa2d86 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= +Date: Sun, 13 Jul 2014 18:49:00 +0300 +Subject: [PATCH] fileio: quote more shell characters in envfiles + +Turns out, making strings shell-proof is harder than expected: + + # machinectl set-hostname "foo|poweroff" && . /etc/machine-info + +(This could be simplified by quoting *and* escaping all characters, +which is harmless in shell but unnecessary.) +--- + src/shared/fileio.c | 4 ++-- + src/shared/util.h | 6 ++++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git src/shared/fileio.c src/shared/fileio.c +index b0ab780..cbb40c2 100644 +--- src/shared/fileio.c ++++ src/shared/fileio.c +@@ -738,11 +738,11 @@ static void write_env_var(FILE *f, const char *v) { + p++; + fwrite(v, 1, p-v, f); + +- if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE "\'\"\\`$")) { ++ if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE SHELL_NEED_QUOTES)) { + fputc('\"', f); + + for (; *p; p++) { +- if (strchr("\'\"\\`$", *p)) ++ if (strchr(SHELL_NEED_ESCAPE, *p)) + fputc('\\', f); + + fputc(*p, f); +diff --git src/shared/util.h src/shared/util.h +index c5eadc9..b3187a9 100644 +--- src/shared/util.h ++++ src/shared/util.h +@@ -93,6 +93,12 @@ + #define COMMENTS "#;" + #define GLOB_CHARS "*?[" + ++/* What characters are special in the shell? */ ++/* must be escaped outside and inside double-quotes */ ++#define SHELL_NEED_ESCAPE "\"\\`$" ++/* can be escaped or double-quoted */ ++#define SHELL_NEED_QUOTES SHELL_NEED_ESCAPE GLOB_CHARS "'()<>|&;" ++ + #define FORMAT_BYTES_MAX 8 + + #define ANSI_HIGHLIGHT_ON "\x1B[1;39m" +-- +1.7.9.2 + diff --git a/0005-service-don-t-accept-negative-ERRNO-notification-mes.patch b/0005-service-don-t-accept-negative-ERRNO-notification-mes.patch new file mode 100644 index 0000000..ed5997e --- /dev/null +++ b/0005-service-don-t-accept-negative-ERRNO-notification-mes.patch @@ -0,0 +1,25 @@ +From 2040ccf171404b709acb0ecf1d1f17b87c5d05f0 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 17:32:44 +0200 +Subject: [PATCH] service: don't accept negative ERRNO= notification messages + +--- + src/core/service.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/core/service.c src/core/service.c +index 5c54a34..d5aff99 100644 +--- src/core/service.c ++++ src/core/service.c +@@ -2637,7 +2637,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) { + if (e) { + int status_errno; + +- if (safe_atoi(e + 6, &status_errno) < 0) ++ if (safe_atoi(e + 6, &status_errno) < 0 || status_errno < 0) + log_warning_unit(u->id, "Failed to parse ERRNO= field in notification message: %s", e); + else { + log_debug_unit(u->id, "%s: got %s", u->id, e); +-- +1.7.9.2 + diff --git a/0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch b/0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch new file mode 100644 index 0000000..b1fc098 --- /dev/null +++ b/0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch @@ -0,0 +1,37 @@ +Based on b4af5a803aa71a57733ca46fef29b7afb20a626c Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 17:33:26 +0200 +Subject: [PATCH] systemctl: show StatusErrno value in "systemctl status" + +--- + src/systemctl/systemctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- src/systemctl/systemctl.c ++++ src/systemctl/systemctl.c 2014-07-08 10:57:30.170735691 +0000 +@@ -2710,6 +2710,7 @@ typedef struct UnitStatusInfo { + const char *status_text; + const char *pid_file; + bool running:1; ++ int status_errno; + + usec_t start_timestamp; + usec_t exit_timestamp; +@@ -2982,6 +2983,8 @@ static void print_status_info( + + if (i->status_text) + printf(" Status: \"%s\"\n", i->status_text); ++ if (i->status_errno > 0) ++ printf(" Error: %i (%s)\n", i->status_errno, strerror(i->status_errno)); + + if (i->control_group && + (i->main_pid > 0 || i->control_pid > 0 || cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, i->control_group, false) == 0)) { +@@ -3203,6 +3206,8 @@ static int status_property(const char *n + i->exit_code = (int) j; + else if (streq(name, "ExecMainStatus")) + i->exit_status = (int) j; ++ else if (streq(name, "StatusErrno")) ++ i->status_errno = (int) j; + + break; + } diff --git a/0007-service-flush-status-text-and-errno-values-each-time.patch b/0007-service-flush-status-text-and-errno-values-each-time.patch new file mode 100644 index 0000000..7dbe5a8 --- /dev/null +++ b/0007-service-flush-status-text-and-errno-values-each-time.patch @@ -0,0 +1,29 @@ +From 8cfdb077b8e3da1c47fc1d735d051f21f33144c1 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 7 Jul 2014 17:33:46 +0200 +Subject: [PATCH] service: flush status text and errno values each time a + service is started + +We shouldn't show status texts from previous service starts +--- + src/core/service.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git src/core/service.c src/core/service.c +index d5aff99..0f542ed 100644 +--- src/core/service.c ++++ src/core/service.c +@@ -1699,6 +1699,10 @@ static int service_start(Unit *u) { + s->main_pid_alien = false; + s->forbid_restart = false; + ++ free(s->status_text); ++ s->status_text = NULL; ++ s->status_errno = 0; ++ + service_enter_start_pre(s); + return 0; + } +-- +1.7.9.2 + diff --git a/1007-physical-hotplug-cpu-and-memory.patch b/1007-physical-hotplug-cpu-and-memory.patch index 7daebb2..9850057 100644 --- a/1007-physical-hotplug-cpu-and-memory.patch +++ b/1007-physical-hotplug-cpu-and-memory.patch @@ -1,6 +1,6 @@ ---- /dev/null -+++ systemd-206/rules/80-hotplug-cpu-mem.rules -@@ -0,0 +1,9 @@ +--- systemd-210/rules/80-hotplug-cpu-mem.rules ++++ systemd-210/rules/80-hotplug-cpu-mem.rules 2014-05-21 15:47:01.885605543 +0000 +@@ -0,0 +1,12 @@ +# do not edit this file, it will be overwritten on update + +# Hotplug physical CPU @@ -9,9 +9,12 @@ + +# Hotplug physical memory +SUBSYSTEM=="memory", ACTION=="add", TEST=="state", ATTR{state}=="offline", \ -+ ATTR{state}="online" ---- systemd-206.orig/Makefile.am -+++ systemd-206/Makefile.am ++ ATTR{state}="online", TAG+="tmpfs" ++ ++# ++TAG=="tmpfs", RUN+="/usr/lib/udev/remount-tmpfs" +--- systemd-210/Makefile.am ++++ systemd-210/Makefile.am @@ -2480,6 +2480,10 @@ dist_udevrules_DATA += \ rules/73-seat-numlock.rules diff --git a/1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch b/1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch new file mode 100644 index 0000000..6b3d7ec --- /dev/null +++ b/1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch @@ -0,0 +1,36 @@ +Based on a669ea9860900d5cdebbc4cb9aaea72db7e28a02 Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Mon, 7 Jul 2014 14:50:16 +0200 +Subject: [PATCH] udev: link_config - ignore errors due to missing MAC address + +Otherwis, we get misleading error messages on links with MACs. + +Reported by Leonid Isaev. +--- + src/udev/net/link-config.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- src/udev/net/link-config.c ++++ src/udev/net/link-config.c 2014-07-08 10:44:19.450735575 +0000 +@@ -440,7 +440,9 @@ int link_config_apply(link_config_ctx *c + case MACPOLICY_PERSISTENT: + if (!mac_is_permanent(device)) { + r = get_mac(device, false, &generated_mac); +- if (r < 0) ++ if (r == -ENOENT) ++ break; ++ else if (r < 0) + return r; + mac = &generated_mac; + } +@@ -448,7 +450,9 @@ int link_config_apply(link_config_ctx *c + case MACPOLICY_RANDOM: + if (!mac_is_random(device)) { + r = get_mac(device, true, &generated_mac); +- if (r < 0) ++ if (r == -ENOENT) ++ break; ++ else if (r < 0) + return r; + mac = &generated_mac; + } diff --git a/1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch b/1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch new file mode 100644 index 0000000..5a89f11 --- /dev/null +++ b/1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch @@ -0,0 +1,12 @@ +Index: systemd-210/src/udev/rule_generator/76-net-sriov-names.rules +=================================================================== +--- systemd-210.orig/src/udev/rule_generator/76-net-sriov-names.rules ++++ systemd-210/src/udev/rule_generator/76-net-sriov-names.rules +@@ -4,6 +4,7 @@ + + ACTION=="remove", GOTO="net-sriov-names_end" + SUBSYSTEM!="net", GOTO="net-sriov-names_end" ++KERNEL!="eth*", GOTO="net-sriov-names_end" + + IMPORT{cmdline}="net.ifnames" + ENV{net.ifnames}=="1", GOTO="net-sriov-names_end" diff --git a/systemd-mini.changes b/systemd-mini.changes index 8bec33f..49b84eb 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,84 @@ +------------------------------------------------------------------- +Tue Jul 15 12:30:31 UTC 2014 - rmilasan@suse.com + +- Only rename SRIOV-VF devices if device name start with eth (bnc#885232). + Add 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch + +------------------------------------------------------------------- +Tue Jul 15 07:39:40 UTC 2014 - werner@suse.de + +- Add patch vhangup-on-all-consoles.patch that is do a vhangup on + lines (bnc#886599) + +------------------------------------------------------------------- +Tue Jul 15 06:29:54 UTC 2014 - jlee@suse.com + +- Removed %{_libexecdir}/modules-load.d/efivars.conf because the kernel + patch of autoload efivars driver accepted by linux-efi upstream. + (bnc#881559) + https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit/?h=next&id=be756a5327fe3d4686d74d3e9b273010424e230c + +------------------------------------------------------------------- +Mon Jul 14 14:53:21 UTC 2014 - werner@suse.de + +- Update patch + 1007-physical-hotplug-cpu-and-memory.patch (bnc#869603) +- Add script systemd-remount-tmpfs (bnc#869603) as helper script + for the rule changed in patch 1007-physical-hotplug-cpu-and-memory.patch + +------------------------------------------------------------------- +Mon Jul 14 11:43:12 UTC 2014 - werner@suse.de + +- Add upstream patch + 0001-event-pull-in-sd-event.h-from-event-util.h.patch + 0002-util-fix-has-cc-check-and-add-test.patch + 0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch + 0004-fileio-quote-more-shell-characters-in-envfiles.patch + +------------------------------------------------------------------- +Fri Jul 11 12:21:06 UTC 2014 - werner@suse.de + +- Only on SLES12 seccomp is available on ppc64 and s390x + +------------------------------------------------------------------- +Thu Jul 10 13:33:32 UTC 2014 - werner@suse.de + +- Port and add upstream patch + 0001-units-make-ExecStopPost-action-part-of-ExecStart.patch + +------------------------------------------------------------------- +Wed Jul 9 13:14:02 UTC 2014 - werner@suse.de + +- Add patches + 0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch + 0002-hostnamed-add-a-new-chassis-type-for-watches.patch +- Port and add upstream patches + 0001-journal-compress-return-early-in-uncompress_startswi.patch + 0002-journal-compress-improve-xz-compression-performance.patch + +------------------------------------------------------------------- +Wed Jul 9 12:41:53 UTC 2014 - meissner@suse.com + +- enable seccomp also for ppc64 and s390x + +------------------------------------------------------------------- +Tue Jul 8 10:59:26 UTC 2014 - werner@suse.de + +- Port and add upstream patches + 0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch + 0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch + 0003-architecture-add-string-table-entries-for-mips-le-ar.patch + 0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch + 0005-service-don-t-accept-negative-ERRNO-notification-mes.patch + 0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch + 0007-service-flush-status-text-and-errno-values-each-time.patch + +------------------------------------------------------------------ +Tue Jul 8 10:41:31 UTC 2014 - werner@suse.de + +- Add upstream patch + 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch + ------------------------------------------------------------------- Mon Jul 7 13:06:35 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index ea36e8a..4652a12 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -106,11 +106,17 @@ BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libqrencode) BuildRequires: pkgconfig(usbutils) >= 0.82 %endif +%if 0%{?suse_version} >= 1315 +%ifarch %ix86 x86_64 x32 %arm ppc64le s390x +BuildRequires: pkgconfig(libseccomp) +%endif +%else %if 0%{?suse_version} >= 1310 %ifarch %ix86 x86_64 x32 %arm BuildRequires: pkgconfig(libseccomp) %endif %endif +%endif %if ! 0%{?bootstrap} BuildRequires: libapparmor-devel %endif @@ -140,6 +146,7 @@ Requires: netcfg Requires: pam-config >= 0.79-5 Requires: pwdutils Requires: systemd-presets-branding +Requires: sysvinit-tools Requires: util-linux >= 2.21 Requires(post): coreutils Requires(post): findutils @@ -176,6 +183,7 @@ Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh Source1064: systemd-sleep-grub +Source1065: systemd-remount-tmpfs # # 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 @@ -653,6 +661,40 @@ Patch319: 0002-namespace-fix-uninitialized-memory-access.patch Patch320: 0001-machine-don-t-return-uninitialized-variable.patch # PATCH-FIX-UPSTREAM added at 2014/07/07 Patch321: 0002-vconsole-setup-run-setfont-before-loadkeys.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch322: 0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch323: 0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch324: 0003-architecture-add-string-table-entries-for-mips-le-ar.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch325: 0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch326: 0005-service-don-t-accept-negative-ERRNO-notification-mes.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch327: 0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch328: 0007-service-flush-status-text-and-errno-values-each-time.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch329: 0001-journal-compress-return-early-in-uncompress_startswi.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch330: 0002-journal-compress-improve-xz-compression-performance.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch331: 0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch332: 0002-hostnamed-add-a-new-chassis-type-for-watches.patch +# PATCH-FIX-UPSTREAM added at 2014/07/10 +Patch333: 0001-units-make-ExecStopPost-action-part-of-ExecStart.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch334: 0001-event-pull-in-sd-event.h-from-event-util.h.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch335: 0002-util-fix-has-cc-check-and-add-test.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch336: 0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch337: 0004-fileio-quote-more-shell-characters-in-envfiles.patch +# PATCH-FIX-SUSE Do a vhangup on all consoles lines (bnc#886599) +Patch338: vhangup-on-all-consoles.patch # UDEV PATCHES # ============ @@ -756,6 +798,10 @@ Patch1046: 1046-fix-duplicated-rules-with-layer3-interfaces.patch Patch1047: 1047-udev-net_setup_link-builtin-should-print-the-reason-.patch # PATCH-FIX-UPSTREAM 1048-udev-net_setup_link-add-a-bit-more-logging.patch Patch1048: 1048-udev-net_setup_link-add-a-bit-more-logging.patch +# PATCH-FIX-UPSTREAM 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch +Patch1049: 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch +# PATCH-FIX-SUSE 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch (bnc#885232) +Patch1050: 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -1235,6 +1281,23 @@ cp %{SOURCE7} m4/ %patch319 -p0 %patch320 -p0 %patch321 -p0 +%patch322 -p0 +%patch323 -p0 +%patch324 -p0 +%patch325 -p0 +%patch326 -p0 +%patch327 -p0 +%patch328 -p0 +%patch329 -p0 +%patch330 -p0 +%patch331 -p0 +%patch332 -p0 +%patch333 -p0 +%patch334 -p0 +%patch335 -p0 +%patch336 -p0 +%patch337 -p0 +%patch338 -p0 # udev patches %patch1001 -p1 @@ -1292,6 +1355,8 @@ cp %{SOURCE7} m4/ %patch1046 -p1 %patch1047 -p0 %patch1048 -p0 +%patch1049 -p0 +%patch1050 -p1 # ensure generate files are removed rm -f units/emergency.service @@ -1466,6 +1531,7 @@ 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 +install -m755 -D %{S:1065} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs 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 @@ -1517,12 +1583,6 @@ cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/sg.conf # load sg module at boot time sg EOF -%if 0%{has_efi} -cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/efivars.conf -# load efivars module at boot time -efivars -EOF -%endif # To avoid making life hard for Factory developers, don't package the # kernel.core_pattern setting until systemd-coredump is a part of an actual @@ -1985,9 +2045,6 @@ exit 0 %dir %{_libexecdir}/modules-load.d %dir %{_sysconfdir}/modules-load.d %{_libexecdir}/modules-load.d/sg.conf -%if 0%{has_efi} -%{_libexecdir}/modules-load.d/efivars.conf -%endif %dir %{_libexecdir}/tmpfiles.d %dir %{_sysconfdir}/tmpfiles.d @@ -2168,6 +2225,7 @@ exit 0 %{_prefix}/lib/udev/write_dev_root_rule %{_prefix}/lib/udev/udev-generate-peristent-rule %{_prefix}/lib/udev/net-set-sriov-names +%{_prefix}/lib/udev/remount-tmpfs %{_prefix}/lib/udev/rule_generator.functions %{_prefix}/lib/udev/write_net_rules %dir %{_prefix}/lib/udev/rules.d/ diff --git a/systemd-remount-tmpfs b/systemd-remount-tmpfs new file mode 100644 index 0000000..2e32646 --- /dev/null +++ b/systemd-remount-tmpfs @@ -0,0 +1,15 @@ +#!/bin/sh + +PATH=/usr/bin:/bin:/usr/sbin:/sbin +DIR=$(sed -rn '/^#/d;\@^[[:graph:]]+[[:space:]]+/[[:graph:]]+[[:space:]]+tmpfs[[:space:]]+.*size=[0-9]+[kmg,[:space:]]@{ s@^[[:graph:]]+[[:space:]]+(/[[:graph:]]+).*@\1@p }' /etc/fstab) + +if [ -n "$DIR" ]; then + for i in $DIR; do + echo $i + mount -o remount "$i" >/dev/null 2>&1 + STATE=$? + if [ "$STATE" -gt 0 ]; then + logger "Remount of $i failed with state $STATE" + fi + done +fi diff --git a/systemd.changes b/systemd.changes index 8bec33f..49b84eb 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,84 @@ +------------------------------------------------------------------- +Tue Jul 15 12:30:31 UTC 2014 - rmilasan@suse.com + +- Only rename SRIOV-VF devices if device name start with eth (bnc#885232). + Add 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch + +------------------------------------------------------------------- +Tue Jul 15 07:39:40 UTC 2014 - werner@suse.de + +- Add patch vhangup-on-all-consoles.patch that is do a vhangup on + lines (bnc#886599) + +------------------------------------------------------------------- +Tue Jul 15 06:29:54 UTC 2014 - jlee@suse.com + +- Removed %{_libexecdir}/modules-load.d/efivars.conf because the kernel + patch of autoload efivars driver accepted by linux-efi upstream. + (bnc#881559) + https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit/?h=next&id=be756a5327fe3d4686d74d3e9b273010424e230c + +------------------------------------------------------------------- +Mon Jul 14 14:53:21 UTC 2014 - werner@suse.de + +- Update patch + 1007-physical-hotplug-cpu-and-memory.patch (bnc#869603) +- Add script systemd-remount-tmpfs (bnc#869603) as helper script + for the rule changed in patch 1007-physical-hotplug-cpu-and-memory.patch + +------------------------------------------------------------------- +Mon Jul 14 11:43:12 UTC 2014 - werner@suse.de + +- Add upstream patch + 0001-event-pull-in-sd-event.h-from-event-util.h.patch + 0002-util-fix-has-cc-check-and-add-test.patch + 0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch + 0004-fileio-quote-more-shell-characters-in-envfiles.patch + +------------------------------------------------------------------- +Fri Jul 11 12:21:06 UTC 2014 - werner@suse.de + +- Only on SLES12 seccomp is available on ppc64 and s390x + +------------------------------------------------------------------- +Thu Jul 10 13:33:32 UTC 2014 - werner@suse.de + +- Port and add upstream patch + 0001-units-make-ExecStopPost-action-part-of-ExecStart.patch + +------------------------------------------------------------------- +Wed Jul 9 13:14:02 UTC 2014 - werner@suse.de + +- Add patches + 0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch + 0002-hostnamed-add-a-new-chassis-type-for-watches.patch +- Port and add upstream patches + 0001-journal-compress-return-early-in-uncompress_startswi.patch + 0002-journal-compress-improve-xz-compression-performance.patch + +------------------------------------------------------------------- +Wed Jul 9 12:41:53 UTC 2014 - meissner@suse.com + +- enable seccomp also for ppc64 and s390x + +------------------------------------------------------------------- +Tue Jul 8 10:59:26 UTC 2014 - werner@suse.de + +- Port and add upstream patches + 0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch + 0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch + 0003-architecture-add-string-table-entries-for-mips-le-ar.patch + 0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch + 0005-service-don-t-accept-negative-ERRNO-notification-mes.patch + 0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch + 0007-service-flush-status-text-and-errno-values-each-time.patch + +------------------------------------------------------------------ +Tue Jul 8 10:41:31 UTC 2014 - werner@suse.de + +- Add upstream patch + 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch + ------------------------------------------------------------------- Mon Jul 7 13:06:35 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 6d3eac0..e912903 100644 --- a/systemd.spec +++ b/systemd.spec @@ -101,11 +101,17 @@ BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libqrencode) BuildRequires: pkgconfig(usbutils) >= 0.82 %endif +%if 0%{?suse_version} >= 1315 +%ifarch %ix86 x86_64 x32 %arm ppc64le s390x +BuildRequires: pkgconfig(libseccomp) +%endif +%else %if 0%{?suse_version} >= 1310 %ifarch %ix86 x86_64 x32 %arm BuildRequires: pkgconfig(libseccomp) %endif %endif +%endif %if ! 0%{?bootstrap} BuildRequires: libapparmor-devel %endif @@ -135,6 +141,7 @@ Requires: netcfg Requires: pam-config >= 0.79-5 Requires: pwdutils Requires: systemd-presets-branding +Requires: sysvinit-tools Requires: util-linux >= 2.21 Requires(post): coreutils Requires(post): findutils @@ -171,6 +178,7 @@ Source1061: write_dev_root_rule Source1062: systemd-udev-root-symlink Source1063: udev-generate-peristent-rule.sh Source1064: systemd-sleep-grub +Source1065: systemd-remount-tmpfs # # 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 @@ -648,6 +656,40 @@ Patch319: 0002-namespace-fix-uninitialized-memory-access.patch Patch320: 0001-machine-don-t-return-uninitialized-variable.patch # PATCH-FIX-UPSTREAM added at 2014/07/07 Patch321: 0002-vconsole-setup-run-setfont-before-loadkeys.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch322: 0001-util-consider-0x7F-a-control-chracter-which-it-is-DE.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch323: 0002-util-don-t-consider-tabs-special-in-string_has_cc-an.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch324: 0003-architecture-add-string-table-entries-for-mips-le-ar.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch325: 0004-core-Added-support-for-ERRNO-NOTIFY_SOCKET-message-p.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch326: 0005-service-don-t-accept-negative-ERRNO-notification-mes.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch327: 0006-systemctl-show-StatusErrno-value-in-systemctl-status.patch +# PATCH-FIX-UPSTREAM added at 2014/07/08 +Patch328: 0007-service-flush-status-text-and-errno-values-each-time.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch329: 0001-journal-compress-return-early-in-uncompress_startswi.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch330: 0002-journal-compress-improve-xz-compression-performance.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch331: 0001-logind-allow-switching-to-unused-VTs-via-SwitchTo.patch +# PATCH-FIX-UPSTREAM added at 2014/07/09 +Patch332: 0002-hostnamed-add-a-new-chassis-type-for-watches.patch +# PATCH-FIX-UPSTREAM added at 2014/07/10 +Patch333: 0001-units-make-ExecStopPost-action-part-of-ExecStart.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch334: 0001-event-pull-in-sd-event.h-from-event-util.h.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch335: 0002-util-fix-has-cc-check-and-add-test.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch336: 0003-sd-event-always-call-epoll_ctl-on-mask-updates-if-ed.patch +# PATCH-FIX-UPSTREAM added at 2014/07/14 +Patch337: 0004-fileio-quote-more-shell-characters-in-envfiles.patch +# PATCH-FIX-SUSE Do a vhangup on all consoles lines (bnc#886599) +Patch338: vhangup-on-all-consoles.patch # UDEV PATCHES # ============ @@ -751,6 +793,10 @@ Patch1046: 1046-fix-duplicated-rules-with-layer3-interfaces.patch Patch1047: 1047-udev-net_setup_link-builtin-should-print-the-reason-.patch # PATCH-FIX-UPSTREAM 1048-udev-net_setup_link-add-a-bit-more-logging.patch Patch1048: 1048-udev-net_setup_link-add-a-bit-more-logging.patch +# PATCH-FIX-UPSTREAM 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch +Patch1049: 1049-udev-link_config-ignore-errors-due-to-missing-MAC-ad.patch +# PATCH-FIX-SUSE 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch (bnc#885232) +Patch1050: 1050-only-rename-SRIOV-VF-devices-when-name-starts-with-eth.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -1230,6 +1276,23 @@ cp %{SOURCE7} m4/ %patch319 -p0 %patch320 -p0 %patch321 -p0 +%patch322 -p0 +%patch323 -p0 +%patch324 -p0 +%patch325 -p0 +%patch326 -p0 +%patch327 -p0 +%patch328 -p0 +%patch329 -p0 +%patch330 -p0 +%patch331 -p0 +%patch332 -p0 +%patch333 -p0 +%patch334 -p0 +%patch335 -p0 +%patch336 -p0 +%patch337 -p0 +%patch338 -p0 # udev patches %patch1001 -p1 @@ -1287,6 +1350,8 @@ cp %{SOURCE7} m4/ %patch1046 -p1 %patch1047 -p0 %patch1048 -p0 +%patch1049 -p0 +%patch1050 -p1 # ensure generate files are removed rm -f units/emergency.service @@ -1461,6 +1526,7 @@ 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 +install -m755 -D %{S:1065} %{buildroot}/%{_prefix}/lib/udev/remount-tmpfs 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 @@ -1512,12 +1578,6 @@ cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/sg.conf # load sg module at boot time sg EOF -%if 0%{has_efi} -cat << EOF > %{buildroot}%{_libexecdir}/modules-load.d/efivars.conf -# load efivars module at boot time -efivars -EOF -%endif # To avoid making life hard for Factory developers, don't package the # kernel.core_pattern setting until systemd-coredump is a part of an actual @@ -1980,9 +2040,6 @@ exit 0 %dir %{_libexecdir}/modules-load.d %dir %{_sysconfdir}/modules-load.d %{_libexecdir}/modules-load.d/sg.conf -%if 0%{has_efi} -%{_libexecdir}/modules-load.d/efivars.conf -%endif %dir %{_libexecdir}/tmpfiles.d %dir %{_sysconfdir}/tmpfiles.d @@ -2163,6 +2220,7 @@ exit 0 %{_prefix}/lib/udev/write_dev_root_rule %{_prefix}/lib/udev/udev-generate-peristent-rule %{_prefix}/lib/udev/net-set-sriov-names +%{_prefix}/lib/udev/remount-tmpfs %{_prefix}/lib/udev/rule_generator.functions %{_prefix}/lib/udev/write_net_rules %dir %{_prefix}/lib/udev/rules.d/ diff --git a/vhangup-on-all-consoles.patch b/vhangup-on-all-consoles.patch new file mode 100644 index 0000000..b318b12 --- /dev/null +++ b/vhangup-on-all-consoles.patch @@ -0,0 +1,28 @@ +Related to bnc#886599 and others. That is use the vhangup(8) tool +to explicit do a virtually hangup on the specified on the terminal +line to give e.g. the bash a few seconds to e.g. safe its history. + +--- + units/getty@.service.m4 | 1 + + units/serial-getty@.service.m4 | 1 + + 2 files changed, 2 insertions(+) +--- units/getty@.service.m4 ++++ units/getty@.service.m4 2014-07-15 07:30:28.006235859 +0000 +@@ -29,6 +29,7 @@ ConditionPathExists=/dev/tty0 + [Service] + # the VT is cleared by TTYVTDisallocate + ExecStart=-/sbin/agetty --noclear %I $TERM ++ExecStopPost=-/sbin/vhangup /dev/%I + Type=idle + Restart=always + RestartSec=0 +--- units/serial-getty@.service.m4 ++++ units/serial-getty@.service.m4 2014-07-15 07:30:01.366235017 +0000 +@@ -24,6 +24,7 @@ IgnoreOnIsolate=yes + + [Service] + ExecStart=-/sbin/agetty --keep-baud %I 115200,38400,9600 $TERM ++ExecStopPost=-/sbin/vhangup /dev/%I + Type=idle + Restart=always + RestartSec=0