Unverified Commit 151d38f8 authored by Gaetan Lepage's avatar Gaetan Lepage Committed by r-vdp
Browse files
parent 741e6152
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@
  efibootmgr,
  tpm2-tools,

  fetchpatch2,

  # passthru
  nixosTests,
  nix-update-script,
@@ -173,8 +175,10 @@ stdenv.mkDerivation (finalAttrs: {
    # EFI capsule is located in fwupd-efi now.
    ./efi-app-path.patch

    # See https://github.com/fwupd/fwupd/pull/8959
    ./uefi-capsule-no-splash-fix-test.diff
    (fetchpatch2 {
      url = "https://github.com/fwupd/fwupd/pull/8959.diff?full_index=1";
      hash = "sha256-w4uf1CXSyy1pqqM4lzMZoOFhDxadcU3Tdnz0dJgLW7w=";
    })
  ];

  postPatch =
+0 −82
Original line number Diff line number Diff line
commit 90d854ca68543ed117a5a49c28a027972088b568
Author: r-vdp <ramses@well-founded.dev>
Date:   Wed Jun 25 11:31:45 2025 +0200

    Fix uefi self-test when plugin_uefi_capsule_splash is disabled

diff --git a/meson.build b/meson.build
index 922e87c23..d36850422 100644
--- a/meson.build
+++ b/meson.build
@@ -564,6 +564,10 @@ conf.set_quoted('MOTD_DIR', motd_dir)
 
 conf.set_quoted('FU_DEFAULT_P2P_POLICY', get_option('p2p_policy'))
 
+if get_option('plugin_uefi_capsule_splash')
+  conf.set('FWUPD_UEFI_CAPSULE_SPLASH_ENABLED', '1')
+endif
+
 configure_file(
   output: 'config.h',
   configuration: conf
diff --git a/plugins/uefi-capsule/fu-self-test.c b/plugins/uefi-capsule/fu-self-test.c
index d8ffdd913..d99b72fc7 100644
--- a/plugins/uefi-capsule/fu-self-test.c
+++ b/plugins/uefi-capsule/fu-self-test.c
@@ -534,6 +534,7 @@ fu_uefi_plugin_nvram_func(void)
 	g_assert_no_error(error);
 	g_assert_true(ret);
 
+#ifdef FWUPD_UEFI_CAPSULE_SPLASH_ENABLED
 	/* check UX splash was created */
 	g_assert_true(fu_uefi_plugin_esp_file_exists(
 	    esp,
@@ -541,14 +542,17 @@ fu_uefi_plugin_nvram_func(void)
 	g_assert_true(fu_efivars_exists(fu_context_get_efivars(ctx),
 					FU_EFIVARS_GUID_FWUPDATE,
 					"fwupd-ux-capsule"));
+#endif
 
 	/* check FW was created */
 	g_assert_true(fu_uefi_plugin_esp_file_exists(
 	    esp,
 	    "EFI/" EFI_OS_DIR "/fw/fwupd-cc4cbfa9-bf9d-540b-b92b-172ce31013c1.cap"));
+#ifdef FWUPD_UEFI_CAPSULE_SPLASH_ENABLED
 	g_assert_true(fu_efivars_exists(fu_context_get_efivars(ctx),
 					FU_EFIVARS_GUID_FWUPDATE,
 					"fwupd-ux-capsule"));
+#endif
 	g_assert_true(fu_efivars_exists(fu_context_get_efivars(ctx),
 					FU_EFIVARS_GUID_FWUPDATE,
 					"fwupd-cc4cbfa9-bf9d-540b-b92b-172ce31013c1-0"));
diff --git a/plugins/uefi-capsule/fu-uefi-capsule-plugin.c b/plugins/uefi-capsule/fu-uefi-capsule-plugin.c
index 6623ccd06..419d86565 100644
--- a/plugins/uefi-capsule/fu-uefi-capsule-plugin.c
+++ b/plugins/uefi-capsule/fu-uefi-capsule-plugin.c
@@ -327,6 +327,7 @@ fu_uefi_capsule_plugin_add_security_attrs(FuPlugin *plugin, FuSecurityAttrs *att
 	fu_uefi_capsule_plugin_add_security_attrs_bootservices(plugin, attrs);
 }
 
+#ifdef FWUPD_UEFI_CAPSULE_SPLASH_ENABLED
 static GBytes *
 fu_uefi_capsule_plugin_get_splash_data(guint width, guint height, GError **error)
 {
@@ -544,6 +545,7 @@ fu_uefi_capsule_plugin_update_splash(FuPlugin *plugin, FuDevice *device, GError
 	/* perform the upload */
 	return fu_uefi_capsule_plugin_write_splash_data(self, device, image_bmp, error);
 }
+#endif // FWUPD_UEFI_CAPSULE_SPLASH_ENABLED
 
 static gboolean
 fu_uefi_capsule_plugin_write_firmware(FuPlugin *plugin,
@@ -583,8 +585,10 @@ fu_uefi_capsule_plugin_write_firmware(FuPlugin *plugin,
 
 	/* perform the update */
 	fu_progress_set_status(progress, FWUPD_STATUS_SCHEDULING);
+#ifdef FWUPD_UEFI_CAPSULE_SPLASH_ENABLED
 	if (!fu_uefi_capsule_plugin_update_splash(plugin, device, &error_splash))
 		g_info("failed to upload UEFI UX capsule text: %s", error_splash->message);
+#endif
 
 	return fu_device_write_firmware(device, firmware, progress, flags, error);
 }