SHA256
1
0
forked from pool/systemd
Dr. Werner Fink 2013-12-06 14:15:24 +00:00 committed by Git OBS Bridge
parent 24760b4f89
commit c0ae76349f
4 changed files with 66 additions and 51 deletions

View File

@ -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. */

View File

@ -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 <sys/signalfd.h>
#include <sys/ioctl.h>
+#include <linux/fs.h>
#include <linux/sockios.h>
#include <sys/statvfs.h>
#include <sys/mman.h>
@@ -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);

View File

@ -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

View File

@ -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}