mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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>
This commit is contained in:
parent
197a1a6214
commit
0d18be5049
@ -1,4 +1,4 @@
|
|||||||
#! /bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# exit when any command fails
|
# exit when any command fails
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] ; then
|
if [[ $# -eq 0 ]] ; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# Flash PX4 to a device running AuterionOS in the local network
|
# Flash PX4 to a device running AuterionOS in the local network
|
||||||
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ $# -lt 2 ]; then
|
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ $# -lt 2 ]; then
|
||||||
echo "Usage: $0 -f <firmware.px4|.elf> [-c <configuration_dir>] -d <IP/Device> [-u <user>] [-p <ssh_port>] [--revert]"
|
echo "Usage: $0 -f <firmware.px4|.elf> [-c <configuration_dir>] -d <IP/Device> [-u <user>] [-p <ssh_port>] [--revert]"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# This script is meant to be used by the build_all.yml workflow in a github runner
|
# This script is meant to be used by the build_all.yml workflow in a github runner
|
||||||
# Please only modify if you know what you are doing
|
# Please only modify if you know what you are doing
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#! /bin/bash
|
#!/usr/bin/env bash
|
||||||
# Copy a git diff between two commits if msg versioning is added
|
# Copy a git diff between two commits if msg versioning is added
|
||||||
|
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
cp **/**/*.px4 artifacts/ 2>/dev/null || true
|
cp **/**/*.px4 artifacts/ 2>/dev/null || true
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# This script runs the fuzz tests from a given binary for a certain amount of time
|
# This script runs the fuzz tests from a given binary for a certain amount of time
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#! /bin/bash
|
#!/usr/bin/env bash
|
||||||
# Copy msgs and the message translation node into a ROS workspace directory
|
# Copy msgs and the message translation node into a ROS workspace directory
|
||||||
|
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#! /bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||||
PX4_DOCKER_REPO="px4io/px4-dev:v1.17.0-beta1"
|
PX4_DOCKER_REPO="px4io/px4-dev:v1.17.0-beta1"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Script to run ShellCheck (a static analysis tool for shell scripts) over a
|
# Script to run ShellCheck (a static analysis tool for shell scripts) over a
|
||||||
# script directory
|
# script directory
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
NO_COLOR='\033[0m' # No Color
|
NO_COLOR='\033[0m' # No Color
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Setup environment to make PX4 visible to Gazebo.
|
# Setup environment to make PX4 visible to Gazebo.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# run multiple instances of the 'px4' binary, with the gazebo SITL simulation
|
# run multiple instances of the 'px4' binary, with the gazebo SITL simulation
|
||||||
# It assumes px4 is already built, with 'make px4_sitl_default sitl_gazebo-classic'
|
# It assumes px4 is already built, with 'make px4_sitl_default sitl_gazebo-classic'
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# Run multiple instances of the 'px4' binary, without starting an external simulator.
|
# Run multiple instances of the 'px4' binary, without starting an external simulator.
|
||||||
# It assumes px4 is already built with the specified build target.
|
# It assumes px4 is already built with the specified build target.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Run this from the px4 project top level directory
|
# Run this from the px4 project top level directory
|
||||||
docker run -it --rm --privileged -v `pwd`:/usr/local/workspace px4io/px4-dev-nuttx-focal:2022-08-12
|
docker run -it --rm --privileged -v `pwd`:/usr/local/workspace px4io/px4-dev-nuttx-focal:2022-08-12
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Create px4-* symlinks from px4-alias.sh
|
# Create px4-* symlinks from px4-alias.sh
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Stop voxl-px4 service if running
|
# Stop voxl-px4 service if running
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "*** Starting qurt slpi build ***"
|
echo "*** Starting qurt slpi build ***"
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Clean out the build artifacts
|
# Clean out the build artifacts
|
||||||
# source /home/build-env.sh
|
# source /home/build-env.sh
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Push slpi image to voxl2
|
# Push slpi image to voxl2
|
||||||
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Push slpi image to voxl2
|
# Push slpi image to voxl2
|
||||||
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cd Tools/simulation/gazebo-classic/sitl_gazebo-classic/src
|
cd Tools/simulation/gazebo-classic/sitl_gazebo-classic/src
|
||||||
patch < ../../../../../boards/modalai/voxl2/gazebo-docker/patch/mavlink_interface.patch
|
patch < ../../../../../boards/modalai/voxl2/gazebo-docker/patch/mavlink_interface.patch
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Run this from the px4 project top level directory
|
# Run this from the px4 project top level directory
|
||||||
docker run -it --rm -v `pwd`:/usr/local/workspace rb5-flight-px4-build-docker
|
docker run -it --rm -v `pwd`:/usr/local/workspace rb5-flight-px4-build-docker
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
################################################################################
|
################################################################################
|
||||||
# Copyright 2023 ModalAI Inc.
|
# Copyright 2023 ModalAI Inc.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
CONFIG_FILE="/etc/modalai/voxl-px4.conf"
|
CONFIG_FILE="/etc/modalai/voxl-px4.conf"
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Make sure that the SLPI DSP test signature is there otherwise px4 cannot run
|
# Make sure that the SLPI DSP test signature is there otherwise px4 cannot run
|
||||||
# on the DSP
|
# on the DSP
|
||||||
|
|||||||
@ -159,7 +159,7 @@ Runs after the package is installed. Common tasks:
|
|||||||
- Board-specific setup (e.g., DSP signature generation)
|
- Board-specific setup (e.g., DSP signature generation)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Create px4-* symlinks
|
# Create px4-* symlinks
|
||||||
@ -185,7 +185,7 @@ fi
|
|||||||
Runs before the package is removed:
|
Runs before the package is removed:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Stop the service
|
# Stop the service
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#! /bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
PX4_SRC_DIR=${DIR}/..
|
PX4_SRC_DIR=${DIR}/..
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user