Skip to content

Commit aa6d532

Browse files
committed
fix(installer): surface strings' real error on a failed version probe; drop redundant reset
- remove 2>/dev/null from the strings probe so a genuine failure (truncated download, bad perms, corrupted ELF) shows its real diagnostic in the log instead of only the ambiguous warn - drop the redundant verified="" reset: a failed command substitution already leaves the variable empty
1 parent bc57d76 commit aa6d532

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/install-rknpu.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,16 @@ pin_librknnrt() {
351351
# not silently indistinguishable from "no version string" (which used
352352
# to mean only "binutils missing"); warn so a future first-run failure
353353
# stays diagnosable.
354-
if verified="$(strings "$tmp" 2>/dev/null | awk '/librknnrt version: / && !seen { print $3; seen=1 }')"; then
354+
# Do NOT swallow strings' stderr: if the probe fails (truncated
355+
# download, bad perms, corrupted ELF) its real error is the diagnostic,
356+
# so let it through to the log alongside the warn below. On a valid
357+
# runtime strings is quiet on stderr, so this adds no normal-path noise.
358+
if verified="$(strings "$tmp" | awk '/librknnrt version: / && !seen { print $3; seen=1 }')"; then
355359
:
356360
else
361+
# A failed substitution already leaves $verified empty, so no reset
362+
# is needed; the fallback below re-reads the installed path.
357363
warn "strings/awk version probe failed on the downloaded runtime; falling back to the installed path"
358-
verified=""
359364
fi
360365
if [[ -z "$verified" ]]; then
361366
# Fall back to re-reading the installed path (legacy behaviour).

0 commit comments

Comments
 (0)