|
|
0d49b64 |
From 1445b5a6bfb87957a918b69dca94a62d4a36af7a Mon Sep 17 00:00:00 2001
|
|
|
0d49b64 |
From: "Dr. Tilmann Bubeck" <t.bubeck@reinform.de>
|
|
|
0d49b64 |
Date: Wed, 2 May 2012 18:18:13 +0200
|
|
|
0d49b64 |
Subject: [PATCH] two-step: quit properly when boot finishes while waiting for
|
|
|
0d49b64 |
password
|
|
|
0d49b64 |
|
|
|
0d49b64 |
When the computer is progressing through its boot up process, plymouth
|
|
|
0d49b64 |
calls into the splash plugin's on_boot_progress function at regular
|
|
|
0d49b64 |
intervals with increasing values for "percent_done". At some point, it
|
|
|
0d49b64 |
gets to 90% done, and that's when two-step begins its finishing
|
|
|
0d49b64 |
animation sequence. As soon as this sequence finishes, two-step pulls
|
|
|
0d49b64 |
its stop trigger, which
|
|
|
0d49b64 |
|
|
|
0d49b64 |
1) sets its "is_idle" flag to true and
|
|
|
0d49b64 |
2) pulls the core plymouthd code's idle trigger, to notify that
|
|
|
0d49b64 |
code that it's at a good animation frame to quit (if the core
|
|
|
0d49b64 |
plymouthd code has an idle trigger set up)
|
|
|
0d49b64 |
|
|
|
0d49b64 |
During the boot process, the user may need to enter a password
|
|
|
0d49b64 |
(the "plymouth ask-for-password" command). When that happens,
|
|
|
0d49b64 |
the splash waits for the user to enter a password, but boot progresses
|
|
|
0d49b64 |
in the background.
|
|
|
0d49b64 |
|
|
|
0d49b64 |
If the user then enters a password, the boot animation restarts again
|
|
|
0d49b64 |
(from the display_normal function). This restarting of the boot
|
|
|
0d49b64 |
animation will cause the "is_idle" flag of the splash to get set back
|
|
|
0d49b64 |
to false.
|
|
|
0d49b64 |
|
|
|
0d49b64 |
Later when plymouthd wants to quit, it calls the become_idle function
|
|
|
0d49b64 |
of the splash plugin. That function notices "is_idle" is false, and
|
|
|
0d49b64 |
the stop_trigger is not NULL. The function isn't suited to work
|
|
|
0d49b64 |
with this combination, and so at this point the splash never
|
|
|
0d49b64 |
tells the code daemon code it's idle.
|
|
|
0d49b64 |
|
|
|
0d49b64 |
This commit changes on_boot_progress to return before looking at
|
|
|
0d49b64 |
percent_done, if the user is getting asked a question. This way
|
|
|
0d49b64 |
the stop_trigger won't get created prematurely, and is_idle won't
|
|
|
0d49b64 |
get out of sync.
|
|
|
0d49b64 |
|
|
|
0d49b64 |
https://bugs.freedesktop.org/show_bug.cgi?id=49355
|
|
|
0d49b64 |
---
|
|
|
0d49b64 |
src/plugins/splash/two-step/plugin.c | 3 ++-
|
|
|
0d49b64 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
0d49b64 |
|
|
|
0d49b64 |
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
|
|
|
0d49b64 |
index 8f69e0f..1e6a7d0 100644
|
|
|
0d49b64 |
--- a/src/plugins/splash/two-step/plugin.c
|
|
|
0d49b64 |
+++ b/src/plugins/splash/two-step/plugin.c
|
|
|
0d49b64 |
@@ -1077,7 +1077,8 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin,
|
|
|
0d49b64 |
double duration,
|
|
|
0d49b64 |
double percent_done)
|
|
|
0d49b64 |
{
|
|
|
0d49b64 |
-
|
|
|
0d49b64 |
+ if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL)
|
|
|
0d49b64 |
+ return;
|
|
|
0d49b64 |
|
|
|
0d49b64 |
if (percent_done >= SHOW_ANIMATION_PERCENT)
|
|
|
0d49b64 |
{
|
|
|
0d49b64 |
--
|
|
|
0d49b64 |
1.7.12
|
|
|
0d49b64 |
|