From: Hans de Goede Date: Fri, 5 Mar 2021 11:02:21 +0000 (+0100) Subject: two-step: Only create background_bgrt_fallback_image if use_firmware_background is set X-Git-Tag: 22.02.122~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5db6cf2d1473c2f63e1a34f22c0832ab78c55ef;p=thirdparty%2Fplymouth.git two-step: Only create background_bgrt_fallback_image if use_firmware_background is set We should not create (and try to use) the background_bgrt_fallback_image when the config file has not requested use of the firmware-background. Otherwise we will end up using bgrt-fallback.png if present even when the config file has not requested usage of the firmware-background. Signed-off-by: Hans de Goede --- diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 7dcd66e6..ed83d8bc 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -1076,10 +1076,6 @@ create_plugin (ply_key_file_t *key_file) plugin->background_tile_image = ply_image_new (image_path); free (image_path); - asprintf (&image_path, "%s/bgrt-fallback.png", image_dir); - plugin->background_bgrt_fallback_image = ply_image_new (image_path); - free (image_path); - asprintf (&image_path, "%s/watermark.png", image_dir); plugin->watermark_image = ply_image_new (image_path); free (image_path); @@ -1182,9 +1178,14 @@ create_plugin (ply_key_file_t *key_file) 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); - if (plugin->use_firmware_background) + if (plugin->use_firmware_background) { plugin->background_bgrt_image = ply_image_new ("/sys/firmware/acpi/bgrt/image"); + asprintf (&image_path, "%s/bgrt-fallback.png", image_dir); + plugin->background_bgrt_fallback_image = ply_image_new (image_path); + free (image_path); + } + plugin->dialog_clears_firmware_background = ply_key_file_get_bool (key_file, "two-step", "DialogClearsFirmwareBackground");