mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 09:14:40 +00:00
Backport a patch to hopefully help with autopkgtest failures on !x86
This commit is contained in:
parent
5bd4547a62
commit
dc17852b2f
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
||||
fwupd (1.8.10-2) UNRELEASED; urgency=medium
|
||||
|
||||
* Backport a patch to hopefully help with autopkgtest failures on !x86
|
||||
|
||||
-- Mario Limonciello <mario.limonciello@amd.com> Tue, 24 Jan 2023 09:11:44 -0600
|
||||
|
||||
fwupd (1.8.10-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version (1.8.10)
|
||||
|
110
debian/patches/0001-Do-not-make-any-of-the-HWIDs-setup-failures-fatal.patch
vendored
Normal file
110
debian/patches/0001-Do-not-make-any-of-the-HWIDs-setup-failures-fatal.patch
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
From 90e5a58736645cdd37bf4c63f9a4056951dfb3f2 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Hughes <richard@hughsie.com>
|
||||
Date: Tue, 24 Jan 2023 09:52:17 +0000
|
||||
Subject: [PATCH] Do not make any of the HWIDs setup failures fatal
|
||||
|
||||
It's perfectly okay to have no HWIDs defined.
|
||||
|
||||
Should help with https://github.com/fwupd/fwupd/issues/5402
|
||||
---
|
||||
libfwupdplugin/fu-context.c | 73 +++++++++++--------------------------
|
||||
1 file changed, 21 insertions(+), 52 deletions(-)
|
||||
|
||||
diff --git a/libfwupdplugin/fu-context.c b/libfwupdplugin/fu-context.c
|
||||
index 08618b435..11b4b1b38 100644
|
||||
--- a/libfwupdplugin/fu-context.c
|
||||
+++ b/libfwupdplugin/fu-context.c
|
||||
@@ -767,6 +767,8 @@ fu_context_security_changed(FuContext *self)
|
||||
g_signal_emit(self, signals[SIGNAL_SECURITY_CHANGED], 0);
|
||||
}
|
||||
|
||||
+typedef gboolean (*FuContextHwidsSetupFunc)(FuContext *self, FuHwids *hwids, GError **error);
|
||||
+
|
||||
/**
|
||||
* fu_context_load_hwinfo:
|
||||
* @self: a #FuContext
|
||||
@@ -786,62 +788,29 @@ fu_context_load_hwinfo(FuContext *self, FuContextHwidFlags flags, GError **error
|
||||
GPtrArray *guids;
|
||||
g_autoptr(GError) error_hwids = NULL;
|
||||
g_autoptr(GError) error_bios_settings = NULL;
|
||||
+ struct {
|
||||
+ const gchar *name;
|
||||
+ FuContextHwidFlags flag;
|
||||
+ FuContextHwidsSetupFunc func;
|
||||
+ } hwids_setup_map[] = {{"config", FU_CONTEXT_HWID_FLAG_LOAD_CONFIG, fu_hwids_config_setup},
|
||||
+ {"smbios", FU_CONTEXT_HWID_FLAG_LOAD_SMBIOS, fu_hwids_smbios_setup},
|
||||
+ {"fdt", FU_CONTEXT_HWID_FLAG_LOAD_FDT, fu_hwids_fdt_setup},
|
||||
+ {"kenv", FU_CONTEXT_HWID_FLAG_LOAD_KENV, fu_hwids_kenv_setup},
|
||||
+ {"dmi", FU_CONTEXT_HWID_FLAG_LOAD_DMI, fu_hwids_dmi_setup},
|
||||
+ {NULL, FU_CONTEXT_HWID_FLAG_NONE, NULL}};
|
||||
|
||||
g_return_val_if_fail(FU_IS_CONTEXT(self), FALSE);
|
||||
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
|
||||
|
||||
- if ((flags & FU_CONTEXT_HWID_FLAG_LOAD_CONFIG) > 0) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
- if (!fu_hwids_config_setup(self, priv->hwids, &error_local)) {
|
||||
- if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||
- g_propagate_prefixed_error(error,
|
||||
- g_steal_pointer(&error_local),
|
||||
- "Failed to load HWIDs config: ");
|
||||
- return FALSE;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- if ((flags & FU_CONTEXT_HWID_FLAG_LOAD_DMI) > 0) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
- if (!fu_hwids_dmi_setup(self, priv->hwids, &error_local)) {
|
||||
- if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||
- g_propagate_prefixed_error(error,
|
||||
- g_steal_pointer(&error_local),
|
||||
- "Failed to load HWIDs DMI: ");
|
||||
- return FALSE;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- if ((flags & FU_CONTEXT_HWID_FLAG_LOAD_FDT) > 0) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
- if (!fu_hwids_fdt_setup(self, priv->hwids, &error_local)) {
|
||||
- if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||
- g_propagate_prefixed_error(error,
|
||||
- g_steal_pointer(&error_local),
|
||||
- "Failed to load HWIDs FDT: ");
|
||||
- return FALSE;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- if ((flags & FU_CONTEXT_HWID_FLAG_LOAD_KENV) > 0) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
- if (!fu_hwids_kenv_setup(self, priv->hwids, &error_local)) {
|
||||
- if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||
- g_propagate_prefixed_error(error,
|
||||
- g_steal_pointer(&error_local),
|
||||
- "Failed to load HWIDs kenv: ");
|
||||
- return FALSE;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- if ((flags & FU_CONTEXT_HWID_FLAG_LOAD_SMBIOS) > 0) {
|
||||
- g_autoptr(GError) error_local = NULL;
|
||||
- if (!fu_hwids_smbios_setup(self, priv->hwids, &error_local)) {
|
||||
- if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED)) {
|
||||
- g_propagate_prefixed_error(error,
|
||||
- g_steal_pointer(&error_local),
|
||||
- "Failed to load SMBIOS: ");
|
||||
- return FALSE;
|
||||
+ /* run all the HWID setup funcs */
|
||||
+ for (guint i = 0; hwids_setup_map[i].name != NULL; i++) {
|
||||
+ if ((flags & hwids_setup_map[i].flag) > 0) {
|
||||
+ g_autoptr(GError) error_local = NULL;
|
||||
+ if (!hwids_setup_map[i].func(self, priv->hwids, &error_local)) {
|
||||
+ g_debug("failed to load %s: %s",
|
||||
+ hwids_setup_map[i].name,
|
||||
+ error_local->message);
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
1
debian/patches/series
vendored
Normal file
1
debian/patches/series
vendored
Normal file
@ -0,0 +1 @@
|
||||
0001-Do-not-make-any-of-the-HWIDs-setup-failures-fatal.patch
|
Loading…
Reference in New Issue
Block a user