diff options
author | Laurent Bigonville <bigon@bigon.be> | 2020-04-07 09:22:02 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2020-04-07 09:22:02 -0400 |
commit | 702fd05feb8e0d38c8ac5ae72c3ed171cd91990e (patch) | |
tree | 5400aa30a58b0d2bc322b28f5fe5ec1a48f2c912 /src | |
parent | 5cb1ad3af58aad039564b0cc19382af107af59dc (diff) |
main: fix mode changing before splash is shown
At the moment switching modes affects two aspects of how plymouth
runs.
1) What log file is opened (i.e., boot.log or no log file at all)
2) What type of splash gets shown (the details of which are relegated
to the individual splash plugins)
The mode change handler has a check in place to avoid changing the
type of splash getting shown in the event no splash is supposed to
be shown yet. This check just makes the function return without
doing anything.
Unfortunately, the check is placed at the top of the function, so
it runs before the log file is changed.
This commit moves the check lower down, so the log file gets properly
updated when the mode is changed.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -192,11 +192,6 @@ static void on_change_mode (state_t *state, const char *mode) { - if (state->boot_splash == NULL) { - ply_trace ("no splash set"); - return; - } - ply_trace ("updating mode to '%s'", mode); if (strcmp (mode, "boot-up") == 0) state->mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; @@ -217,6 +212,11 @@ on_change_mode (state_t *state, prepare_logging (state); } + if (state->boot_splash == NULL) { + ply_trace ("no splash set"); + return; + } + if (!ply_boot_splash_show (state->boot_splash, state->mode)) { ply_trace ("failed to update splash"); return; |