Onur Özkan 0d18be5049
fix(scripts): replace hardcoded /bin/bash shebangs
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems
such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and
causes failures like `bad interpreter` during `make format`, e.g., on my host machine:

```sh
$ make format

/PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory
```

This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly.

No functional changes intended.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
2026-04-01 12:25:28 -08:00

42 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Make sure that the SLPI DSP test signature is there otherwise px4 cannot run
# on the DSP
if /bin/ls /usr/lib/rfsa/adsp/testsig-*.so &> /dev/null; then
/bin/echo "Found DSP signature file"
else
/bin/echo "[WARNING] Could not find DSP signature file"
# Look for the DSP signature generation script (platform-specific)
if [ -f /share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh ]; then
/bin/echo "[INFO] Attempting to generate the DSP signature file (qcs6490)"
/share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh
elif [ -f /share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh ]; then
/bin/echo "[INFO] Attempting to generate the DSP signature file (qrb5165)"
/share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh
else
/bin/echo "[ERROR] Could not find the DSP signature file generation script"
exit 0
fi
fi
print_usage() {
echo -e "\nUsage: voxl-px4-hitl"
echo " [-h (show help)]"
exit 1
}
while getopts "h" flag
do
case "${flag}" in
h)
print_usage
;;
*)
print_usage
;;
esac
done
px4 -s /usr/bin/voxl-px4-hitl-start