Skip to content

Commit 4164f69

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, offline rootfs, or remote (SSH) targets against release assets in sof-bin. - Debian (.deb) & RPM (.rpm) package validation: Directly extracts and validates sof-bin packages offline without requiring installation. - Version & release identification (--identify): Scans target filesystems and resolves installed component versions using on-demand release hash indexing. - Platform FW vs LLEXT consistency verification: Validates that all installed dynamic LLEXT modules match base firmware binaries in both release version and embedded BCD build dates. - Topology upgrade detection: Automatically identifies and flags installed topologies that can be upgraded from sof-bin to match target firmware. - 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. - Strict mode & extraneous file detection (--strict): Identifies untracked or extraneous firmware/topology files on target systems (Status.EXTRA). - Automated tests: Comprehensive unit test suite covering repo discovery, MD5 matching, manifest parsing, package validation, consistency checking, fix operations, and downgrade prevention.
1 parent e65a0d4 commit 4164f69

4 files changed

Lines changed: 3643 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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,59 @@ 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+
# Validate Debian (.deb) package against SOF v2.14.1
126+
./validate_sof_install.py --deb firmware-sof-signed_2.14.1_all.deb --version v2.14.1
127+
128+
# Validate RPM (.rpm) package against SOF v2.14.1
129+
./validate_sof_install.py --rpm alsa-sof-firmware-2.14.1.rpm --version v2.14.1
130+
131+
# Auto-identify SOF release versions inside a package archive
132+
./validate_sof_install.py --pkg firmware-sof-signed.deb --identify
133+
134+
# Generate a standalone md5sum manifest
135+
./validate_sof_install.py --version v2.14.1 --generate-md5 /tmp/v2.14.1-md5.txt
136+
```
137+
138+
139+

0 commit comments

Comments
 (0)