Repository navigation
snapshot: cherry-pick jaypipes/ghw#480 and #481 - #12
Merged
Merged
Conversation
cloneContentByClass looked for sys/class/<class> relative to the working directory, so a snapshot taken anywhere but / silently left out every network interface and GPU: ghwc snapshot run from a scratch directory on a host with physical NICs produced a snapshot without /sys/class/net. Every other path the snapshot clones is absolute; this one is now too. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit 965ad27, jaypipes#480)
On a board without DMI, ghw takes the CPU model, the baseboard and chassis information and the U-Boot version from the DeviceTree under /sys/firmware/devicetree/base, but a snapshot captured none of it: a snapshot of a Jetson AGX Orin reported an empty CPU model where the board itself reports nvidia,tegra234. Capture compatible, model, chassis-type and chosen/u-boot,version. Like the MAC addresses, serial-number is left out: it identifies the board. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit 31d9c94, jaypipes#481)
christoph-zededa
approved these changes
Oct 27, 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.
Cherry-picks of two upstream PRs, with the module path renamed to
github.com/zededa/ghw. Both changes are otherwise identical to upstream's.cloneContentByClassreadsys/class/<class>relative to the working directory, so a snapshot taken anywhere but/silently had no network interfaces and no GPUs.compatible,model,chassis-typeandchosen/u-boot,version, and notserial-number.Both upstream PRs are still open. If upstream changes them before merging, this PR follows. The test file needed one manual step: jaypipes#481's test is appended after jaypipes#480's.
Both tests pass (
TestExpectedCloneContentByClassFromAnyDir,TestCloneDeviceTree), as do the full suite and lint. Pillar doesn't use the snapshot package, so EVE's vendored ghw is unaffected. #9's Orin snapshot will be retaken with this fix so that it includes the CPU model.