Skip to content

snapshot: cherry-pick jaypipes/ghw#480 and #481 - #12

Merged
rucoder merged 2 commits into
eve/v0.26.0from
rucoder/snapshot-fixes
Oct 27, 2026
Merged

rucoder merged 2 commits into
eve/v0.26.0from
rucoder/snapshot-fixes

Conversation

@rucoder

@rucoder rucoder commented Oct 27, 2026

Copy link
Copy Markdown

Cherry-picks of two upstream PRs, with the module path renamed to github.com/zededa/ghw. Both changes are otherwise identical to upstream's.

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.

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)
@rucoder
rucoder merged commit 12e3a83 into eve/v0.26.0 Oct 27, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants