[plymouth/f17] Apply correct patch

Ray Strode rstrode at fedoraproject.org
Wed Apr 4 16:21:41 UTC 2012


commit 81a2e0eceec644ad08013ac48d84d1bbca3a4b77
Author: Ray Strode <rstrode at redhat.com>
Date:   Wed Apr 4 12:21:19 2012 -0400

    Apply correct patch
    
    git format-patch typo meant the wrong fix went in

 fix-serial-consoles.patch |  136 +++++++++++++++++++++++++++++++++++++++------
 plymouth.spec             |    5 +-
 2 files changed, 123 insertions(+), 18 deletions(-)
---
diff --git a/fix-serial-consoles.patch b/fix-serial-consoles.patch
index da5533c..11c6206 100644
--- a/fix-serial-consoles.patch
+++ b/fix-serial-consoles.patch
@@ -1,30 +1,132 @@
-From 032a30c489ad658bd03b4145806da2f989db2c7e Mon Sep 17 00:00:00 2001
-From: Colin Guthrie <colin at mageia.org>
-Date: Thu, 15 Dec 2011 10:35:07 +0000
-Subject: [PATCH] main: Also show splash for 'splash=silent' arguments (which
- is what we use in Mageia)
+From f15abb5d95d060c354e7cc4cb22a103df081edf4 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 4 Apr 2012 10:42:12 -0400
+Subject: [PATCH 1/4] main: strdup default tty
 
+Just noticed a memory management problem when looking through
+the code.
+---
+ src/main.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index e4223b7..095f535 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -2007,14 +2007,14 @@ check_for_consoles (state_t    *state,
+   if (console != NULL)
+     {
+       free (console);
+-      ply_hashtable_insert (consoles, (void *) default_tty, (char *) default_tty);
++      ply_hashtable_insert (consoles, (void *) strdup (default_tty), (char *) default_tty);
+     }
+ 
+   console = ply_hashtable_remove (consoles, (void *) "/dev/tty");
+   if (console != NULL)
+     {
+       free (console);
+-      ply_hashtable_insert (consoles, (void *) default_tty, (void *) default_tty);
++      ply_hashtable_insert (consoles, (void *) strdup (default_tty), (void *) default_tty);
+     }
+ 
+   free (state->kernel_console_tty);
+-- 
+1.7.9.3
+
+
+From 990f332b3ff172e02c8defefdd1775470fccb90f Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 4 Apr 2012 11:28:26 -0400
+Subject: [PATCH 2/4] main: fix inverted conditional in active console reading
+ code
+
+We were failing when read succeeded, not when it failed, so
+we were always reverting to fallback.
+---
+ src/main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/main.c b/src/main.c
+index 095f535..5a2f8b1 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -1892,7 +1892,7 @@ add_consoles_from_file (state_t         *state,
+     }
+ 
+   ply_trace ("reading file");
+-  if (read (fd, contents, sizeof (contents)))
++  if (read (fd, contents, sizeof (contents)) <= 0)
+     {
+       ply_trace ("couldn't read it: %m");
+       close (fd);
+-- 
+1.7.9.3
+
+
+From f61c12af16d43a78090ee6587a22ef7d091c945d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 4 Apr 2012 11:38:45 -0400
+Subject: [PATCH 3/4] main: break out of loop when hitting trailing new line
+
+It's important to ignore chunks of the active tty buffer
+that are just whitespace.
 ---
  src/main.c |    6 ++++++
  1 file changed, 6 insertions(+)
 
 diff --git a/src/main.c b/src/main.c
-index 9565a3e..e4223b7 100644
+index 5a2f8b1..72d9f95 100644
 --- a/src/main.c
 +++ b/src/main.c
-@@ -755,6 +755,12 @@ plymouth_should_show_default_splash (state_t *state)
-       return true;
-     }
+@@ -1918,6 +1918,12 @@ add_consoles_from_file (state_t         *state,
+       if (end != NULL)
+         *end = '\0';
  
-+  if (command_line_has_argument (state->kernel_command_line, "splash=silent"))
-+    {
-+      ply_trace ("using default splash because kernel command line has option \"splash=slient\"");
-+      return true;
-+    }
++      if (console[0] == '\0')
++        {
++          free (console);
++          break;
++        }
 +
-   ply_trace ("no default splash because kernel command line lacks \"splash\" or \"rhgb\"");
-   return false;
- }
+       console_length = strlen (console);
+ 
+       asprintf (&console_device, "/dev/%s", console);
+-- 
+1.7.9.3
+
+
+From 03498536f25938079704249316cb96fb42e7857b Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 4 Apr 2012 11:41:40 -0400
+Subject: [PATCH 4/4] main: more console fixes
+
+---
+ src/main.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index 72d9f95..840ef08 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -2013,14 +2013,16 @@ check_for_consoles (state_t    *state,
+   if (console != NULL)
+     {
+       free (console);
+-      ply_hashtable_insert (consoles, (void *) strdup (default_tty), (char *) default_tty);
++      console = strdup (default_tty);
++      ply_hashtable_insert (consoles, console, console);
+     }
+ 
+   console = ply_hashtable_remove (consoles, (void *) "/dev/tty");
+   if (console != NULL)
+     {
+       free (console);
+-      ply_hashtable_insert (consoles, (void *) strdup (default_tty), (void *) default_tty);
++      console = strdup (default_tty);
++      ply_hashtable_insert (consoles, console, console);
+     }
+ 
+   free (state->kernel_console_tty);
 -- 
 1.7.9.3
 
diff --git a/plymouth.spec b/plymouth.spec
index c218cb0..b3b375f 100644
--- a/plymouth.spec
+++ b/plymouth.spec
@@ -6,7 +6,7 @@
 Summary: Graphical Boot Animation and Logger
 Name: plymouth
 Version: 0.8.4
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2
@@ -498,6 +498,9 @@ fi
 %defattr(-, root, root)
 
 %changelog
+* Wed Apr 04 2012 Ray Strode <rstrode at redhat.com> 0.8.4-3
+- Apply correct patch for serial console parsing
+
 * Wed Apr 04 2012 Ray Strode <rstrode at redhat.com> 0.8.4-2
 - Fix problem with serial console parsing
 


More information about the scm-commits mailing list