detect_platform: %q-escape output so eval survives spaces in MODEL

The Jetson model string has spaces; emitted unquoted, eval ran its second word
as a command ("Jetson: command not found"). printf %q makes the output safe to
eval, which is how every other script consumes it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
AngePierreandClaude Opus 5 committed 2026-09-10 16:57:53 +02:00
1 parent 23b30ac1e8
commit e0727d957b
1 file changed
+9 -6
+9 -6
View File
@@ -49,9 +49,12 @@ case "$major" in
*) jetpack="unknown" ;; *) jetpack="unknown" ;;
esac esac
echo "L4T=${l4t:-unknown}" # %q-escaped so a caller can `eval` the output safely: MODEL holds spaces
echo "L4T_MAJOR=${major:-unknown}" # ("NVIDIA Jetson Orin Nano …"), which unquoted would make eval run "Jetson" as a
echo "JETPACK=${jetpack}" # command.
echo "SOC=${soc}" printf 'L4T=%q\n' "${l4t:-unknown}"
echo "ARCH=$(uname -m)" printf 'L4T_MAJOR=%q\n' "${major:-unknown}"
echo "MODEL=${model}" printf 'JETPACK=%q\n' "${jetpack}"
printf 'SOC=%q\n' "${soc}"
printf 'ARCH=%q\n' "$(uname -m)"
printf 'MODEL=%q\n' "${model}"