|
|
ff86aa |
From 4cb71a45b448dd8008242a5de122771c4e6d1c36 Mon Sep 17 00:00:00 2001
|
|
|
ff86aa |
From: rpm-build <rpm-build>
|
|
|
ff86aa |
Date: Thu, 29 Aug 2019 09:21:57 -0400
|
|
|
ff86aa |
Subject: [PATCH] boot-splash: handle update coming in after splash is unloaded
|
|
|
ff86aa |
|
|
|
ff86aa |
In some scenario i don't quite understand, involving plymouthd
|
|
|
ff86aa |
getting updated while it's running, the boot splash can get unloaded
|
|
|
ff86aa |
while its progress timeout remains active, leading to crash.
|
|
|
ff86aa |
|
|
|
ff86aa |
This commit protects against such a crash.
|
|
|
ff86aa |
---
|
|
|
ff86aa |
src/libply-splash-core/ply-boot-splash.c | 21 +++++++++++++--------
|
|
|
ff86aa |
1 file changed, 13 insertions(+), 8 deletions(-)
|
|
|
ff86aa |
|
|
|
ff86aa |
diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c
|
|
|
ff86aa |
index 664acc3..267136a 100644
|
|
|
ff86aa |
--- a/src/libply-splash-core/ply-boot-splash.c
|
|
|
ff86aa |
+++ b/src/libply-splash-core/ply-boot-splash.c
|
|
|
ff86aa |
@@ -412,75 +412,80 @@ ply_boot_splash_free (ply_boot_splash_t *splash)
|
|
|
ff86aa |
|
|
|
ff86aa |
if (splash->module_handle != NULL)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
ply_boot_splash_unset_keyboard (splash);
|
|
|
ff86aa |
|
|
|
ff86aa |
remove_pixel_displays (splash);
|
|
|
ff86aa |
ply_list_free (splash->pixel_displays);
|
|
|
ff86aa |
|
|
|
ff86aa |
remove_text_displays (splash);
|
|
|
ff86aa |
ply_list_free (splash->text_displays);
|
|
|
ff86aa |
|
|
|
ff86aa |
ply_boot_splash_unload (splash);
|
|
|
ff86aa |
}
|
|
|
ff86aa |
|
|
|
ff86aa |
if (splash->idle_trigger != NULL)
|
|
|
ff86aa |
ply_trigger_free (splash->idle_trigger);
|
|
|
ff86aa |
|
|
|
ff86aa |
free (splash->theme_path);
|
|
|
ff86aa |
free (splash->plugin_dir);
|
|
|
ff86aa |
free (splash);
|
|
|
ff86aa |
}
|
|
|
ff86aa |
|
|
|
ff86aa |
static void
|
|
|
ff86aa |
ply_boot_splash_update_progress (ply_boot_splash_t *splash)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
double percentage=0.0;
|
|
|
ff86aa |
double time=0.0;
|
|
|
ff86aa |
|
|
|
ff86aa |
assert (splash != NULL);
|
|
|
ff86aa |
|
|
|
ff86aa |
+ if (splash->plugin_interface == NULL)
|
|
|
ff86aa |
+ return;
|
|
|
ff86aa |
+
|
|
|
ff86aa |
if (splash->progress)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
percentage = ply_progress_get_percentage(splash->progress);
|
|
|
ff86aa |
time = ply_progress_get_time(splash->progress);
|
|
|
ff86aa |
}
|
|
|
ff86aa |
|
|
|
ff86aa |
if (splash->plugin_interface->on_boot_progress != NULL)
|
|
|
ff86aa |
- splash->plugin_interface->on_boot_progress (splash->plugin,
|
|
|
ff86aa |
- time,
|
|
|
ff86aa |
- percentage);
|
|
|
ff86aa |
-
|
|
|
ff86aa |
- ply_event_loop_watch_for_timeout (splash->loop,
|
|
|
ff86aa |
- 1.0 / UPDATES_PER_SECOND,
|
|
|
ff86aa |
- (ply_event_loop_timeout_handler_t)
|
|
|
ff86aa |
- ply_boot_splash_update_progress, splash);
|
|
|
ff86aa |
+ {
|
|
|
ff86aa |
+ splash->plugin_interface->on_boot_progress (splash->plugin,
|
|
|
ff86aa |
+ time,
|
|
|
ff86aa |
+ percentage);
|
|
|
ff86aa |
+
|
|
|
ff86aa |
+ ply_event_loop_watch_for_timeout (splash->loop,
|
|
|
ff86aa |
+ 1.0 / UPDATES_PER_SECOND,
|
|
|
ff86aa |
+ (ply_event_loop_timeout_handler_t)
|
|
|
ff86aa |
+ ply_boot_splash_update_progress, splash);
|
|
|
ff86aa |
+ }
|
|
|
ff86aa |
}
|
|
|
ff86aa |
|
|
|
ff86aa |
void
|
|
|
ff86aa |
ply_boot_splash_attach_progress (ply_boot_splash_t *splash,
|
|
|
ff86aa |
ply_progress_t *progress)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
assert (splash != NULL);
|
|
|
ff86aa |
assert (progress != NULL);
|
|
|
ff86aa |
assert (splash->progress == NULL);
|
|
|
ff86aa |
splash->progress = progress;
|
|
|
ff86aa |
}
|
|
|
ff86aa |
|
|
|
ff86aa |
|
|
|
ff86aa |
bool
|
|
|
ff86aa |
ply_boot_splash_show (ply_boot_splash_t *splash,
|
|
|
ff86aa |
ply_boot_splash_mode_t mode)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
assert (splash != NULL);
|
|
|
ff86aa |
assert (mode != PLY_BOOT_SPLASH_MODE_INVALID);
|
|
|
ff86aa |
assert (splash->module_handle != NULL);
|
|
|
ff86aa |
assert (splash->loop != NULL);
|
|
|
ff86aa |
assert (splash->plugin_interface != NULL);
|
|
|
ff86aa |
assert (splash->plugin != NULL);
|
|
|
ff86aa |
assert (splash->plugin_interface->show_splash_screen != NULL);
|
|
|
ff86aa |
|
|
|
ff86aa |
if (splash->mode == mode)
|
|
|
ff86aa |
{
|
|
|
ff86aa |
ply_trace ("already set same splash screen mode");
|
|
|
ff86aa |
return true;
|
|
|
ff86aa |
}
|
|
|
ff86aa |
--
|
|
|
ff86aa |
2.21.0
|
|
|
ff86aa |
|