]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: force tty to /dev/tty if $DISPLAY is set
authorRay Strode <rstrode@redhat.com>
Mon, 23 Sep 2013 19:21:30 +0000 (15:21 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 23 Sep 2013 19:21:30 +0000 (15:21 -0400)
the X11 renderer is useful for testing themes without rebooting,
but it really only functions if the user puts --tty=/dev/tty or
similar.  Furthermore, if a user neglects to do that really bad
stuff happens since plymouth will try to take over VT1.

This commit makes --tty=/dev/tty implied if $DISPLAY is set.

src/main.c

index 81584a5ef2c2df048c861dc0e7d184e30c65c852..9c450c0c743fe9c636ac0a02978654a2ad40d852 100644 (file)
@@ -2241,6 +2241,11 @@ initialize_environment (state_t *state)
   if (!get_kernel_command_line (state))
     return false;
 
+  if (!state->default_tty)
+    {
+      if (getenv ("DISPLAY") != NULL && access (PLYMOUTH_PLUGIN_PATH "renderers/x11.so", F_OK) == 0)
+          state->default_tty = "/dev/tty";
+    }
   if (!state->default_tty)
     {
       if (state->mode == PLY_MODE_SHUTDOWN)