mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 17:45:23 +00:00
fwupdtool: don't show a warning when calling get-plugins
The plugins are not opened for this function so of course they won't set their build hashes. Fixes errors like this: `uefi should call fu_plugin_set_build_hash()`
This commit is contained in:
parent
342a38b432
commit
52e75ba2b6
@ -4277,17 +4277,21 @@ fu_engine_plugin_set_coldplug_delay_cb (FuPlugin *plugin, guint duration, FuEngi
|
|||||||
void
|
void
|
||||||
fu_engine_add_plugin (FuEngine *self, FuPlugin *plugin)
|
fu_engine_add_plugin (FuEngine *self, FuPlugin *plugin)
|
||||||
{
|
{
|
||||||
|
if (fu_plugin_is_open (plugin)) {
|
||||||
/* plugin does not match built version */
|
/* plugin does not match built version */
|
||||||
if (fu_plugin_get_build_hash (plugin) == NULL) {
|
if (fu_plugin_get_build_hash (plugin) == NULL) {
|
||||||
const gchar *name = fu_plugin_get_name (plugin);
|
const gchar *name = fu_plugin_get_name (plugin);
|
||||||
g_warning ("%s should call fu_plugin_set_build_hash()", name);
|
g_warning ("%s should call fu_plugin_set_build_hash()",
|
||||||
|
name);
|
||||||
self->tainted = TRUE;
|
self->tainted = TRUE;
|
||||||
} else if (g_strcmp0 (fu_plugin_get_build_hash (plugin), FU_BUILD_HASH) != 0) {
|
} else if (g_strcmp0 (fu_plugin_get_build_hash (plugin),
|
||||||
|
FU_BUILD_HASH) != 0) {
|
||||||
const gchar *name = fu_plugin_get_name (plugin);
|
const gchar *name = fu_plugin_get_name (plugin);
|
||||||
g_warning ("%s has incorrect built version %s",
|
g_warning ("%s has incorrect built version %s",
|
||||||
name, fu_plugin_get_build_hash (plugin));
|
name, fu_plugin_get_build_hash (plugin));
|
||||||
self->tainted = TRUE;
|
self->tainted = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fu_plugin_list_add (self->plugin_list, plugin);
|
fu_plugin_list_add (self->plugin_list, plugin);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#define FU_OFFLINE_TRIGGER_FILENAME FU_OFFLINE_DESTDIR "/system-update"
|
#define FU_OFFLINE_TRIGGER_FILENAME FU_OFFLINE_DESTDIR "/system-update"
|
||||||
|
|
||||||
FuPlugin *fu_plugin_new (void);
|
FuPlugin *fu_plugin_new (void);
|
||||||
|
gboolean fu_plugin_is_open (FuPlugin *self);
|
||||||
void fu_plugin_set_usb_context (FuPlugin *self,
|
void fu_plugin_set_usb_context (FuPlugin *self,
|
||||||
GUsbContext *usb_ctx);
|
GUsbContext *usb_ctx);
|
||||||
void fu_plugin_set_hwids (FuPlugin *self,
|
void fu_plugin_set_hwids (FuPlugin *self,
|
||||||
|
@ -106,6 +106,23 @@ typedef gboolean (*FuPluginUdevDeviceAddedFunc) (FuPlugin *self,
|
|||||||
FuUdevDevice *device,
|
FuUdevDevice *device,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fu_plugin_is_open:
|
||||||
|
* @self: A #FuPlugin
|
||||||
|
*
|
||||||
|
* Determines if the plugin is opened
|
||||||
|
*
|
||||||
|
* Returns: TRUE for opened, FALSE for not
|
||||||
|
*
|
||||||
|
* Since: 1.3.5
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
fu_plugin_is_open (FuPlugin *self)
|
||||||
|
{
|
||||||
|
FuPluginPrivate *priv = GET_PRIVATE (self);
|
||||||
|
return priv->module != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fu_plugin_get_name:
|
* fu_plugin_get_name:
|
||||||
* @self: A #FuPlugin
|
* @self: A #FuPlugin
|
||||||
|
Loading…
Reference in New Issue
Block a user