]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Hide kernel messages for text mode splashes
authorRay Strode <rstrode@redhat.com>
Tue, 11 Nov 2008 18:56:20 +0000 (13:56 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 11 Nov 2008 18:56:20 +0000 (13:56 -0500)
They tend to screw up the display

src/libply/ply-utils.c
src/libply/ply-utils.h
src/plugins/splash/pulser/plugin.c
src/plugins/splash/text/plugin.c

index 08c3bbb10338826f1c380744e71cda7e3b18534e..25371a1e496e1d5a5daef4796deceafdeed294d5 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/klog.h>
 #include <sys/mount.h>
 #include <sys/resource.h>
 #include <sys/socket.h>
 #define PLY_SUPER_SECRET_LAZY_UNMOUNT_FLAG 2
 #endif
 
+#ifndef PLY_DISABLE_CONSOLE_PRINTK
+#define PLY_DISABLE_CONSOLE_PRINTK 6
+#endif
+
+#ifndef PLY_ENABLE_CONSOLE_PRINTK
+#define PLY_ENABLE_CONSOLE_PRINTK 7
+#endif
+
 static int errno_stack[PLY_ERRNO_STACK_SIZE];
 static int errno_stack_position = 0;
 
@@ -778,6 +787,20 @@ ply_create_file_link (const char *source,
   return true;
 }
 
+void
+ply_show_new_kernel_messages (bool should_show)
+{
+  int type;
+
+  if (should_show)
+    type = PLY_ENABLE_CONSOLE_PRINTK;
+  else
+    type = PLY_DISABLE_CONSOLE_PRINTK;
+
+  if (klogctl (type, NULL, 0) < 0)
+    ply_trace ("could not toggle printk visibility: %m");
+}
+
 ply_daemon_handle_t *
 ply_create_daemon (void)
 {
index 493fdad5dea662dc356a4254d76f115bd2b39299..3d3077d6016a4cf08df58a86f19c9c44f5c868b9 100644 (file)
@@ -87,6 +87,7 @@ void ply_close_module (ply_module_handle_t *handle);
 bool ply_create_directory (const char *directory);
 bool ply_create_file_link (const char *source,
                            const char *destination);
+void ply_show_new_kernel_messages (bool should_show);
 
 ply_daemon_handle_t *ply_create_daemon (void);
 bool ply_detach_daemon (ply_daemon_handle_t *handle,
index 089edb9dee519f7531c2090b3ec1886d25f2dd56..d938cff1bd97cf227a010d991a104b0795de0241 100644 (file)
@@ -238,6 +238,8 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
 {
   assert (plugin != NULL);
 
+  ply_show_new_kernel_messages (false);
+
   ply_window_set_keyboard_input_handler (plugin->window,
                                          (ply_window_keyboard_input_handler_t)
                                          on_keyboard_input, plugin);
@@ -311,6 +313,8 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
       ply_window_show_text_cursor (plugin->window);
       ply_window_reset_colors (plugin->window);
     }
+
+  ply_show_new_kernel_messages (true);
 }
 
 void
index 500ca9126cc7d3ac04dcfbe81fdb85da96dcc2bc..f28fdebc68fbea63fae3bd090718601260c14b91 100644 (file)
@@ -268,6 +268,7 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
                                  detach_from_event_loop,
                                  plugin);
 
+  ply_show_new_kernel_messages (false);
   start_animation (plugin);
 
   return true;
@@ -336,6 +337,8 @@ hide_splash_screen (ply_boot_splash_plugin_t *plugin,
       ply_window_show_text_cursor (plugin->window);
       ply_window_reset_colors (plugin->window);
     }
+
+  ply_show_new_kernel_messages (true);
 }
 
 void