From 7c745baabde71df78f8263b34560eb12e29ca9d6 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Feb 20 2014 18:42:25 +0000 Subject: Fix splash after change in /sys/class/tty/console/active --- diff --git a/plymouth.spec b/plymouth.spec index e0218a4..fb1de24 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -8,7 +8,7 @@ Summary: Graphical Boot Animation and Logger Name: plymouth Version: 0.8.9 -Release: 3%{?snapshot_date}%{?dist} +Release: 4%{?snapshot_date}%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -243,6 +243,7 @@ Plymouth. It features a small spinner on a dark background. %prep %setup -q %patch0 -p1 -b .dont-timeout-waiting +%patch1 -p1 -b .sysfs-tty-fix # Change the default theme sed -i -e 's/fade-in/charge/g' src/plymouthd.defaults @@ -495,6 +496,9 @@ fi %defattr(-, root, root) %changelog +* Thu Feb 20 2014 Ray Strode 0.8.9-4.2013.08.14 +- Fix splash after change in /sys/class/tty/console/active + * Thu Oct 31 2013 Ray Strode 0.8.9-3.2013.08.14 - Don't timeout plymouth quit waiting Related: #967521 diff --git a/sysfs-tty-fix.patch b/sysfs-tty-fix.patch new file mode 100644 index 0000000..3545216 --- /dev/null +++ b/sysfs-tty-fix.patch @@ -0,0 +1,72 @@ +diff -up plymouth-0.8.9/src/main.c.sysfs-tty-fix plymouth-0.8.9/src/main.c +--- plymouth-0.8.9/src/main.c.sysfs-tty-fix 2014-02-20 13:30:12.391455465 -0500 ++++ plymouth-0.8.9/src/main.c 2014-02-20 13:29:43.673747888 -0500 +@@ -1980,6 +1980,7 @@ add_display_and_keyboard_for_console (co + + static int + add_consoles_from_file (state_t *state, ++ const char *default_tty, + ply_hashtable_t *consoles, + const char *path) + { +@@ -1988,7 +1989,6 @@ add_consoles_from_file (state_t + ssize_t contents_length; + int num_consoles; + const char *remaining_file_contents; +- + ply_trace ("opening %s", path); + fd = open (path, O_RDONLY); + +@@ -2009,6 +2009,8 @@ add_consoles_from_file (state_t + } + close (fd); + ++ ply_trace ("kernel reports active consoles are '%s'", contents); ++ + remaining_file_contents = contents; + num_consoles = 0; + +@@ -2034,18 +2036,26 @@ add_consoles_from_file (state_t + console_length = strcspn (remaining_file_contents, " \n\t\v"); + console = strndup (remaining_file_contents, console_length); + +- /* If this console is anything besides tty0, then the user is sort +- * of a weird case (uses a serial console or whatever) and they +- * most likely don't want a graphical splash, so force details. +- */ +- if (strcmp (console, "tty0") != 0) +- state->should_force_details = true; +- + asprintf (&console_device, "/dev/%s", console); + ++ /* If this console is anything besides tty0 or the default tty, then ++ * the user is sort of a weird case (uses a serial console or whatever) ++ * and they most likely don't want a graphical splash, so force details. ++ */ ++ if (!state->should_force_details && ++ (strcmp (console, "tty0") != 0) && ++ (strcmp (console_device, default_tty) != 0)) ++ { ++ ply_trace ("forcing details because serial console %s found!", console_device); ++ state->should_force_details = true; ++ } ++ else ++ { ++ ply_trace ("local console %s found!", console_device); ++ } ++ + free (console); + +- ply_trace ("console %s found!", console_device); + ply_hashtable_insert (consoles, console_device, console_device); + num_consoles++; + +@@ -2135,7 +2145,7 @@ check_for_consoles (state_t *state, + + if (!ignore_serial_consoles) + { +- num_consoles = add_consoles_from_file (state, consoles, "/sys/class/tty/console/active"); ++ num_consoles = add_consoles_from_file (state, default_tty, consoles, "/sys/class/tty/console/active"); + + if (num_consoles == 0) + {