diff --git a/fix-hvc0-console.patch b/fix-hvc0-console.patch new file mode 100644 index 0000000..e585efd --- /dev/null +++ b/fix-hvc0-console.patch @@ -0,0 +1,165 @@ +From ee7588b9d43c18330cd975914a3ec6b996058de5 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 29 Oct 2009 17:11:00 -0400 +Subject: [PATCH 1/2] [console] Function in degraded mode when closed + +Not all machines will have /dev/tty0. Those that +don't should still work. +--- + src/libplybootsplash/ply-console.c | 8 ++++++-- + src/main.c | 3 --- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/libplybootsplash/ply-console.c b/src/libplybootsplash/ply-console.c +index fb5a86d..10e8ce4 100644 +--- a/src/libplybootsplash/ply-console.c ++++ b/src/libplybootsplash/ply-console.c +@@ -190,10 +190,12 @@ static void + ply_console_watch_for_vt_changes (ply_console_t *console) + { + assert (console != NULL); +- assert (console->fd >= 0); + + struct vt_mode mode = { 0 }; + ++ if (console->fd < 0); ++ return; ++ + if (console->is_watching_for_vt_changes) + return; + +@@ -349,7 +351,9 @@ ply_console_set_active_vt (ply_console_t *console, + int vt_number) + { + assert (console != NULL); +- assert (vt_number > 0); ++ ++ if (vt_number <= 0) ++ return false; + + if (vt_number == console->active_vt) + return true; +diff --git a/src/main.c b/src/main.c +index abfd430..548e1f7 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1293,9 +1293,6 @@ check_for_consoles (state_t *state, + !ply_console_open (state->console)) + { + ply_trace ("could not open /dev/tty0"); +- ply_console_free (state->console); +- state->console = NULL; +- return; + } + + remaining_command_line = state->kernel_command_line; +-- +1.6.5.1 + + +From 5b53999611604fb575519f87c8369c8cb351aa26 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 29 Oct 2009 17:12:28 -0400 +Subject: [PATCH 2/2] [main] Don't add duplicate text display + +Before we were adding the same text display once at start up +and once on show splash. +--- + src/main.c | 28 ++++++++++++++++++++++------ + 1 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/src/main.c b/src/main.c +index 548e1f7..daef780 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -133,7 +133,8 @@ static void on_error_message (ply_buffer_t *debug_buffer, + static ply_buffer_t *debug_buffer; + static char *debug_buffer_path = NULL; + static void check_for_consoles (state_t *state, +- const char *default_tty); ++ const char *default_tty, ++ bool should_add_displays); + + static void + on_session_output (state_t *state, +@@ -568,7 +569,7 @@ on_show_splash (state_t *state) + return; + } + +- check_for_consoles (state, state->default_tty); ++ check_for_consoles (state, state->default_tty, true); + + has_display = ply_list_get_length (state->pixel_displays) > 0 || + ply_list_get_length (state->text_displays) > 0; +@@ -1279,7 +1280,8 @@ check_logging (state_t *state) + + static void + check_for_consoles (state_t *state, +- const char *default_tty) ++ const char *default_tty, ++ bool should_add_displays) + { + char *console_key; + char *remaining_command_line; +@@ -1320,10 +1322,11 @@ check_for_consoles (state_t *state, + state->kernel_console_tty = strdup (default_tty); + } + +- add_display_and_keyboard_for_terminal (state, state->kernel_console_tty); ++ if (should_add_displays) ++ add_display_and_keyboard_for_terminal (state, state->kernel_console_tty); + } + +- if (ply_list_get_length (state->text_displays) == 0) ++ if (should_add_displays && ply_list_get_length (state->text_displays) == 0) + add_default_displays_and_keyboard (state); + } + +@@ -1379,7 +1382,7 @@ initialize_environment (state_t *state) + else + state->default_tty = "tty1"; + +- check_for_consoles (state, state->default_tty); ++ check_for_consoles (state, state->default_tty, false); + + if (state->kernel_console_tty != NULL) + redirect_standard_io_to_device (state->kernel_console_tty); +@@ -1417,15 +1420,27 @@ dump_debug_buffer_to_file (void) + close (fd); + } + ++ #include ++ #include + static void + on_crash (int signum) + { ++ struct termios term_attributes; + int fd; + + fd = open ("/dev/tty1", O_RDWR | O_NOCTTY); ++ if (fd < 0) fd = open ("/dev/hvc0", O_RDWR | O_NOCTTY); + + ioctl (fd, KDSETMODE, KD_TEXT); + ++ tcgetattr (fd, &term_attributes); ++ ++ term_attributes.c_iflag |= IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON; ++ term_attributes.c_oflag |= OPOST; ++ term_attributes.c_lflag |= ECHO | ECHONL | ICANON | ISIG | IEXTEN; ++ ++ tcsetattr (fd, TCSAFLUSH, &term_attributes); ++ + close (fd); + + if (debug_buffer != NULL) +@@ -1500,6 +1515,7 @@ main (int argc, + return 0; + } + ++ debug = 1; + if (debug && !ply_is_tracing ()) + ply_toggle_tracing (); + +-- +1.6.5.1 + diff --git a/plymouth.spec b/plymouth.spec index 67abe50..7a5605b 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -6,7 +6,7 @@ Summary: Graphical Boot Animation and Logger Name: plymouth Version: 0.8.0 -Release: 0.2009.29.09.14%{?dist} +Release: 0.2009.29.09.15%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.bz2 @@ -40,6 +40,7 @@ Patch6: fix-details-clear-screen.patch Patch7: fix-text-shutdown-crash.patch Patch8: fix-text-ask-for-password.patch Patch9: dont-unlink-devnull.patch +Patch10: fix-hvc0-console.patch %description Plymouth provides an attractive graphical boot animation in @@ -256,6 +257,7 @@ plugin. %patch7 -p1 -b .fix-text-shutdown-crash %patch8 -p1 -b .fix-text-ask-for-password %patch9 -p1 -b .dont-unlink-devnull +%patch10 -p1 -b .fix-hvc0-console %build %configure --enable-tracing --disable-tests --without-boot-entry \ @@ -473,6 +475,9 @@ fi %defattr(-, root, root) %changelog +* Thu Oct 29 2009 Ray Strode 0.8.0-0.2009.29.09.15 +- Fix plymouth over ppc hyperviser console (bug 531581) + * Thu Oct 29 2009 Ray Strode 0.8.0-0.2009.29.09.14 - Don't unlink /dev/null (bug 531740)