Commit graph

1386 commits

Author SHA1 Message Date
Ray Strode
46f7f2104e [boot-server] Add debugging spew
This will just help down the line if there are problems.
2010-03-23 23:49:31 -04:00
Ray Strode
76617409da [main] Fix crash when config files don't exist
I wasn't handling NULL return value correctly before.
2010-03-23 23:26:05 -04:00
Ray Strode
772455097f [script] Silence compiler warning 2010-03-23 23:12:17 -04:00
Ray Strode
ff78fd70cf [daemon] Actually install shipped config files
commit cf766763f2 was
messed up in more than one way.  The biggest problem
was that It didn't include the Makefile changes needed
to ship the files added to the repository.

This commit fixes that.
2010-03-23 23:08:26 -04:00
Ray Strode
f919294e82 [defaults] Drop some debug goo that sneaked in 2010-03-23 22:57:06 -04:00
Ray Strode
b75a0ab5a7 [branch-merge] Add daemon configuration mechanism
This series of commits adds a few configuration files
to replace the kludgey symlink we use now for theme
specification.

In the future, these config files could potentially
be used for other things as well.
2010-03-23 18:02:22 -04:00
Ray Strode
cf766763f2 [daemon] Ship default configuration files
This commit adds plymouthd.defaults and plymouthd.conf.

The former is for distributions to override, and the latter
is for administrators to change.
2010-03-23 18:00:50 -04:00
Ray Strode
5baed15f09 [set-default-theme] Write plymouthd.conf instead of symlink
Now that the daemon looks for the default theme in configuration
files, we should make plymouth-set-default-theme write the
configuration files instead of doing symlinks.

That's what this commit does.
2010-03-23 17:54:08 -04:00
Ray Strode
27562c4f69 [main] Try getting default theme from config file
Right now we figure out the default theme via a symlink.
This apprach is very simple, but is also a little cumbersome.

It means as the default theme is changed around we have to move
the symlink around.

The symlink is in /usr.  We really shouldn't be mucking with
/usr when changing defaults.

This commit checks the filesystem for two config files:

/usr/share/plymouth/plymouthd.defaults
and
/etc/plymouth/plymouthd.conf

The first one is for distributions to use.  This is how they can
manage which splash to show from release to release.

The second one is for system administrators.  This is how they
can override distribution policy.

We don't actually ship these files yet.  In the mean time,
(and even after for the forseeable future) the old symlink method
will still work.
2010-03-23 16:46:56 -04:00
Ray Strode
65550c2d5d [configure] drop --with-default-plugin-link
It's an old interface that I don't think anyone is using.
2010-03-23 16:35:42 -04:00
Ray Strode
73e6e29a98 [configure] change bug report link in AC_INIT
It was my email address, but should probably be bugzilla
(or the mailing list)
2010-03-22 20:54:14 -04:00
Ray Strode
541844965e [configure] run through autoupdate
This just modernizes the file a bit.
2010-03-22 20:46:03 -04:00
Charlie Brej
d28ff94b69 [script] Update default script to use the window X and Y offsets every time
Previously the code was assuming the windows were placed at 0,0. This might not
be the case and the window X and Y values should be used when trying to
position items relative to a window.

This change needs to be applied to all other scripts otherwise mutiple screen
setups may have unaligned elements. Updates scripts should be tested using
multi-head test systems or the x11 test renderer.
2010-03-22 23:39:32 +00:00
Charlie Brej
0bbc243722 [script] Correctly initialise the minimum width when getting minimal window
Values were preset to zero which was the smallest width/height.
2010-03-22 23:33:21 +00:00
Charlie Brej
78edb5ab1e [script] Get window value without an index returns area covered by all windows
Calls to Window.GetWidth/Height/X/Y without a window index now return the
values of the area covered by all windows. This is only the case if all the
windows are aligned (either by their centers, or to a corner).

This allows the theme designer to place an object knowing it will be seen on
all screens.
2010-03-22 23:16:21 +00:00
Charlie Brej
e70dfbe3e0 [script] Return NULL when requesting width of nonexistent window
Minor bug, previously would return the index used rather than a NULL. Would
only cause problems when using a width request as a test of the presence of a
window.
2010-03-22 22:41:17 +00:00
Charlie Brej
a0d16a9bbd [script] Move windows to not start at negative coordinates
When multiple screens are found, the system will now arrange them so they are
all centered, and the top left corner of the largest screen is at 0,0.
No changes to any scripts are needed.
2010-03-22 22:26:47 +00:00
Ray Strode
5b518486ce [main] Deactivate terminal on quit if necessary
If we're done with the VT plymouth was running on,
and plymouth wasn't running on the initial VT, we
should jump back to the initial VT and try to
clean up plymouth's VT.
2010-03-22 00:21:43 -04:00
Ray Strode
93482b7647 [terminal] Add new ply_terminal_deactivate function
This will jump off the VT associated with the terminal
and deallocate it.
2010-03-22 00:11:13 -04:00
Scott James Remnant
9d488d5e48 [ply-text-display] don't set mode on every write
Resetting the mode to text on every write means that if you're
using a text plugin and X starts, X's VT keeps getting reset back to
KD_TEXT since those plugins don't stop writing on deactivate (they
have no renderer).

There's no reason to set this mode here anyway; all paths to using
those plugins already do this.
2010-03-21 23:57:56 -04:00
Scott James Remnant
e9a22723da [terminal] keep track of terminal raw/cooked state
Instead of setting the terminal to unbuffered (raw) mode on every
write, keep track of whether it's unbuffered or not at the points
we open and close the terminal.

Deactivate already takes care to set back into buffered mode;
otherwise we can end up resetting the terminal mode under X causing
Enter to send X SIGQUIT.
2010-03-21 23:48:21 -04:00
Scott James Remnant
0ed7480ed7 [main] deactivate renderer before hiding
If we don't deactivate the renderer before hiding the splash, the
drm renderer may scan out the buffer contents to the fbcon buffer;
since we only hide the splash when dumping details or when
--retain-splash is *not* given to quit, this is exactly the
opposite of what we want.

The effect of not doing this is partial splash contents behind the
details in cases of error, or when using quit.  This doesn't affect
plymouth quit --retain-splash.
2010-03-21 23:48:11 -04:00
Scott James Remnant
d54ae45721 [daemon] add "has active vt?" request
One problem with the current deactivate/quit transition into X is that
the display manager will, if Plymouth was running, re-use the currently
active VT.

That only works if Plymouth was actually displaying a splash screen on
that VT.  If --show-splash hasn't been called yet because we booted too
fast, we'll be on the wrong VT.

Add a request to ask whether the Plymouth VT is active; I've done it
this way so the answer defaults to "yes" for Fedora who use VT1.

The pseudo-code for transition is thus:

  if plymouth is running (ping):
    plymouth deactivate
    if plymouth has active vt:
      start X on current VT with -nr
      if X starts ok:
        plymouth quit --retain-splash
      else if X fails:
        plymouth quit
    else if plymouth doesn't have active vt:
      plymouth quit
      start X as normal
  else if plymouth isn't running:
    start X as normal
2010-03-21 23:23:40 -04:00
Scott James Remnant
33e4d43f42 [client] add "has active vt?" request
This asks the daemon whether it has an active VT, used for a smooth
transition into X.

I've implemented this to look like ping.
2010-03-21 23:23:39 -04:00
Scott James Remnant
5eba40e42b [two-step] 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
49162f4304 [throbgress] 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
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