From: Scott James Remnant Date: Thu, 18 Mar 2010 05:09:21 +0000 (+0000) Subject: [main] add --tty command-line option X-Git-Tag: 0.8.0~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97b3d4d60d4881810c2d149e1f317a272300eb82;p=thirdparty%2Fplymouth.git [main] add --tty command-line option Add a command-line option to specify the TTY that plymouth should use. This is mostly useful for debugging, for example you can put plymouth onto a TTY not used by the X server; or if you're feeling particularly sneaky, plymouth into an xterm. --- diff --git a/src/main.c b/src/main.c index 429d8c52..edf7289a 100644 --- a/src/main.c +++ b/src/main.c @@ -1420,12 +1420,15 @@ initialize_environment (state_t *state) state->text_displays = ply_list_new (); state->keyboard = NULL; - if (state->mode == PLY_MODE_SHUTDOWN) + if (!state->default_tty) { - state->default_tty = "tty63"; + if (state->mode == PLY_MODE_SHUTDOWN) + { + state->default_tty = "tty63"; + } + else + state->default_tty = "tty1"; } - else - state->default_tty = "tty1"; check_for_consoles (state, state->default_tty, false); @@ -1517,6 +1520,7 @@ main (int argc, bool attach_to_session; ply_daemon_handle_t *daemon_handle; char *mode_string = NULL; + char *tty = NULL; state.command_parser = ply_command_parser_new ("plymouthd", "Boot splash control server"); @@ -1530,6 +1534,7 @@ main (int argc, "debug-file", "File to output debugging information to", PLY_COMMAND_OPTION_TYPE_STRING, "mode", "Mode is one of: boot, shutdown", PLY_COMMAND_OPTION_TYPE_STRING, "pid-file", "Write the pid of the daemon to a file", PLY_COMMAND_OPTION_TYPE_STRING, + "tty", "TTY to use instead of default", PLY_COMMAND_OPTION_TYPE_STRING, NULL); if (!ply_command_parser_parse_arguments (state.command_parser, state.loop, argv, argc)) @@ -1552,6 +1557,7 @@ main (int argc, "debug", &debug, "debug-file", &debug_buffer_path, "pid-file", &pid_file, + "tty", &tty, NULL); if (should_help) @@ -1582,6 +1588,11 @@ main (int argc, free (mode_string); } + if (tty != NULL) + { + state.default_tty = tty; + } + if (geteuid () != 0) { ply_error ("plymouthd must be run as root user");