Ray Strode [Fri, 9 Apr 2010 20:07:11 +0000 (16:07 -0400)]
[main] Use updated terminal attrs on crash
In commit ea394383c54dda771dcf59e7ec11280fa945280b I changed
the terminal settings used by ply-terminal. This commit puts
those same settings into effect in the crash path.
Ray Strode [Mon, 5 Apr 2010 14:14:47 +0000 (10:14 -0400)]
[client] Allow unlimited unlock attempts
The ask-for-password command has an option
to specify the maximum number of retries to
get the correct password. The default number
of retries was 3. This makes sense for /opt,
and to a lesser degree /home, but it doesn't
make sense at all for /, since failing means
the system won't boot.
The new default is "unlimited". This fixes the
/ case, but has the downside that all integration
code that was depending on the 3 default before
will need to get updated.
Charlie Brej [Fri, 2 Apr 2010 16:24:07 +0000 (17:24 +0100)]
[script] Reference this if function is called with current object as this
If calling a function which is connected to the current object, the object
operated on in the function call is the current object. This is rarely used and
somehow survived without causing crashes despite incorrectly not increasing the
refcount.
Ray Strode [Thu, 1 Apr 2010 18:37:41 +0000 (14:37 -0400)]
[drm] Conditionalize fb fallback with 1-head ttm
When using the old style transition code path where
plymouth quits before X starts, we can't use the drm
renderer for single head nouveau and readeon setups
because their kernel memory manager doesn't allow userspace
write access to the console fb and the old style
transition code needs to dump the last frame of the
plymouth animation to the console fb as intermediate step
of the transition process.
The newer plymouth deactivate mechanism doesn't need the
intermediate console fb copy, so we can stick with the
drm renderer all the time.
This commit conditionalizes the "bail to frame-buffer renderer"
check based on whether the build is configured to enable
the old style transition.
Charlie Brej [Thu, 1 Apr 2010 14:47:29 +0000 (15:47 +0100)]
[script] Connect and disconnect the keyboard on start and stop
Previously we were connecting to the keyboard but not disconnecting from it as
unset_keyboard was not called before the plugin being destroyed. Now we connect
when on splash start and destroy which makes sure we disconnect before being
destroyed.
Charlie Brej [Wed, 31 Mar 2010 18:16:36 +0000 (19:16 +0100)]
[terminal] Do not discard the input when turning the terminal unbuffered
Drawing to renderers was resetting the terminal to unbuffered, but this was
also discarding any queued input keys. The fix should keep the input buffer
untouched.
It's possible for activate to be called before map_to_device, for
example if a non-graphical splash plugin is in use. Initialize
map_address to MAP_FAILED so that we won't try to redraw in this
situation.
Charlie Brej [Mon, 29 Mar 2010 21:56:11 +0000 (22:56 +0100)]
[main] Watch keyboard input after the splash had a chance to quit
If the splash hasn't picked up any displays it will abort. We wait for the
possible abort before attaching the keyboard. This is a slight hack as now
add_displays_and_keyboard_to_boot_splash no longer adds the keyboards. Also the
splash plugin can access the keyboard before it is officially opened.
For now it just fixes the terminal fd < 0 assertion bug.
Ray Strode [Mon, 29 Mar 2010 19:20:44 +0000 (15:20 -0400)]
[main] watch keyboard input after displays are added
Since the boot splashes handle opening the terminal now,
we need to make sure that we don't try to watch for input on
the terminal until they've opened it.
This should fix some crashes users are reportedly seeing with
the details splash.
A potentially better fix would be to make watch_for_input defer
doing anything on its own using the terminal is opened. That
would require a trigger and some new api to ply-terminal, I think.
Steve Langasek [Mon, 29 Mar 2010 10:51:24 +0000 (11:51 +0100)]
[main] Watch-for-keystroke should also be sensitive to enter
Because enter and general keystrokes are handled separately, enter would not
activate the keystroke trigger. Now, you can watch specifically for an enter
press, and enter is accepted as a general any-key trigger.
Ray Strode [Wed, 24 Mar 2010 03:00:11 +0000 (23:00 -0400)]
[daemon] Actually install shipped config files
commit cf766763f26ad0bb8e001a9ecf65b00f4c766e3c 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.
Ray Strode [Tue, 23 Mar 2010 21:48:48 +0000 (17:48 -0400)]
[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.
Charlie Brej [Mon, 22 Mar 2010 23:39:32 +0000 (23:39 +0000)]
[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.
Charlie Brej [Mon, 22 Mar 2010 23:16:21 +0000 (23:16 +0000)]
[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.
Charlie Brej [Mon, 22 Mar 2010 22:41:17 +0000 (22:41 +0000)]
[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.
Charlie Brej [Mon, 22 Mar 2010 22:26:47 +0000 (22:26 +0000)]
[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.
Ray Strode [Mon, 22 Mar 2010 04:13:35 +0000 (00:13 -0400)]
[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.
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.
[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.
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.
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
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.
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.
[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.
[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.
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()
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.
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.
[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.
[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.
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.
Ray Strode [Mon, 22 Mar 2010 02:59:09 +0000 (22:59 -0400)]
[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.
Ray Strode [Mon, 22 Mar 2010 02:59:09 +0000 (22:59 -0400)]
[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.
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.
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).
[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.
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.
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.
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.
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.