]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
add debug command line option
authorWilliam Jon McCann <jmccann@redhat.com>
Tue, 24 Feb 2009 00:01:41 +0000 (19:01 -0500)
committerWilliam Jon McCann <jmccann@redhat.com>
Thu, 26 Feb 2009 14:41:57 +0000 (09:41 -0500)
Used to override the kernel command line and enabled debugging

src/main.c

index 0524bb67c9026a83db8f1a40e8266620fe707704..5941c6d3a637d5fd32e101aed6022fcf3f4ae23a 100644 (file)
@@ -1179,8 +1179,7 @@ initialize_environment (state_t *state)
     redirect_standard_io_to_device (state->console);
   else
     redirect_standard_io_to_device ("tty1");
-  
-  
+
   for (node = ply_list_get_first_node (state->windows); node;
                     node = ply_list_get_next_node (state->windows, node))
     {
@@ -1230,6 +1229,7 @@ main (int    argc,
   int exit_code;
   bool should_help = false;
   bool no_daemon = false;
+  bool debug = false;
   ply_daemon_handle_t *daemon_handle;
   char *mode_string = NULL;
 
@@ -1241,6 +1241,7 @@ main (int    argc,
                                   "help", "This help message", PLY_COMMAND_OPTION_TYPE_FLAG,
                                   "attach-to-session", "pty_master_fd", PLY_COMMAND_OPTION_TYPE_INTEGER,
                                   "no-daemon", "Do not daemonize", PLY_COMMAND_OPTION_TYPE_FLAG,
+                                  "debug", "Output debugging information", PLY_COMMAND_OPTION_TYPE_FLAG,
                                   "mode", "Mode is one of: boot, shutdown", PLY_COMMAND_OPTION_TYPE_STRING,
                                   NULL);
 
@@ -1260,6 +1261,7 @@ main (int    argc,
                                   "help", &should_help,
                                   "mode", &mode_string,
                                   "no-daemon", &no_daemon,
+                                  "debug", &debug,
                                   "attach-to-session", &state.ptmx,
                                   NULL);
   if (should_help)
@@ -1277,6 +1279,9 @@ main (int    argc,
       return 0;
     }
 
+  if (debug && !ply_is_tracing ())
+    ply_toggle_tracing ();
+
   if (mode_string != NULL)
     {
       if (strcmp (mode_string, "shutdown") == 0)