Skip to content

Commit ecd76dd

Browse files
committed
validate_sof_install: Add SOF firmware & topology installation validator
Add validate_sof_install.py tool to verify, identify, and repair SOF firmware, LLEXT modules, topology binaries, and debug tools installed on target hosts against reference releases in sof-bin. Key capabilities: - Validation engine: Compares installed files, versions, symlinks, and MD5 checksums on local or remote (SSH) targets against release assets in sof-bin. - Version & release identification (--identify): Scans target filesystems and resolves installed component versions using global release hash indexing. - Binary manifest inspection (--manifest / -m): Extracts metadata directly from binaries (ADSP FW $AM1, CSS $MN2 BCD build dates, extended manifest XMan, Zephyr/SOF git tag banners, and ALSA topology CoSA ABI headers). - Sub-row manifest diffs: On mismatch, outputs comparison sub-rows detailing Host vs Expected versions, build timestamps, and ABI levels. - Repair engine (--fix, --dry-run): Automatically installs missing or mismatched files and recreates symlinks via local copy or SSH/SCP. Displays version and manifest transitions (from -> to) for each repair. - Downgrade protection: Prevents downgrading installed packages unless explicitly allowed via --downgrade / --allow-downgrade flag. - Automated tests: Comprehensive unit test suite covering repo discovery, MD5 matching, manifest parsing, fix operations, and downgrade prevention.
1 parent e65a0d4 commit ecd76dd

4 files changed

Lines changed: 2510 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ reproducible_images/
44
# caches
55
/tests/refs/
66
/tests/refs_extracted/
7+
__pycache__/
8+
*.pyc
9+
tests/__pycache__/
10+

‎README.md‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,50 @@ Remember that for `rsync` (and some versions of `cp`), a trailing slash
8181
in `srcdir/` is roughly equivalent to `srcdir/*` + `srcdir/.??*` This
8282
is how a recursive `rsync` is always idempotent while a recursive `cp`
8383
is typically not.
84+
85+
## Validating and Repairing an Installation with validate_sof_install.py
86+
87+
To verify that the installed SOF firmware binaries, LLEXT dynamic modules,
88+
topologies, and userspace tools match a specific release in this repository
89+
using MD5 checksums:
90+
91+
```bash
92+
# Identify versions of all installed SOF files on the filesystem
93+
./validate_sof_install.py --identify
94+
95+
# Identify installed files with embedded binary manifest details (build date, ABI, git tags)
96+
./validate_sof_install.py --identify -p tgl --manifest
97+
98+
# Identify installed files on remote DUT over SSH
99+
./validate_sof_install.py -i -p tgl --ssh root@spider
100+
101+
# List available versions in sof-bin
102+
./validate_sof_install.py --list-versions
103+
104+
# Validate a specific version on local /lib/firmware/intel (automatically displays manifest diffs on mismatch)
105+
./validate_sof_install.py --version v2.14.1
106+
107+
# Validate with full manifest details shown for all files
108+
./validate_sof_install.py --version v2.14.1 --manifest
109+
110+
# Validate only a specific platform (e.g. Tiger Lake on local host)
111+
./validate_sof_install.py --version v2.12 --platform tgl
112+
113+
# Preview repairs without modifying files (--dry-run)
114+
./validate_sof_install.py --version v2.14.1 --platform tgl --fix --dry-run
115+
116+
# Automatically repair/sync missing or mismatched files from sof-bin
117+
sudo ./validate_sof_install.py --version v2.14.1 --platform tgl --fix
118+
119+
# Validate a remote DUT directly over SSH (supports remote --fix as well)
120+
./validate_sof_install.py --version v2.12 --platform tgl --ssh root@spider
121+
122+
# Validate an offline rootfs (e.g. PXE NFS mount)
123+
./validate_sof_install.py --version v2.12 --platform tgl --target-root /srv/nfs/spider-rootfs
124+
125+
# Generate a standalone md5sum manifest
126+
./validate_sof_install.py --version v2.14.1 --generate-md5 /tmp/v2.14.1-md5.txt
127+
```
128+
129+
130+

0 commit comments

Comments
 (0)