mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2025-12-20 04:30:10 +01:00
Add system-reset splash mode
This commit is contained in:
parent
68ad99794c
commit
6f9744cb32
8 changed files with 42 additions and 3 deletions
|
|
@ -812,6 +812,7 @@ on_change_mode_request (state_t *state,
|
|||
bool updates = false;
|
||||
bool system_upgrade = false;
|
||||
bool firmware_upgrade = false;
|
||||
bool system_reset = false;
|
||||
const char *mode = NULL;
|
||||
|
||||
ply_command_parser_get_command_options (state->command_parser,
|
||||
|
|
@ -822,6 +823,7 @@ on_change_mode_request (state_t *state,
|
|||
"updates", &updates,
|
||||
"system-upgrade", &system_upgrade,
|
||||
"firmware-upgrade", &firmware_upgrade,
|
||||
"system-reset", &system_reset,
|
||||
NULL);
|
||||
|
||||
if (boot_up)
|
||||
|
|
@ -836,6 +838,8 @@ on_change_mode_request (state_t *state,
|
|||
mode = "system-upgrade";
|
||||
else if (firmware_upgrade)
|
||||
mode = "firmware-upgrade";
|
||||
else if (system_reset)
|
||||
mode = "system-reset";
|
||||
|
||||
if (mode) {
|
||||
ply_boot_client_change_mode (state->client, mode,
|
||||
|
|
@ -931,6 +935,8 @@ main (int argc,
|
|||
PLY_COMMAND_OPTION_TYPE_FLAG,
|
||||
"firmware-upgrade", "Upgrading firmware to a new version",
|
||||
PLY_COMMAND_OPTION_TYPE_FLAG,
|
||||
"system-reset", "Resetting the OS and erasing all user data",
|
||||
PLY_COMMAND_OPTION_TYPE_FLAG,
|
||||
NULL);
|
||||
|
||||
ply_command_parser_add_command (state.command_parser,
|
||||
|
|
|
|||
|
|
@ -42,8 +42,9 @@ typedef enum
|
|||
PLY_BOOT_SPLASH_MODE_UPDATES,
|
||||
PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE,
|
||||
PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE,
|
||||
PLY_BOOT_SPLASH_MODE_SYSTEM_RESET,
|
||||
PLY_BOOT_SPLASH_MODE_INVALID,
|
||||
PLY_BOOT_SPLASH_MODE_COUNT = PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE + 1,
|
||||
PLY_BOOT_SPLASH_MODE_COUNT = PLY_BOOT_SPLASH_MODE_SYSTEM_RESET + 1,
|
||||
} ply_boot_splash_mode_t;
|
||||
|
||||
typedef struct _ply_boot_splash_plugin ply_boot_splash_plugin_t;
|
||||
|
|
|
|||
|
|
@ -208,6 +208,8 @@ on_change_mode (state_t *state,
|
|||
state->mode = PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE;
|
||||
else if (strcmp (mode, "firmware-upgrade") == 0)
|
||||
state->mode = PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE;
|
||||
else if (strcmp (mode, "system-reset") == 0)
|
||||
state->mode = PLY_BOOT_SPLASH_MODE_SYSTEM_RESET;
|
||||
else
|
||||
return;
|
||||
|
||||
|
|
@ -690,6 +692,7 @@ get_cache_file_for_mode (ply_boot_splash_mode_t mode)
|
|||
case PLY_BOOT_SPLASH_MODE_UPDATES:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_RESET:
|
||||
filename = NULL;
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_INVALID:
|
||||
|
|
@ -724,6 +727,7 @@ get_log_file_for_state (state_t *state)
|
|||
case PLY_BOOT_SPLASH_MODE_UPDATES:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_RESET:
|
||||
filename = _PATH_DEVNULL;
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_INVALID:
|
||||
|
|
@ -751,6 +755,7 @@ get_log_spool_file_for_mode (ply_boot_splash_mode_t mode)
|
|||
case PLY_BOOT_SPLASH_MODE_UPDATES:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_RESET:
|
||||
filename = NULL;
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_INVALID:
|
||||
|
|
@ -2313,6 +2318,8 @@ main (int argc,
|
|||
state.mode = PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE;
|
||||
else if (strcmp (mode_string, "firmware-upgrade") == 0)
|
||||
state.mode = PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE;
|
||||
else if (strcmp (mode_string, "system-reset") == 0)
|
||||
state.mode = PLY_BOOT_SPLASH_MODE_SYSTEM_RESET;
|
||||
else
|
||||
state.mode = PLY_BOOT_SPLASH_MODE_BOOT_UP;
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ static script_return_t plymouth_get_mode (script_state_t *state,
|
|||
case PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE:
|
||||
obj = script_obj_new_string ("firmware-upgrade");
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_RESET:
|
||||
obj = script_obj_new_string ("system-reset");
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_INVALID:
|
||||
default:
|
||||
obj = script_obj_new_string ("unknown");
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ view_load_end_animation (view_t *view)
|
|||
case PLY_BOOT_SPLASH_MODE_UPDATES:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE:
|
||||
case PLY_BOOT_SPLASH_MODE_SYSTEM_RESET:
|
||||
animation_prefix = "startup-animation-";
|
||||
break;
|
||||
case PLY_BOOT_SPLASH_MODE_SHUTDOWN:
|
||||
|
|
@ -1226,6 +1227,7 @@ create_plugin (ply_key_file_t *key_file)
|
|||
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);
|
||||
load_mode_settings (plugin, key_file, "firmware-upgrade", PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE);
|
||||
load_mode_settings (plugin, key_file, "system-reset", PLY_BOOT_SPLASH_MODE_SYSTEM_RESET);
|
||||
|
||||
if (plugin->use_firmware_background) {
|
||||
plugin->background_bgrt_image = ply_image_new ("/sys/firmware/acpi/bgrt/image");
|
||||
|
|
@ -1852,7 +1854,8 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin,
|
|||
{
|
||||
if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES ||
|
||||
plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE ||
|
||||
plugin->mode == PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
|
||||
plugin->mode == PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE ||
|
||||
plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_RESET)
|
||||
return;
|
||||
|
||||
if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL)
|
||||
|
|
@ -2035,7 +2038,8 @@ system_update (ply_boot_splash_plugin_t *plugin,
|
|||
{
|
||||
if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES &&
|
||||
plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE &&
|
||||
plugin->mode != PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE)
|
||||
plugin->mode != PLY_BOOT_SPLASH_MODE_FIRMWARE_UPGRADE &&
|
||||
plugin->mode != PLY_BOOT_SPLASH_MODE_SYSTEM_RESET)
|
||||
return;
|
||||
|
||||
update_progress_animation (plugin, progress / 100.0);
|
||||
|
|
|
|||
|
|
@ -56,3 +56,10 @@ ProgressBarShowPercentComplete=true
|
|||
UseProgressBar=true
|
||||
Title=Upgrading Firmware...
|
||||
SubTitle=Do not turn off your computer
|
||||
|
||||
[system-reset]
|
||||
SuppressMessages=true
|
||||
ProgressBarShowPercentComplete=true
|
||||
UseProgressBar=true
|
||||
Title=Resetting System...
|
||||
SubTitle=Do not turn off your computer
|
||||
|
|
|
|||
|
|
@ -42,3 +42,7 @@ UseAnimation=true
|
|||
[firmware-upgrade]
|
||||
UseProgressBar=true
|
||||
UseAnimation=true
|
||||
|
||||
[system-reset]
|
||||
UseProgressBar=true
|
||||
UseAnimation=true
|
||||
|
|
|
|||
|
|
@ -52,3 +52,10 @@ ProgressBarShowPercentComplete=true
|
|||
UseProgressBar=true
|
||||
Title=Upgrading Firmware...
|
||||
SubTitle=Do not turn off your computer
|
||||
|
||||
[system-reset]
|
||||
SuppressMessages=true
|
||||
ProgressBarShowPercentComplete=true
|
||||
UseProgressBar=true
|
||||
Title=Resetting System...
|
||||
SubTitle=Do not turn off your computer
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue