[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1089638: fwupd fails to update UEFI firmware on some lenovo systems



Package: fwupd
Version: 1.8.12-2
Tags: patch,fixed-upstream
Control: forwarded -1 https://github.com/fwupd/firmware-lenovo/issues/456

Dear maintainers,

fwupdmgr can not update the UEFI firmware on some lenovo systems (e.g. my T14 AMD Gen1), it shows "UEFI BIOS settings update pending reboot".

The bug is known [1] and fixed [2] upstream.
The first hunk of the upstream patch applies on 1.8.12-2 currently in bookworm, only the test parts fail. With this fix fwupd works as expected.

Thanks for your work,
Valentin

[1] https://github.com/fwupd/firmware-lenovo/issues/456
[2] https://github.com/fwupd/fwupd/pull/8041
From 1d78439f7d6c3322a3b973e0348e606d2986edde Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue, 5 Nov 2024 20:24:04 -0600
Subject: [PATCH] Allow individual attributes to fail setup

Some Lenovo systems the thinklmi driver fails on random attributes.
Rather than fail the remaining attributes skip the bad ones.

Fixes: https://github.com/fwupd/firmware-lenovo/issues/456
---
 libfwupdplugin/fu-bios-settings.c | 10 ++--------
 libfwupdplugin/fu-self-test.c     |  9 ++++-----
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/libfwupdplugin/fu-bios-settings.c b/libfwupdplugin/fu-bios-settings.c
index 58d947e070c..52f692d779d 100644
--- a/libfwupdplugin/fu-bios-settings.c
+++ b/libfwupdplugin/fu-bios-settings.c
@@ -417,14 +417,8 @@ fu_bios_settings_setup(FuBiosSettings *self, GError **error)
 								 full_path,
 								 name,
 								 &error_local)) {
-				if (g_error_matches(error_local,
-						    FWUPD_ERROR,
-						    FWUPD_ERROR_NOT_SUPPORTED)) {
-					g_debug("%s is not supported", name);
-					continue;
-				}
-				g_propagate_error(error, g_steal_pointer(&error_local));
-				return FALSE;
+				g_debug("%s is not supported: %s", name, error_local->message);
+				continue;
 			}
 		} while (++count);
 	} while (TRUE);
diff --git a/libfwupdplugin/fu-self-test.c b/libfwupdplugin/fu-self-test.c
index d765589ad26..dd7acf3f4fe 100644
--- a/libfwupdplugin/fu-self-test.c
+++ b/libfwupdplugin/fu-self-test.c
@@ -4494,9 +4494,8 @@ fu_bios_settings_load_func(void)
 		(void)g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
 
 		ret = fu_context_reload_bios_settings(ctx, &error);
-		g_assert_error(error, FWUPD_ERROR, FWUPD_ERROR_INVALID_FILE);
-		g_assert_false(ret);
-		g_clear_error(&error);
+		g_assert_no_error(error);
+		g_assert_true(ret);
 	}
 	g_free(test_dir);
 
@@ -4575,8 +4574,8 @@ fu_bios_settings_load_func(void)
 	if (g_file_test(test_dir, G_FILE_TEST_EXISTS)) {
 		(void)g_setenv("FWUPD_SYSFSFWATTRIBDIR", test_dir, TRUE);
 		ret = fu_context_reload_bios_settings(ctx, &error);
-		g_assert_error(error, FWUPD_ERROR, FWUPD_ERROR_INVALID_FILE);
-		g_assert_false(ret);
+		g_assert_no_error(error);
+		g_assert_true(ret);
 		g_clear_error(&error);
 	}
 	g_free(test_dir);

Reply to: