[systemd/f16] avoid glitch with plymouth, logind fixes

Michal Schmidt michich at fedoraproject.org
Mon Jan 30 08:32:11 UTC 2012


commit e1f7878ec3afd3e99be7d3315b938806b0beeb0c
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Sun Jan 29 22:03:20 2012 +0100

    avoid glitch with plymouth, logind fixes

 ...-sure-we-create-var-lib-systemd-before-us.patch |   27 +++++
 ...sys_tty_config-capability-to-let-it-use-V.patch |   27 +++++
 ...in-don-t-force-text-mode-in-console_setup.patch |  101 ++++++++++++++++++++
 systemd.spec                                       |    9 ++-
 4 files changed, 163 insertions(+), 1 deletions(-)
---
diff --git a/0135-logind-make-sure-we-create-var-lib-systemd-before-us.patch b/0135-logind-make-sure-we-create-var-lib-systemd-before-us.patch
new file mode 100644
index 0000000..1291cd7
--- /dev/null
+++ b/0135-logind-make-sure-we-create-var-lib-systemd-before-us.patch
@@ -0,0 +1,27 @@
+From a94dce17411ac4bf5d111beaa640b909033b62f7 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Fri, 27 Jan 2012 20:48:28 +0100
+Subject: [PATCH] logind: make sure we create /var/lib/systemd before using it
+ (cherry picked from commit
+ 02b16a19a4f786f63ad6f4e8f6e185b41c9ca386)
+
+---
+ src/logind-dbus.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/src/logind-dbus.c b/src/logind-dbus.c
+index efbc040..48b8c36 100644
+--- a/src/logind-dbus.c
++++ b/src/logind-dbus.c
+@@ -1188,6 +1188,8 @@ static DBusHandlerResult manager_message_handler(
+                 if (r < 0)
+                         return bus_send_error_reply(connection, message, &error, r);
+ 
++                mkdir_p("/var/lib/systemd", 0755);
++
+                 r = safe_mkdir("/var/lib/systemd/linger", 0755, 0, 0);
+                 if (r < 0)
+                         return bus_send_error_reply(connection, message, &error, r);
+-- 
+1.7.7.6
+
diff --git a/0136-logind-add-sys_tty_config-capability-to-let-it-use-V.patch b/0136-logind-add-sys_tty_config-capability-to-let-it-use-V.patch
new file mode 100644
index 0000000..9755457
--- /dev/null
+++ b/0136-logind-add-sys_tty_config-capability-to-let-it-use-V.patch
@@ -0,0 +1,27 @@
+From 1a587a67ab522dee3d11cad49d0d509ed5a081d2 Mon Sep 17 00:00:00 2001
+From: Mike Kazantsev <mk.fraggod at gmail.com>
+Date: Fri, 27 Jan 2012 21:13:42 +0100
+Subject: [PATCH] logind: add sys_tty_config capability, to let it use
+ VT_ACTIVATE ioctl on "activate" action (cherry picked from
+ commit 9c07474c6fa296195dcdc734d77792dff95f5c35)
+
+---
+ units/systemd-logind.service.in |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
+index c332039..531b8f7 100644
+--- a/units/systemd-logind.service.in
++++ b/units/systemd-logind.service.in
+@@ -14,7 +14,7 @@ Description=Login Service
+ ExecStart=@rootlibexecdir@/systemd-logind
+ Type=dbus
+ BusName=org.freedesktop.login1
+-CapabilityBoundingSet=CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER
++CapabilityBoundingSet=CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG
+ 
+ # Increase the default a bit in order to allow many simultaneous
+ # logins since we keep one fd open per session.
+-- 
+1.7.7.6
+
diff --git a/0137-main-don-t-force-text-mode-in-console_setup.patch b/0137-main-don-t-force-text-mode-in-console_setup.patch
new file mode 100644
index 0000000..0e34a16
--- /dev/null
+++ b/0137-main-don-t-force-text-mode-in-console_setup.patch
@@ -0,0 +1,101 @@
+From e5740fa36d79ecd9d4aaee5f757c1829be232978 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Sun, 29 Jan 2012 21:55:51 +0100
+Subject: [PATCH] main: don't force text mode in console_setup()
+
+When systemd starts, plymouth may be already displaying progress
+graphically. Do not switch the console to text mode at that time.
+All other users of reset_terminal_fd() do the switch as before.
+
+This avoids a graphical glitch with plymouth, especially visible with
+vesafb, but could be also seen as a sub-second blink with radeon.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=785548
+(cherry picked from commit 512947d46f9fd7daf74c059ac8548cc98b294807)
+---
+ src/main.c |    8 ++++++--
+ src/util.c |   10 ++++++----
+ src/util.h |    2 +-
+ 3 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index cdf32bf..87e0f32 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -200,12 +200,16 @@ static int console_setup(bool do_reset) {
+         if (!do_reset)
+                 return 0;
+ 
+-        if ((tty_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC)) < 0) {
++        tty_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
++        if (tty_fd < 0) {
+                 log_error("Failed to open /dev/console: %s", strerror(-tty_fd));
+                 return -tty_fd;
+         }
+ 
+-        if ((r = reset_terminal_fd(tty_fd)) < 0)
++        /* We don't want to force text mode.
++         * plymouth may be showing pictures already from initrd. */
++        r = reset_terminal_fd(tty_fd, false);
++        if (r < 0)
+                 log_error("Failed to reset /dev/console: %s", strerror(-r));
+ 
+         close_nointr_nofail(tty_fd);
+diff --git a/src/util.c b/src/util.c
+index 497fd05..ed939a2 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -2472,7 +2472,7 @@ int ask(char *ret, const char *replies, const char *text, ...) {
+         }
+ }
+ 
+-int reset_terminal_fd(int fd) {
++int reset_terminal_fd(int fd, bool switch_to_text) {
+         struct termios termios;
+         int r = 0;
+ 
+@@ -2488,7 +2488,8 @@ int reset_terminal_fd(int fd) {
+         ioctl(fd, TIOCNXCL);
+ 
+         /* Switch to text mode */
+-        ioctl(fd, KDSETMODE, KD_TEXT);
++        if (switch_to_text)
++                ioctl(fd, KDSETMODE, KD_TEXT);
+ 
+         /* Enable console unicode mode */
+         ioctl(fd, KDSKBMODE, K_UNICODE);
+@@ -2542,7 +2543,7 @@ int reset_terminal(const char *name) {
+         if (fd < 0)
+                 return fd;
+ 
+-        r = reset_terminal_fd(fd);
++        r = reset_terminal_fd(fd, true);
+         close_nointr_nofail(fd);
+ 
+         return r;
+@@ -2736,7 +2737,8 @@ int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocst
+         if (notify >= 0)
+                 close_nointr_nofail(notify);
+ 
+-        if ((r = reset_terminal_fd(fd)) < 0)
++        r = reset_terminal_fd(fd, true);
++        if (r < 0)
+                 log_warning("Failed to reset terminal: %s", strerror(-r));
+ 
+         return fd;
+diff --git a/src/util.h b/src/util.h
+index 944c7d2..441c75f 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -325,7 +325,7 @@ int chvt(int vt);
+ int read_one_char(FILE *f, char *ret, bool *need_nl);
+ int ask(char *ret, const char *replies, const char *text, ...);
+ 
+-int reset_terminal_fd(int fd);
++int reset_terminal_fd(int fd, bool switch_to_text);
+ int reset_terminal(const char *name);
+ 
+ int open_terminal(const char *name, int mode);
+-- 
+1.7.7.6
+
diff --git a/systemd.spec b/systemd.spec
index 73c99f8..2e3712b 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -2,7 +2,7 @@ Name:           systemd
 Url:            http://www.freedesktop.org/wiki/Software/systemd
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Version:        37
-Release:        11%{?dist}
+Release:        12%{?dist}
 License:        GPLv2+
 Group:          System Environment/Base
 Summary:        A System and Service Manager
@@ -182,6 +182,9 @@ Patch0131:      0131-logind-downgrade-login-message-to-debug.patch
 Patch0132:      0132-service-add-missing-pid-file-unwatch-in-the-destruct.patch
 Patch0133:      0133-socket-don-t-fail-the-socket-on-ENOTCONN.patch
 Patch0134:      0134-mount-fix-automount-regression.patch
+Patch0135:      0135-logind-make-sure-we-create-var-lib-systemd-before-us.patch
+Patch0136:      0136-logind-add-sys_tty_config-capability-to-let-it-use-V.patch
+Patch0137:      0137-main-don-t-force-text-mode-in-console_setup.patch
 
 # For sysvinit tools
 Obsoletes:      SysVinit < 2.86-24, sysvinit < 2.86-24
@@ -503,6 +506,10 @@ fi
 %{_bindir}/systemd-sysv-convert
 
 %changelog
+* Sun Jan 29 2012 Michal Schmidt <mschmidt at redhat.com> - 37-12
+- Avoid a glitch with plymouth (#785548).
+- Fix logind capabilities.
+
 * Thu Jan 26 2012 Michal Schmidt <mschmidt at redhat.com> - 37-11
 - Fix automount regression.
 


More information about the scm-commits mailing list