Skip to content

ENT-14409: Collect device inventory with fwupdmgr, not fwupd's cache file - #154

Merged
nickanderson merged 1 commit into
cfengine:masterfrom
nickanderson:ENT-14409/master
Aug 12, 2026
Merged

ENT-14409: Collect device inventory with fwupdmgr, not fwupd's cache file#154
nickanderson merged 1 commit into
cfengine:masterfrom
nickanderson:ENT-14409/master

Conversation

@nickanderson

Copy link
Copy Markdown
Member

Source the fwupd device list from fwupdmgr get-devices --json into a TTL'd JSON cache instead of reading fwupd's /var/cache/fwupd/devices.json, which is often zero-length and made readjson() log 22 errors per agent run.

Also touch the JSON caches on refresh, so an unchanged cache does not re-run every fwupdmgr call on every agent run.

…file

fwupd rewrites /var/cache/fwupd/devices.json on every engine change
signal, including during daemon startup before device enumeration has
finished, so it is often zero-length on hosts with dozens of devices.
readjson() logged 22 errors per agent run on such a host and the module
produced no firmware inventory at all.

Also touch the JSON caches when refreshing them. content only writes
when the file differs, so an unchanged cache kept its old mtime and
re-ran every fwupdmgr call on every agent run once past TTL.

Ticket: ENT-14409
Changelog: title
Signed-off-by: Nick Anderson <nick@cmdln.org>
@nickanderson
nickanderson requested a review from larsewi August 11, 2026 19:25
@nickanderson
nickanderson merged commit 709caa2 into cfengine:master Aug 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants