[PATCH 8/9] add debug command line option
william.jon.mccann at gmail.com
william.jon.mccann at gmail.com
Mon Feb 23 12:35:56 PST 2009
From: William Jon McCann <jmccann at redhat.com>
Used to override the kernel command line and enabled debugging
---
src/main.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main.c b/src/main.c
index 62085b2..ce482ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1103,8 +1103,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))
{
@@ -1154,6 +1153,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;
@@ -1164,6 +1164,7 @@ main (int argc,
ply_command_parser_add_options (state.command_parser,
"help", "This help message", PLY_COMMAND_OPTION_TYPE_FLAG,
"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,
"attach-to-session", "pty_master_fd", PLY_COMMAND_OPTION_TYPE_LONG,
NULL);
@@ -1184,6 +1185,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)
@@ -1201,6 +1203,9 @@ main (int argc,
return 0;
}
+ if (debug)
+ ply_toggle_tracing ();
+
if (mode_string != NULL)
{
if (strcmp (mode_string, "shutdown") == 0)
--
1.6.1.3
More information about the plymouth
mailing list