From e439a44740c60a0bb8ae14a8b8767324ec7f5d7f1a5899dee5d75dd49e1929ba Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 6 Dec 2013 14:15:24 +0000 Subject: [PATCH] . 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}