Commit graph

1360 commits

Author SHA1 Message Date
Scott James Remnant
2346efabb4 [space-flares] resume animations on display_normal
Change the display_normal() function so that rather than being a no-op
if we already saved the state as normal, it restarts any animations and
redraws the views.

The only thing we now do if the state is not previously the same is
hide any prompt.

This allows this to be used to reanimate the plugin on reactivate.
2010-03-21 23:23:39 -04:00
Scott James Remnant
1b4a60cc5c [fade-throbber] resume animations on display_normal
Change the display_normal() function so that rather than being a no-op
if we already saved the state as normal, it restarts any animations and
redraws the views.

The only thing we now do if the state is not previously the same is
hide any prompt.

This allows this to be used to reanimate the plugin on reactivate.
2010-03-21 23:23:39 -04:00
Scott James Remnant
117a434bed [main] update display after reactivate
Since deactivate uses on_boot_splash_idle, there's a good chance that
plugins will have stopped animating.  Prod them to animate again by
calling update_display()
2010-03-21 23:23:39 -04:00
Scott James Remnant
301d372416 [client] Add new reactivate command
This tells the daemon to reactivate itself after having previously
been suspended by the deactivate command.
2010-03-21 23:23:39 -04:00
Scott James Remnant
1976a90cd4 [daemon] Add new reactivate command
More for debugging and completeness than anything else, add a
"reactivate" command to the daemon that undoes the effects of
deactivate and continues the splash screen on its way.

Another possible use for this could be (for example) providing a
seamless shutdown experience.

A future commit will implement the client bits needed.
2010-03-21 23:22:45 -04:00
Scott James Remnant
c27a42a35e [main] check for deactivated before no-splash
Since deactivated doesn't mean no boot splash anymore, we have to
check for the "plymouth quit" while deactivated case first.
2010-03-21 23:15:07 -04:00
Scott James Remnant
47452a1bc9 [main] don't quit splash on deactivate
Currently deactivate is mostly like hide splash, except it deactivates
the renderer first and doesn't reset the VT to text mode and dump the
details plugin over top.

Unfortunately this means that the renderer is closed and freed, and in
the case of the Intel DRM renderer, closing the DRM file descriptor
means that the kernel frees the buffers and restores the fbcon buffer
on our screen - losing the smooth transition.

This now changes deactivate such that it leaves the boot splash open,
but in an inactivate state, with the DRM connection still open, etc.
now the fbcon contents are not restored.

We deliberately stop watching for keyboard input, detach any logging
session from the console, take the VT out of VT_PROCESS mode and
put it back into cooked mode, etc.

This means the X server can be started, and this state can be cleaned
up by calling plymouth quit with affecting X.
2010-03-21 23:15:07 -04:00
Scott James Remnant
9a942466c9 [main] call deactivate_splash() even when no splash
To allow deactivate_splash() to do more than affect the boot splash
plugin and renderer, call it from the deactivate path when there is
no boot splash screen as well.
2010-03-21 23:15:07 -04:00
Scott James Remnant
5dfe559d06 [main] add deactivate_splash() function
To make it easier to alter the deactivate path, split into its own
function.
2010-03-21 23:15:07 -04:00
Scott James Remnant
e6b8a6538f [terminal] export functions to enable/disable VT watching
In order to deactivate without pulling everything, we need to be able
to take the terminal in and out of VT_PROCESS mode directly; so change
the two functions from static to exported.
2010-03-21 23:15:07 -04:00
Scott James Remnant
dbd04d50d5 [main] Ignore deactivate while deactivated
The other obvious command we should ignore while deactivated is
deactivate itself.
2010-03-21 23:15:07 -04:00
Scott James Remnant
3cdaefc8f9 [main] Ignore --hide-splash while deactivated
Since we ignore --show-splash, it makes no sense to process
--hide-splash either; in theory this does nothing already because
we won't have a boot_splash in our state - but that changes with
future patches and it's worth being safe.
2010-03-21 23:15:06 -04:00
Scott James Remnant
704397b5e8 [main] Ignore --show-splash while deactivated
The last thing we want to do after plymouth deactivate is called by
the X display manager is listen to calls to show the splash screen
again.

So don't.
2010-03-21 23:15:06 -04:00
Ray Strode
2dead90bd1 [main] Ensure second quit blocks until quit processed
When it comes to quitting, which must be carefully coordinated
with other subsystems during the boot process, we need to make
sure the client doesn't return early.
2010-03-21 23:13:49 -04:00
Ray Strode
fb19bb2371 [main] Ensure second deactivate blocks until deactivation
When it comes to deactivation where the various steps of boot
have to be carefully synchronized, we need to make sure that
the client doesn't return early.
2010-03-21 23:12:10 -04:00
Scott James Remnant
8ca85f9ab3 [main] fix bug with multiple quit commands
Likewise if plymouth quit is called when we're waiting for the boot
splash to become idle, we also end up asserting that there's not
already an idle trigger.

Fix it in the same way as deactive, ignore the second quit command
except for pulling its trigger.
2010-03-21 23:06:36 -04:00
Scott James Remnant
434a4b2ae8 [main] fix bug with multiple deactivate commands
If plymouth deactivate is called when we're waiting for the boot
splash to become idle, we end up asserting that there's not
already an idle trigger.

Fix it by checking for an existing deactive trigger, and if there
is, ignoring the new deactivate command (except for pulling its
trigger so it doesn't block).
2010-03-21 22:14:59 -04:00
Scott James Remnant
764e7dd306 [main] pull deactivate trigger in quit_program()
To avoid a "plymouth deactivate" command hanging forever in the case
of the program quitting, pull the trigger before the quit trigger.
2010-03-21 22:14:50 -04:00
Scott James Remnant
b1bd05bccd [main] give quit command precedence over deactivate
In the cases where the boot splash plugin does not become idle
immediately, we go back into the main loop and can receive additional
commands.

Since quit and deactive both use this facility, one scenario is the
quit command arriving after the deactivate command, but before the
deactivate command has actually been run.

In that situation, we want to quit, not deactivate.
2010-03-21 22:14:38 -04:00
Ray Strode
c88731e0ff [terminal] Add spew for multiple opens and closes
It may help with debugging problems later on.
2010-03-21 21:39:22 -04:00
Scott James Remnant
7d34bb2fea [branch-merge] Improved VT Handling
One of the main differences between Ubuntu's use of Plymouth and
Fedora's is that on Ubuntu we've tried to keep the X server on VT7
so that the historical documentation of Ctrl-Alt-F1 giving you a
text console is preserved.

This obviously means that for a smooth transition, Plymouth must also
run on VT7.

We discovered that although Plymouth does have code to attempt to deal
with VTs, none of it is quite right and there are many paths that don't
work unless Plymouth is run on VT1.

This patch set fixes our known problems with the VT handling making it
possible to run Plymouth on any VT of your choosing, with VT1 remaining
the default.
2010-03-18 20:05:10 +00:00
Scott James Remnant
48bba4f1cd [configure] allow boot and shutdown ttys to be changed
Allow distributions like Ubuntu to override the boot and shutdown
ttys from the configure script so they don't have to patch the
source.
2010-03-18 20:01:31 +00:00
Scott James Remnant
97b3d4d60d [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.
2010-03-18 20:01:31 +00:00
Scott James Remnant
faaa215e90 [terminal] guard open and close against repeated calls
Since we have a status flag whether or not the terminal fd is open,
use it in the open and close functions to guard against repeated
calls.
2010-03-18 20:01:31 +00:00
Scott James Remnant
b60eab0c4d [x11] default renderer to inactive
Change the renderer so that it defaults to inactive until we
map to the device.
2010-03-18 20:01:31 +00:00
Scott James Remnant
1165c4e16a [frame-buffer] default renderer to inactive
Change the renderer so that it defaults to inactive, then when we
map to the device, activate the renderer by activating the VT;
unless the VT is already active in which case activate the
renderer directly.
2010-03-18 20:01:31 +00:00
Scott James Remnant
5c011e00d3 [drm] default renderer to inactive
Change the renderer so that it defaults to inactive, then when we
map to the device, activate the renderer by activating the VT;
unless the VT is already active in which case activate the
renderer directly.
2010-03-18 20:01:31 +00:00
Scott James Remnant
96999a7321 [terminal,text,details] move activate vt into plugins
Move the responsiblity to activate the VT into the text and details
plugins; this not only matches the graphical renderers, but it also
ensures we activate the VT in all possible code paths.

Previously if we fell back to text.so because we couldn't activate
a renderer, this would not activate the VT.
2010-03-18 20:01:31 +00:00
Scott James Remnant
82494f6efd [x11] ignore terminal completely
The X11 renderer doesn't need a terminal at all, so we ignore it
completely.
2010-03-18 20:01:30 +00:00
Scott James Remnant
59eaa4db59 [frame-buffer] don't run on non-virtual terminals
We only need support DRM on virtual terminals, those that are not
such as serial consoles, can be trivially skipped.
2010-03-18 20:01:30 +00:00
Scott James Remnant
e54373efe4 [drm] don't run on non-virtual terminals
We only need support DRM on virtual terminals, those that are not
such as serial consoles, can be trivially skipped.
2010-03-18 20:01:30 +00:00
Scott James Remnant
a067e97f16 [terminal] move terminal opening into renderers/plugins
Move the responsibility to actually open the terminal to the renderers
and text/details plugin, this allows the X11 renderer to not actually
open the terminal - and thus not crash the X server.
2010-03-18 20:01:30 +00:00
Scott James Remnant
60402980bb [terminal] don't treat ttySx as VT
Only devices with TTY_MAJOR and minor from 0-63 are VTs, 64 onwards
are serial consoles.
2010-03-18 20:01:25 +00:00
Scott James Remnant
c7efc4f250 [terminal] drop next_active_vt
When we activate our VT, now we actually have it in VT_PROCESS not the
VT we started from, we get the proper signal so don't need an ioctl to
wait until its active.

If we were to leave our VT, we'd get the opposite signal as well and
we don't really care whether we actually get to the other VT, just
that we leave ours.

And this code was in the wrong place anyway.
2010-03-18 19:56:46 +00:00
Scott James Remnant
c51a141345 [terminal] don't keep track of active vt, just if vt is active
Trying to keep track of whatever VT is actually active is inherently
racy; instead just keep track of whether our VT is the active one.
Since we guarantee that's the VT in VT_PROCESS now, this is easy.

Rather simplifies the on_vt_changed functions in renderers too.
2010-03-18 19:56:46 +00:00
Scott James Remnant
4bbd0d9bc5 [terminal] drop support for opening the foreground terminal
This isn't used anywhere in plymouth, we should always open a named
terminal to avoid surprises due to VT switches we're not watching
for.
2010-03-18 19:56:46 +00:00
Scott James Remnant
e3f5a8bacd [terminal] only support vt-like operations on VTs
Now we can simply test whether a terminal is virtual or not, add
a guard in the mode and vt change functions that ensure they only
operate on virtual terminals.
2010-03-18 19:56:46 +00:00
Scott James Remnant
4febe5f355 [terminal] add ply_terminal_is_vt() function
We want to be able to query whether a terminal is an ordinary terminal
or a virtual terminal, rather than looking up the vt number and knowing
what the right numbers are, add a function that knows that.
2010-03-18 19:56:46 +00:00
Scott James Remnant
564220da0b [terminal] replace set_active_vt with activate_vt
Since a terminal already knows which VT number it is, there's no
need to accept a VT number for switching to this VT.
2010-03-18 19:56:46 +00:00
Scott James Remnant
7241b9af26 [console] remove console files
Now that everything's switched over to using ply_terminal_t, we
can remove the console files.
2010-03-18 19:56:46 +00:00
Scott James Remnant
b753e7423e [terminal] remove references to ply_console_t
Remove all of the references to ply_console_t from the code, now
we operate exclusively on the terminal object.  In some places
this means switching from one to the other, but in many it just
means dropping the console object and using the terminal object
we were already passed.
2010-03-18 19:56:46 +00:00
Scott James Remnant
d954b7c02a [terminal] merge console and terminal code
This removes the separation in code of "console" functions and
"terminal" functions; this never really made sense, and doesn't
particularly map to the behaviour of Linux virtual terminals.

The three principle operations that Plymouth was using "console"
for were:

 * changing the active VT
 * notification of changes to the active VT through VT_PROCESS
 * switching between text and graphics mode

And it was using the "foreground terminal" alias /dev/tty0 to do
this.  While this is fine for the first of those, since any console
device will do, it's always wrong for the latter two which should
always be on the actual VT we want Plymouth to run from.

If running on tty7, only tty7 should be in VT_PROCESS mode (since
we want to know when we enter this VT and leave this VT), and
certainly only tty7 should be in graphics mode.

Since you can use that same tty to obtain the current active VT,
and switch VT, you don't need another; so the need for a separate
"console" functionality goes away.
2010-03-18 19:56:45 +00:00
Scott James Remnant
56cccfc47f [main] unset keyboard if splash fails to show
Since script implements a set_keyboard function (the only plugin to
do so), the previous commit reveals a bug where set_keyboard is
called for the plugin but unset_keyboard isn't called if the plugin
fails to be loaded
2010-03-18 19:50:44 +00:00
Scott James Remnant
5e97b4ad2c [script] check that there are pixel displays
The script plugin only works on pixel displays, however there wasn't
any check for this, so if a script-based theme was your default
Plymouth would not fallback to using the text plugin instead.
2010-03-18 19:50:40 +00:00
Ray Strode
ea394383c5 [terminal] change fallback terminal settings
I think when I originally added the fallback case, I looked at the
tcgetattr man page, saw cfmakeraw()'s settings and just inverted them.

That's obviously wrong.  These settings should hopefully make a little
more sense.
2010-03-17 15:36:43 -04:00
Adrian Glaubitz
038d755e98 Spelling fix for manpage. 2010-03-11 13:38:18 -05:00
Richard Maw
9b3a1b672b [script] Add SubString function to the script string library
Adds the SubString function which returns a string segment. The two paramiters
are the sub-string start and end indicies. Negative start and end values return
a NULL, as does start index being beyond the end index. Start being beyond the
end of the string returns an empty string.
2010-03-10 20:28:09 +00:00
Ray Strode
bb96d5ad12 [drm] reconnect input source on disconnect
This is like 6f8d51c2cb2f46eac4c2040f5fc8512f65c8d2da
but for the drm renderer.
2010-03-05 13:54:36 -05:00
Ray Strode
a0de30c79e [frame-buffer] reconnect input source on disconnect
This is like 1425549885
but for the frame buffer renderer.
2010-03-05 13:53:21 -05:00
Scott James Remnant
17848a111a Merge branch 'scriptftbfs' 2010-03-02 20:41:02 +00:00