/src/fwupd/libfwupdplugin/fu-hwids-config.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2021 Richard Hughes <richard@hughsie.com> |
3 | | * |
4 | | * SPDX-License-Identifier: LGPL-2.1-or-later |
5 | | */ |
6 | | |
7 | | #define G_LOG_DOMAIN "FuContext" |
8 | | |
9 | | #include "config.h" |
10 | | |
11 | | #include "fu-config.h" |
12 | | #include "fu-context-private.h" |
13 | | #include "fu-hwids-private.h" |
14 | | |
15 | | gboolean |
16 | | fu_hwids_config_setup(FuContext *ctx, FuHwids *self, GError **error) |
17 | 0 | { |
18 | 0 | FuConfig *config = fu_context_get_config(ctx); |
19 | 0 | g_autoptr(GPtrArray) keys = fu_hwids_get_keys(self); |
20 | | |
21 | | /* all keys are optional */ |
22 | 0 | for (guint i = 0; i < keys->len; i++) { |
23 | 0 | const gchar *key = g_ptr_array_index(keys, i); |
24 | 0 | g_autofree gchar *value = fu_config_get_value(config, "fwupd", key); |
25 | 0 | if (value != NULL) |
26 | 0 | fu_hwids_add_value(self, key, value); |
27 | 0 | } |
28 | | |
29 | | /* success */ |
30 | 0 | return TRUE; |
31 | 0 | } |