]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Only create background_bgrt_fallback_image if use_firmware_background is set
authorHans de Goede <hdegoede@redhat.com>
Fri, 5 Mar 2021 11:02:21 +0000 (12:02 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 5 Mar 2021 12:55:10 +0000 (13:55 +0100)
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 <hdegoede@redhat.com>
src/plugins/splash/two-step/plugin.c

index 7dcd66e618a08d0bf87384e552dba6f36e0c0f06..ed83d8bc2ab17e1de6bbcdc69927c65b7bb78948 100644 (file)
@@ -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");