ENT-14409: Collect device inventory with fwupdmgr, not fwupd's cache file - #154
Merged
Merged
Conversation
…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>
larsewi
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source the fwupd device list from
fwupdmgr get-devices --jsoninto a TTL'd JSON cache instead of reading fwupd's/var/cache/fwupd/devices.json, which is often zero-length and madereadjson()log 22 errors per agent run.Also touch the JSON caches on refresh, so an unchanged cache does not re-run every
fwupdmgrcall on every agent run.