From 1c7ce43983e3e45d65b14b630415989ff349287f Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 25 Feb 2019 16:56:16 +0100 Subject: [PATCH 1/3] two-step: Make ProgressBarShowPercentComplete a per mode setting Make ProgressBarShowPercentComplete a per mode setting, this gives the theme more flexibility wrt which messages to show in different modes. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 7 ++++--- themes/bgrt/bgrt.plymouth.in | 2 +- themes/spinner/spinner.plymouth.in | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 9b6abba3..94b27084 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -107,6 +107,7 @@ typedef struct typedef struct { bool suppress_messages; + bool progress_bar_show_percent_complete; bool use_progress_bar; bool use_firmware_background; char *title; @@ -166,7 +167,6 @@ struct _ply_boot_splash_plugin uint32_t use_firmware_background : 1; uint32_t dialog_clears_firmware_background : 1; uint32_t message_below_animation : 1; - uint32_t progress_bar_show_percent_complete : 1; }; ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void); @@ -823,6 +823,8 @@ load_mode_settings (ply_boot_splash_plugin_t *plugin, settings->suppress_messages = ply_key_file_get_bool (key_file, group_name, "SuppressMessages"); + settings->progress_bar_show_percent_complete = + ply_key_file_get_bool (key_file, group_name, "ProgressBarShowPercentComplete"); settings->use_progress_bar = ply_key_file_get_bool (key_file, group_name, "UseProgressBar"); settings->use_firmware_background = @@ -994,7 +996,6 @@ create_plugin (ply_key_file_t *key_file) free (color); - plugin->progress_bar_show_percent_complete = ply_key_file_get_bool (key_file, "two-step", "ProgressBarShowPercentComplete"); load_mode_settings (plugin, key_file, "boot-up", PLY_BOOT_SPLASH_MODE_BOOT_UP); load_mode_settings (plugin, key_file, "shutdown", PLY_BOOT_SPLASH_MODE_SHUTDOWN); @@ -1795,7 +1796,7 @@ system_update (ply_boot_splash_plugin_t *plugin, ply_progress_animation_set_percent_done (view->progress_animation, (double) progress / 100.f); ply_progress_bar_set_percent_done (view->progress_bar, (double) progress / 100.f); if (!ply_progress_bar_is_hidden (view->progress_bar) && - plugin->progress_bar_show_percent_complete) { + plugin->mode_settings[plugin->mode].progress_bar_show_percent_complete) { snprintf (buf, sizeof(buf), "%d%% complete", progress); view_show_message (view, buf); } diff --git a/themes/bgrt/bgrt.plymouth.in b/themes/bgrt/bgrt.plymouth.in index b0899d75..15bd9bae 100644 --- a/themes/bgrt/bgrt.plymouth.in +++ b/themes/bgrt/bgrt.plymouth.in @@ -21,7 +21,6 @@ BackgroundStartColor=0x202020 BackgroundEndColor=0x202020 ProgressBarBackgroundColor=0x606060 ProgressBarForegroundColor=0xffffff -ProgressBarShowPercentComplete=true DialogClearsFirmwareBackground=true MessageBelowAnimation=true @@ -33,6 +32,7 @@ UseFirmwareBackground=true [updates] SuppressMessages=true +ProgressBarShowPercentComplete=true UseProgressBar=true Title=Installing Updates... SubTitle=Do not turn off your computer diff --git a/themes/spinner/spinner.plymouth.in b/themes/spinner/spinner.plymouth.in index 02e7eb73..40613ba5 100644 --- a/themes/spinner/spinner.plymouth.in +++ b/themes/spinner/spinner.plymouth.in @@ -21,11 +21,11 @@ BackgroundStartColor=0x202020 BackgroundEndColor=0x202020 ProgressBarBackgroundColor=0x606060 ProgressBarForegroundColor=0xffffff -ProgressBarShowPercentComplete=true MessageBelowAnimation=true [updates] SuppressMessages=true +ProgressBarShowPercentComplete=true UseProgressBar=true Title=Installing Updates... SubTitle=Do not turn off your computer From 2eceea2ce790007f77af8bf4f5c9af73f89c94c8 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 25 Feb 2019 15:45:26 +0100 Subject: [PATCH 2/3] main: Remove private ply_mode_t Remove the private ply_mode_t from main.c, this is a 1:1 mirror of ply_boot_splash_mode_t, so use ply_boot_splash_mode_t directly, leading to a nice cleanup. Signed-off-by: Hans de Goede --- src/main.c | 95 +++++++++++++++++------------------------------------- 1 file changed, 30 insertions(+), 65 deletions(-) diff --git a/src/main.c b/src/main.c index 9adff3a0..e406382b 100644 --- a/src/main.c +++ b/src/main.c @@ -58,13 +58,6 @@ #define BOOT_DURATION_FILE PLYMOUTH_TIME_DIRECTORY "/boot-duration" #define SHUTDOWN_DURATION_FILE PLYMOUTH_TIME_DIRECTORY "/shutdown-duration" -typedef enum -{ - PLY_MODE_BOOT, - PLY_MODE_SHUTDOWN, - PLY_MODE_UPDATES -} ply_mode_t; - typedef struct { const char *keys; @@ -93,7 +86,7 @@ typedef struct ply_buffer_t *entry_buffer; ply_list_t *messages; ply_command_parser_t *command_parser; - ply_mode_t mode; + ply_boot_splash_mode_t mode; ply_terminal_t *local_console_terminal; ply_device_manager_t *device_manager; @@ -149,7 +142,7 @@ static void toggle_between_splash_and_details (state_t *state); static void tell_systemd_to_print_details (state_t *state); static void tell_systemd_to_stop_printing_details (state_t *state); #endif -static const char *get_cache_file_for_mode (ply_mode_t mode); +static const char *get_cache_file_for_mode (ply_boot_splash_mode_t mode); static void on_escape_pressed (state_t *state); static void on_enter (state_t *state, const char *line); @@ -163,30 +156,6 @@ static void on_quit (state_t *state, static bool sh_is_init (state_t *state); static void cancel_pending_delayed_show (state_t *state); -static ply_boot_splash_mode_t -get_splash_mode_from_mode (ply_mode_t mode) -{ - ply_boot_splash_mode_t splash_mode; - switch (mode) { - case PLY_MODE_BOOT: - splash_mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; - break; - case PLY_MODE_SHUTDOWN: - splash_mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN; - break; - case PLY_MODE_UPDATES: - splash_mode = PLY_BOOT_SPLASH_MODE_UPDATES; - break; - default: - splash_mode = PLY_BOOT_SPLASH_MODE_INVALID; - break; - } - - assert (splash_mode != PLY_BOOT_SPLASH_MODE_INVALID); - - return splash_mode; -} - static void on_session_output (state_t *state, const char *output, @@ -220,8 +189,6 @@ static void on_change_mode (state_t *state, const char *mode) { - ply_boot_splash_mode_t splash_mode; - if (state->boot_splash == NULL) { ply_trace ("no splash set"); return; @@ -229,17 +196,15 @@ on_change_mode (state_t *state, ply_trace ("updating mode to '%s'", mode); if (strcmp (mode, "boot-up") == 0) - state->mode = PLY_MODE_BOOT; + state->mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; else if (strcmp (mode, "shutdown") == 0) - state->mode = PLY_MODE_SHUTDOWN; + state->mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN; else if (strcmp (mode, "updates") == 0) - state->mode = PLY_MODE_UPDATES; + state->mode = PLY_BOOT_SPLASH_MODE_UPDATES; else return; - splash_mode = get_splash_mode_from_mode (state->mode); - - if (!ply_boot_splash_show (state->boot_splash, splash_mode)) { + if (!ply_boot_splash_show (state->boot_splash, state->mode)) { ply_trace ("failed to update splash"); return; } @@ -689,20 +654,21 @@ on_newroot (state_t *state, } static const char * -get_cache_file_for_mode (ply_mode_t mode) +get_cache_file_for_mode (ply_boot_splash_mode_t mode) { const char *filename; - switch ((int) mode) { - case PLY_MODE_BOOT: + switch (mode) { + case PLY_BOOT_SPLASH_MODE_BOOT_UP: filename = BOOT_DURATION_FILE; break; - case PLY_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_SHUTDOWN: filename = SHUTDOWN_DURATION_FILE; break; - case PLY_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_UPDATES: filename = NULL; break; + case PLY_BOOT_SPLASH_MODE_INVALID: default: ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__); abort (); @@ -718,17 +684,18 @@ get_log_file_for_state (state_t *state) { const char *filename; - switch ((int) state->mode) { - case PLY_MODE_BOOT: + switch (state->mode) { + case PLY_BOOT_SPLASH_MODE_BOOT_UP: if (state->no_boot_log) filename = NULL; else filename = PLYMOUTH_LOG_DIRECTORY "/boot.log"; break; - case PLY_MODE_SHUTDOWN: - case PLY_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_UPDATES: filename = _PATH_DEVNULL; break; + case PLY_BOOT_SPLASH_MODE_INVALID: default: ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__); abort (); @@ -740,18 +707,19 @@ get_log_file_for_state (state_t *state) } static const char * -get_log_spool_file_for_mode (ply_mode_t mode) +get_log_spool_file_for_mode (ply_boot_splash_mode_t mode) { const char *filename; - switch ((int) mode) { - case PLY_MODE_BOOT: + switch (mode) { + case PLY_BOOT_SPLASH_MODE_BOOT_UP: filename = PLYMOUTH_SPOOL_DIRECTORY "/boot.log"; break; - case PLY_MODE_SHUTDOWN: - case PLY_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_UPDATES: filename = NULL; break; + case PLY_BOOT_SPLASH_MODE_INVALID: default: ply_error ("Unhandled case in %s line %d\n", __FILE__, __LINE__); abort (); @@ -841,7 +809,7 @@ static bool plymouth_should_ignore_show_splash_calls (state_t *state) { ply_trace ("checking if plymouth should be running"); - if (state->mode != PLY_MODE_BOOT || ply_kernel_command_line_has_argument ("plymouth.force-splash")) + if (state->mode != PLY_BOOT_SPLASH_MODE_BOOT_UP || ply_kernel_command_line_has_argument ("plymouth.force-splash")) return false; if (ply_kernel_command_line_has_argument ("plymouth.ignore-show-splash")) @@ -1213,7 +1181,7 @@ quit_program (state_t *state) #ifdef PLY_ENABLE_DEPRECATED_GDM_TRANSITION if (state->should_retain_splash && - state->mode == PLY_MODE_BOOT) + state->mode == PLY_BOOT_SPLASH_MODE_BOOT_UP) tell_gdm_to_transition (); #endif @@ -1737,7 +1705,6 @@ static ply_boot_splash_t * show_theme (state_t *state, const char *theme_path) { - ply_boot_splash_mode_t splash_mode; ply_boot_splash_t *splash; if (theme_path != NULL) @@ -1752,9 +1719,7 @@ show_theme (state_t *state, if (ply_boot_splash_uses_pixel_displays (splash)) ply_device_manager_activate_renderers (state->device_manager); - splash_mode = get_splash_mode_from_mode (state->mode); - - if (!ply_boot_splash_show (splash, splash_mode)) { + if (!ply_boot_splash_show (splash, state->mode)) { ply_save_errno (); ply_boot_splash_free (splash); ply_restore_errno (); @@ -1985,7 +1950,7 @@ initialize_environment (state_t *state) if (getenv ("DISPLAY") != NULL && access (PLYMOUTH_PLUGIN_PATH "renderers/x11.so", F_OK) == 0) state->default_tty = "/dev/tty"; if (!state->default_tty) { - if (state->mode == PLY_MODE_SHUTDOWN) + if (state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) state->default_tty = SHUTDOWN_TTY; else state->default_tty = BOOT_TTY; @@ -2181,11 +2146,11 @@ main (int argc, if (mode_string != NULL) { if (strcmp (mode_string, "shutdown") == 0) - state.mode = PLY_MODE_SHUTDOWN; + state.mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN; else if (strcmp (mode_string, "updates") == 0) - state.mode = PLY_MODE_UPDATES; + state.mode = PLY_BOOT_SPLASH_MODE_UPDATES; else - state.mode = PLY_MODE_BOOT; + state.mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; free (mode_string); } From a42915c972ae2d8495333305d4729c25754a42a1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 25 Feb 2019 16:47:13 +0100 Subject: [PATCH 3/3] Add new reboot and system-upgrade modes Some themes show certain text strings to the user depending on the mode, see e.g. the shutdown vs reboot mockups of: https://wiki.gnome.org/Design/OS/BootProgress Besides during shutdown vs reboot, we also want different theming for installing offline (security) updates versus doing an offline OS upgrade. To make this possible this commit adds new reboot and system-upgrade modes which can be specified either when starting plymouthd, or through plymouth change-mode --. Signed-off-by: Hans de Goede --- src/client/plymouth.c | 48 +++++++++++-------- .../ply-boot-splash-plugin.h | 4 +- src/main.c | 17 ++++++- src/plugins/splash/fade-throbber/plugin.c | 6 ++- .../splash/script/script-lib-plymouth.c | 6 +++ src/plugins/splash/text/plugin.c | 3 +- src/plugins/splash/throbgress/plugin.c | 12 +++-- src/plugins/splash/tribar/plugin.c | 3 +- src/plugins/splash/two-step/plugin.c | 16 +++++-- systemd-units/plymouth-reboot.service.in | 2 +- themes/bgrt/bgrt.plymouth.in | 10 ++++ themes/spinner/spinner.plymouth.in | 7 +++ 12 files changed, 99 insertions(+), 35 deletions(-) diff --git a/src/client/plymouth.c b/src/client/plymouth.c index 8e613def..a11753af 100644 --- a/src/client/plymouth.c +++ b/src/client/plymouth.c @@ -782,38 +782,42 @@ static void on_change_mode_request (state_t *state, const char *command) { - bool boot_up; - bool shutdown; - bool updates; + bool boot_up = false; + bool shutdown = false; + bool reboot = false; + bool updates = false; + bool system_upgrade = false; + const char *mode = NULL; - boot_up = false; - shutdown = false; - updates = false; ply_command_parser_get_command_options (state->command_parser, command, "boot-up", &boot_up, "shutdown", &shutdown, + "reboot", &reboot, "updates", &updates, + "system-upgrade", &system_upgrade, NULL); - if (boot_up) { - ply_boot_client_change_mode (state->client, "boot-up", - (ply_boot_client_response_handler_t) - on_success, - (ply_boot_client_response_handler_t) - on_failure, state); - } else if (shutdown) { - ply_boot_client_change_mode (state->client, "shutdown", - (ply_boot_client_response_handler_t) - on_success, - (ply_boot_client_response_handler_t) - on_failure, state); - } else if (updates) { - ply_boot_client_change_mode (state->client, "updates", + if (boot_up) + mode = "boot-up"; + else if (shutdown) + mode = "shutdown"; + else if (reboot) + mode = "reboot"; + else if (updates) + mode = "updates"; + else if (system_upgrade) + mode = "system-upgrade"; + + if (mode) { + ply_boot_client_change_mode (state->client, mode, (ply_boot_client_response_handler_t) on_success, (ply_boot_client_response_handler_t) on_failure, state); + } else { + ply_error ("Error no mode specified for 'change-mode' command"); + ply_event_loop_exit (state->loop, 1); } } @@ -891,8 +895,12 @@ main (int argc, PLY_COMMAND_OPTION_TYPE_FLAG, "shutdown", "Shutting the system down", PLY_COMMAND_OPTION_TYPE_FLAG, + "reboot", "Rebooting the system", + PLY_COMMAND_OPTION_TYPE_FLAG, "updates", "Applying updates", PLY_COMMAND_OPTION_TYPE_FLAG, + "system-upgrade", "Upgrading the OS to a new version", + PLY_COMMAND_OPTION_TYPE_FLAG, NULL); ply_command_parser_add_command (state.command_parser, diff --git a/src/libply-splash-core/ply-boot-splash-plugin.h b/src/libply-splash-core/ply-boot-splash-plugin.h index de21319b..3fa56cea 100644 --- a/src/libply-splash-core/ply-boot-splash-plugin.h +++ b/src/libply-splash-core/ply-boot-splash-plugin.h @@ -38,9 +38,11 @@ typedef enum { PLY_BOOT_SPLASH_MODE_BOOT_UP, PLY_BOOT_SPLASH_MODE_SHUTDOWN, + PLY_BOOT_SPLASH_MODE_REBOOT, PLY_BOOT_SPLASH_MODE_UPDATES, + PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE, PLY_BOOT_SPLASH_MODE_INVALID, - PLY_BOOT_SPLASH_MODE_COUNT = PLY_BOOT_SPLASH_MODE_UPDATES + 1, + PLY_BOOT_SPLASH_MODE_COUNT = PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE + 1, } ply_boot_splash_mode_t; typedef struct _ply_boot_splash_plugin ply_boot_splash_plugin_t; diff --git a/src/main.c b/src/main.c index e406382b..90e8a5eb 100644 --- a/src/main.c +++ b/src/main.c @@ -199,8 +199,12 @@ on_change_mode (state_t *state, state->mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; else if (strcmp (mode, "shutdown") == 0) state->mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN; + else if (strcmp (mode, "reboot") == 0) + state->mode = PLY_BOOT_SPLASH_MODE_REBOOT; else if (strcmp (mode, "updates") == 0) state->mode = PLY_BOOT_SPLASH_MODE_UPDATES; + else if (strcmp (mode, "system-upgrade") == 0) + state->mode = PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE; else return; @@ -663,9 +667,11 @@ get_cache_file_for_mode (ply_boot_splash_mode_t mode) filename = BOOT_DURATION_FILE; break; case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_REBOOT: filename = SHUTDOWN_DURATION_FILE; break; case PLY_BOOT_SPLASH_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE: filename = NULL; break; case PLY_BOOT_SPLASH_MODE_INVALID: @@ -692,7 +698,9 @@ get_log_file_for_state (state_t *state) filename = PLYMOUTH_LOG_DIRECTORY "/boot.log"; break; case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_REBOOT: case PLY_BOOT_SPLASH_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE: filename = _PATH_DEVNULL; break; case PLY_BOOT_SPLASH_MODE_INVALID: @@ -716,7 +724,9 @@ get_log_spool_file_for_mode (ply_boot_splash_mode_t mode) filename = PLYMOUTH_SPOOL_DIRECTORY "/boot.log"; break; case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_REBOOT: case PLY_BOOT_SPLASH_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE: filename = NULL; break; case PLY_BOOT_SPLASH_MODE_INVALID: @@ -1950,7 +1960,8 @@ initialize_environment (state_t *state) if (getenv ("DISPLAY") != NULL && access (PLYMOUTH_PLUGIN_PATH "renderers/x11.so", F_OK) == 0) state->default_tty = "/dev/tty"; if (!state->default_tty) { - if (state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + state->mode == PLY_BOOT_SPLASH_MODE_REBOOT) state->default_tty = SHUTDOWN_TTY; else state->default_tty = BOOT_TTY; @@ -2147,8 +2158,12 @@ main (int argc, if (mode_string != NULL) { if (strcmp (mode_string, "shutdown") == 0) state.mode = PLY_BOOT_SPLASH_MODE_SHUTDOWN; + else if (strcmp (mode_string, "reboot") == 0) + state.mode = PLY_BOOT_SPLASH_MODE_REBOOT; else if (strcmp (mode_string, "updates") == 0) state.mode = PLY_BOOT_SPLASH_MODE_UPDATES; + else if (strcmp (mode_string, "system-upgrade") == 0) + state.mode = PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE; else state.mode = PLY_BOOT_SPLASH_MODE_BOOT_UP; diff --git a/src/plugins/splash/fade-throbber/plugin.c b/src/plugins/splash/fade-throbber/plugin.c index a7ab4ef4..294dc6f8 100644 --- a/src/plugins/splash/fade-throbber/plugin.c +++ b/src/plugins/splash/fade-throbber/plugin.c @@ -468,7 +468,8 @@ view_animate_at_time (view_t *view, logo_opacity = .5 * sin ((time / 5) * (2 * M_PI)) + .8; logo_opacity = CLAMP (logo_opacity, 0, 1.0); - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) logo_opacity = 1.0; if (fabs (logo_opacity - view->logo_opacity) <= DBL_MIN) @@ -579,7 +580,8 @@ start_animation (ply_boot_splash_plugin_t *plugin) plugin->start_time = ply_get_timestamp (); animate_at_time (plugin, plugin->start_time); - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) return; ply_event_loop_watch_for_timeout (plugin->loop, diff --git a/src/plugins/splash/script/script-lib-plymouth.c b/src/plugins/splash/script/script-lib-plymouth.c index 857792b5..ca7ad778 100644 --- a/src/plugins/splash/script/script-lib-plymouth.c +++ b/src/plugins/splash/script/script-lib-plymouth.c @@ -70,9 +70,15 @@ static script_return_t plymouth_get_mode (script_state_t *state, case PLY_BOOT_SPLASH_MODE_SHUTDOWN: obj = script_obj_new_string ("shutdown"); break; + case PLY_BOOT_SPLASH_MODE_REBOOT: + obj = script_obj_new_string ("reboot"); + break; case PLY_BOOT_SPLASH_MODE_UPDATES: obj = script_obj_new_string ("updates"); break; + case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE: + obj = script_obj_new_string ("system-upgrade"); + break; case PLY_BOOT_SPLASH_MODE_INVALID: default: obj = script_obj_new_string ("unknown"); diff --git a/src/plugins/splash/text/plugin.c b/src/plugins/splash/text/plugin.c index 8260daad..7298f5a3 100644 --- a/src/plugins/splash/text/plugin.c +++ b/src/plugins/splash/text/plugin.c @@ -184,7 +184,8 @@ view_start_animation (view_t *view) ply_text_display_clear_screen (view->display); ply_text_display_hide_cursor (view->display); - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) { + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) { ply_text_step_bar_hide (view->step_bar); return; } diff --git a/src/plugins/splash/throbgress/plugin.c b/src/plugins/splash/throbgress/plugin.c index bbcf1b7c..3982821b 100644 --- a/src/plugins/splash/throbgress/plugin.c +++ b/src/plugins/splash/throbgress/plugin.c @@ -302,7 +302,8 @@ view_start_animation (view_t *view) ply_pixel_display_draw_area (view->display, 0, 0, screen_width, screen_height); - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) return; plugin->is_idle = false; @@ -528,7 +529,8 @@ start_animation (ply_boot_splash_plugin_t *plugin) plugin->is_animating = true; - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) plugin->is_idle = true; } @@ -720,7 +722,8 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin, ply_list_node_t *node; double total_duration; - if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES || + plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE) return; total_duration = duration / percent_done; @@ -931,7 +934,8 @@ system_update (ply_boot_splash_plugin_t *plugin, { ply_list_node_t *node; - if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES) + if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES && + plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE) return; node = ply_list_get_first_node (plugin->views); diff --git a/src/plugins/splash/tribar/plugin.c b/src/plugins/splash/tribar/plugin.c index ecc17ea3..bbf5d472 100644 --- a/src/plugins/splash/tribar/plugin.c +++ b/src/plugins/splash/tribar/plugin.c @@ -190,7 +190,8 @@ view_start_animation (view_t *view) ply_text_display_clear_screen (view->display); ply_text_display_hide_cursor (view->display); - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) { + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) { ply_text_progress_bar_hide (view->progress_bar); return; } diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 94b27084..4c570917 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -251,9 +251,11 @@ view_load_end_animation (view_t *view) switch (plugin->mode) { case PLY_BOOT_SPLASH_MODE_BOOT_UP: case PLY_BOOT_SPLASH_MODE_UPDATES: + case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE: animation_prefix = "startup-animation-"; break; case PLY_BOOT_SPLASH_MODE_SHUTDOWN: + case PLY_BOOT_SPLASH_MODE_REBOOT: animation_prefix = "shutdown-animation-"; break; case PLY_BOOT_SPLASH_MODE_INVALID: @@ -723,7 +725,8 @@ view_start_progress_animation (view_t *view) /* We don't really know how long shutdown will so * don't show the progress animation */ - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) return; if (view->progress_animation != NULL) { @@ -999,7 +1002,9 @@ create_plugin (ply_key_file_t *key_file) load_mode_settings (plugin, key_file, "boot-up", PLY_BOOT_SPLASH_MODE_BOOT_UP); load_mode_settings (plugin, key_file, "shutdown", PLY_BOOT_SPLASH_MODE_SHUTDOWN); + load_mode_settings (plugin, key_file, "reboot", PLY_BOOT_SPLASH_MODE_REBOOT); load_mode_settings (plugin, key_file, "updates", PLY_BOOT_SPLASH_MODE_UPDATES); + load_mode_settings (plugin, key_file, "system-upgrade", PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE); if (plugin->use_firmware_background) plugin->background_bgrt_image = ply_image_new ("/sys/firmware/acpi/bgrt/image"); @@ -1185,7 +1190,8 @@ start_progress_animation (ply_boot_splash_plugin_t *plugin) * but it's normally really fast, so just jump to * the end animation */ - if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN || + plugin->mode == PLY_BOOT_SPLASH_MODE_REBOOT) become_idle (plugin, NULL); } @@ -1575,7 +1581,8 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin, double duration, double percent_done) { - if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES) + if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES || + plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE) return; if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL) @@ -1782,7 +1789,8 @@ system_update (ply_boot_splash_plugin_t *plugin, ply_list_node_t *node; char buf[64]; - if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES) + if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES && + plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE) return; node = ply_list_get_first_node (plugin->views); diff --git a/systemd-units/plymouth-reboot.service.in b/systemd-units/plymouth-reboot.service.in index 1d577896..147f8248 100644 --- a/systemd-units/plymouth-reboot.service.in +++ b/systemd-units/plymouth-reboot.service.in @@ -7,6 +7,6 @@ ConditionKernelCommandLine=!plymouth.enable=0 ConditionVirtualization=!container [Service] -ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=shutdown --attach-to-session +ExecStart=@PLYMOUTH_DAEMON_DIR@/plymouthd --mode=reboot --attach-to-session ExecStartPost=-@PLYMOUTH_CLIENT_DIR@/plymouth show-splash Type=forking diff --git a/themes/bgrt/bgrt.plymouth.in b/themes/bgrt/bgrt.plymouth.in index 15bd9bae..b7c14d2d 100644 --- a/themes/bgrt/bgrt.plymouth.in +++ b/themes/bgrt/bgrt.plymouth.in @@ -30,9 +30,19 @@ UseFirmwareBackground=true [shutdown] UseFirmwareBackground=true +[reboot] +UseFirmwareBackground=true + [updates] SuppressMessages=true ProgressBarShowPercentComplete=true UseProgressBar=true Title=Installing Updates... SubTitle=Do not turn off your computer + +[system-upgrade] +SuppressMessages=true +ProgressBarShowPercentComplete=true +UseProgressBar=true +Title=Upgrading System... +SubTitle=Do not turn off your computer diff --git a/themes/spinner/spinner.plymouth.in b/themes/spinner/spinner.plymouth.in index 40613ba5..5e8c1c19 100644 --- a/themes/spinner/spinner.plymouth.in +++ b/themes/spinner/spinner.plymouth.in @@ -29,3 +29,10 @@ ProgressBarShowPercentComplete=true UseProgressBar=true Title=Installing Updates... SubTitle=Do not turn off your computer + +[system-upgrade] +SuppressMessages=true +ProgressBarShowPercentComplete=true +UseProgressBar=true +Title=Upgrading System... +SubTitle=Do not turn off your computer