From 24760b4f89b5fa49f4403a40fef0ca7aea5b1cff0e3d207601d430d32b94e29b Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 5 Dec 2013 17:06:18 +0000 Subject: [PATCH 1/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=470 --- 1013-serial-console-names-and-index.patch | 49 +++++++++++++++++++++++ systemd.spec | 6 ++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 1013-serial-console-names-and-index.patch diff --git a/1013-serial-console-names-and-index.patch b/1013-serial-console-names-and-index.patch new file mode 100644 index 00000000..e2477f24 --- /dev/null +++ b/1013-serial-console-names-and-index.patch @@ -0,0 +1,49 @@ +--- systemd-208/src/getty-generator/getty-generator.c ++++ systemd-208/src/getty-generator/getty-generator.c 2013-12-05 14:55:31.178235334 +0000 +@@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { + /* Automatically add in a serial getty on all active + * kernel consoles */ + FOREACH_WORD(w, l, active, state) { +- char *tty; ++ char *tty, *p; + int k; + + tty = strndup(w, l); +@@ -144,6 +144,37 @@ int main(int argc, char *argv[]) { + continue; + } + ++ if (asprintf(&p, "/sys/class/tty/%s", tty) < 0) { ++ log_oom(); ++ r = EXIT_FAILURE; ++ goto finish; ++ } ++ ++ k = access(p, F_OK); ++ free(p); ++ ++ if (k < 0) { ++ char *t; ++ int n; ++ if ((p = strchr(tty, '-')) == NULL) ++ continue; ++ t = p+1; ++ if (*t < '1' || *t > '9') ++ continue; ++ k = safe_atoi(t, &n); ++ if (k < 0) ++ continue; ++ n--; ++ *p = '\0'; ++ if (asprintf(&t, "%s%d", tty, n) < 0) { ++ log_oom(); ++ r = EXIT_FAILURE; ++ goto finish; ++ } ++ free(tty); ++ tty = t; ++ } ++ + /* We assume that gettys on virtual terminals are + * started via manual configuration and do this magic + * only for non-VC terminals. */ diff --git a/systemd.spec b/systemd.spec index 3ec76694..72bd3bc3 100644 --- a/systemd.spec +++ b/systemd.spec @@ -260,9 +260,12 @@ Patch1009: 1009-make-xsltproc-use-correct-ROFF-links.patch Patch1010: 1010-do-not-install-sulogin-unit-with-poweroff.patch # PATCH-FIX-OPENSUSE 1011-check-4-valid-kmsg-device.patch -- Avoid busy systemd-journald (bnc#851393) Patch1011: 1011-check-4-valid-kmsg-device.patch -# PATCH-FIX-PSTREAM 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch +# PATCH-FIX-UPSTREAM 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch Patch1012: 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch +# PATCH-FIX-UPSTREAM U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch +# PATCH-FIX-UPSTREAM 1013-serial-console-names-and-index.patch +Patch1014: 1013-serial-console-names-and-index.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -542,6 +545,7 @@ cp %{SOURCE7} m4/ %patch1011 -p1 %patch1012 -p1 %patch1013 -p1 +%patch1014 -p1 # ensure generate files are removed rm -f units/emergency.service From c0ae76349f668ceb86bc187088c7bd3e64b58c2d99d930111d2cac3afbffe451 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 6 Dec 2013 14:15:24 +0000 Subject: [PATCH 2/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=471 --- 1013-serial-console-names-and-index.patch | 49 ----------------------- 1014-journald-with-journaling-FS.patch | 49 +++++++++++++++++++++++ systemd.changes | 12 ++++++ systemd.spec | 7 +++- 4 files changed, 66 insertions(+), 51 deletions(-) delete mode 100644 1013-serial-console-names-and-index.patch create mode 100644 1014-journald-with-journaling-FS.patch diff --git a/1013-serial-console-names-and-index.patch b/1013-serial-console-names-and-index.patch deleted file mode 100644 index e2477f24..00000000 --- a/1013-serial-console-names-and-index.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- systemd-208/src/getty-generator/getty-generator.c -+++ systemd-208/src/getty-generator/getty-generator.c 2013-12-05 14:55:31.178235334 +0000 -@@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { - /* Automatically add in a serial getty on all active - * kernel consoles */ - FOREACH_WORD(w, l, active, state) { -- char *tty; -+ char *tty, *p; - int k; - - tty = strndup(w, l); -@@ -144,6 +144,37 @@ int main(int argc, char *argv[]) { - continue; - } - -+ if (asprintf(&p, "/sys/class/tty/%s", tty) < 0) { -+ log_oom(); -+ r = EXIT_FAILURE; -+ goto finish; -+ } -+ -+ k = access(p, F_OK); -+ free(p); -+ -+ if (k < 0) { -+ char *t; -+ int n; -+ if ((p = strchr(tty, '-')) == NULL) -+ continue; -+ t = p+1; -+ if (*t < '1' || *t > '9') -+ continue; -+ k = safe_atoi(t, &n); -+ if (k < 0) -+ continue; -+ n--; -+ *p = '\0'; -+ if (asprintf(&t, "%s%d", tty, n) < 0) { -+ log_oom(); -+ r = EXIT_FAILURE; -+ goto finish; -+ } -+ free(tty); -+ tty = t; -+ } -+ - /* We assume that gettys on virtual terminals are - * started via manual configuration and do this magic - * only for non-VC terminals. */ diff --git a/1014-journald-with-journaling-FS.patch b/1014-journald-with-journaling-FS.patch new file mode 100644 index 00000000..406a6aed --- /dev/null +++ b/1014-journald-with-journaling-FS.patch @@ -0,0 +1,49 @@ +--- systemd-208/src/journal/journald-server.c ++++ systemd-208/src/journal/journald-server.c 2013-12-06 12:37:27.482735840 +0000 +@@ -21,6 +21,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -878,7 +879,7 @@ finish: + + + static int system_journal_open(Server *s) { +- int r; ++ int r, fd; + char *fn; + sd_id128_t machine; + char ids[33]; +@@ -905,7 +906,28 @@ static int system_journal_open(Server *s + (void) mkdir("/var/log/journal/", 0755); + + fn = strappenda("/var/log/journal/", ids); +- (void) mkdir(fn, 0755); ++ ++ /* ++ * On journaling and/or compressing file systems avoid doubling the ++ * efforts for the system, that is set NOCOW and NOCOMP inode flags. ++ * Check for every single flag as otherwise some of the file systems ++ * may return EOPNOTSUPP on one unkown flag (like BtrFS does). ++ */ ++ if (mkdir(fn, 0755) == 0 && (fd = open(fn, O_DIRECTORY)) >= 0) { ++ long flags; ++ if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == 0) { ++ if (ioctl(fd, FS_IOC_SETFLAGS, flags|FS_NOATIME_FL) == 0) ++ flags |= FS_NOATIME_FL; ++ if (ioctl(fd, FS_IOC_SETFLAGS, flags|FS_NOCOW_FL) == 0) ++ flags |= FS_NOCOW_FL; ++ if (s->compress) { ++ flags &= ~FS_COMPR_FL; ++ flags |= FS_NOCOMP_FL; ++ } ++ ioctl(fd, FS_IOC_SETFLAGS, flags); ++ } ++ close(fd); ++ } + + fn = strappenda(fn, "/system.journal"); + r = journal_file_open_reliably(fn, O_RDWR|O_CREAT, 0640, s->compress, s->seal, &s->system_metrics, s->mmap, NULL, &s->system_journal); diff --git a/systemd.changes b/systemd.changes index 2171b924..553acea1 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de + +- Add patch + 1014-journald-with-journaling-FS.patch + which now uses the file system ioctls for switching off atime, + compression, and copy-on-write of the journal directory of the + the systemd-journald (bnc#838475) +- Let udev package explicite require the package libpcre1 as this + seems not to be autodetected +- Also build require the package config for libpcre + ------------------------------------------------------------------- Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd.spec b/systemd.spec index 72bd3bc3..66279346 100644 --- a/systemd.spec +++ b/systemd.spec @@ -68,6 +68,7 @@ BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(libmicrohttpd) %endif BuildRequires: pkgconfig(libpci) >= 3 +BuildRequires: pkgconfig(libpcre) %if ! 0%{?bootstrap} BuildRequires: pkgconfig(libqrencode) %endif @@ -264,8 +265,8 @@ Patch1011: 1011-check-4-valid-kmsg-device.patch Patch1012: 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch # PATCH-FIX-UPSTREAM U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch -# PATCH-FIX-UPSTREAM 1013-serial-console-names-and-index.patch -Patch1014: 1013-serial-console-names-and-index.patch +# PATCH-FIX-OPENSUSE 1014-journald-with-journaling-FS.patch +Patch1014: 1014-journald-with-journaling-FS.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -318,6 +319,8 @@ Conflicts: mkinitrd < 2.7.0 Conflicts: util-linux < 2.16 Conflicts: ConsoleKit < 0.4.1 Requires: filesystem +# This one is missed but should be autotected, shouldn't it? +Requires: libpcre1 %if 0%{?bootstrap} Provides: udev = %{version} Conflicts: libudev%{udev_major} From 074985b59f45d0fd33b00512c170348a3ce80ade07dd55c125799b5bb238774e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 6 Dec 2013 14:34:09 +0000 Subject: [PATCH 3/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=472 --- systemd.changes | 4 +--- systemd.spec | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/systemd.changes b/systemd.changes index 553acea1..ac4e6d52 100644 --- a/systemd.changes +++ b/systemd.changes @@ -6,9 +6,7 @@ Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de which now uses the file system ioctls for switching off atime, compression, and copy-on-write of the journal directory of the the systemd-journald (bnc#838475) -- Let udev package explicite require the package libpcre1 as this - seems not to be autodetected -- Also build require the package config for libpcre +- Let us build require the package config for libpcre (bnc#853293) ------------------------------------------------------------------- Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd.spec b/systemd.spec index 66279346..daa68f57 100644 --- a/systemd.spec +++ b/systemd.spec @@ -319,8 +319,6 @@ Conflicts: mkinitrd < 2.7.0 Conflicts: util-linux < 2.16 Conflicts: ConsoleKit < 0.4.1 Requires: filesystem -# This one is missed but should be autotected, shouldn't it? -Requires: libpcre1 %if 0%{?bootstrap} Provides: udev = %{version} Conflicts: libudev%{udev_major}