From 72792cef431b67f098edf647502c546cc34f9515 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 25 Aug 2018 11:02:37 -0400 Subject: [PATCH] posix-configs shell scripts use /bin/sh to maximize compatibility (#10292) - fix ocpoc line endings --- ROMFS/px4fmu_common/init.d-posix/rc.replay | 2 +- ROMFS/px4fmu_common/init.d-posix/rcS | 2 +- platforms/posix/src/px4-alias.sh_in | 2 +- posix-configs/SITL/init/test/cmd_template.in | 2 +- posix-configs/SITL/init/test/tests_all | 2 +- .../SITL/init/test/tests_template.in | 2 +- posix-configs/bbblue/px4.config | 2 +- posix-configs/bbblue/px4_fw.config | 2 +- posix-configs/bebop/px4.config | 2 +- posix-configs/eagle/200qx/mainapp.config | 2 +- posix-configs/eagle/210qc/mainapp.config | 2 +- posix-configs/eagle/flight/mainapp.config | 2 +- posix-configs/eagle/init/rcS | 2 +- posix-configs/excelsior/mainapp.config | 2 +- posix-configs/ocpoc/px4.config | 82 +++++++++---------- posix-configs/rpi/px4.config | 2 +- posix-configs/rpi/px4_fw.config | 2 +- posix-configs/rpi/px4_hil.config | 2 +- posix-configs/rpi/px4_no_shield.config | 2 +- .../local_position_estimator/fault_table.py | 2 +- 20 files changed, 60 insertions(+), 60 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rc.replay b/ROMFS/px4fmu_common/init.d-posix/rc.replay index 58a0ca9658..b378f826f8 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rc.replay +++ b/ROMFS/px4fmu_common/init.d-posix/rc.replay @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # EKF2 replay script diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 91c9cb7c8f..15219d1c39 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) diff --git a/platforms/posix/src/px4-alias.sh_in b/platforms/posix/src/px4-alias.sh_in index 5d806f8f4f..ad79af4c79 100644 --- a/platforms/posix/src/px4-alias.sh_in +++ b/platforms/posix/src/px4-alias.sh_in @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # File is auto-generated by cmake compilation, do not edit. diff --git a/posix-configs/SITL/init/test/cmd_template.in b/posix-configs/SITL/init/test/cmd_template.in index 33251e67d6..c856c175b1 100644 --- a/posix-configs/SITL/init/test/cmd_template.in +++ b/posix-configs/SITL/init/test/cmd_template.in @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/SITL/init/test/tests_all b/posix-configs/SITL/init/test/tests_all index 2ea95eefd6..ba27bd95c6 100644 --- a/posix-configs/SITL/init/test/tests_all +++ b/posix-configs/SITL/init/test/tests_all @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/SITL/init/test/tests_template.in b/posix-configs/SITL/init/test/tests_template.in index 85faca98b2..f31b7d0937 100644 --- a/posix-configs/SITL/init/test/tests_template.in +++ b/posix-configs/SITL/init/test/tests_template.in @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/bbblue/px4.config b/posix-configs/bbblue/px4.config index 56cbcb9dc4..2221bac6ee 100644 --- a/posix-configs/bbblue/px4.config +++ b/posix-configs/bbblue/px4.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/bbblue/px4_fw.config b/posix-configs/bbblue/px4_fw.config index 4e9f710a51..51b876870c 100644 --- a/posix-configs/bbblue/px4_fw.config +++ b/posix-configs/bbblue/px4_fw.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/bebop/px4.config b/posix-configs/bebop/px4.config index 55e4340bc9..6c146b24ed 100644 --- a/posix-configs/bebop/px4.config +++ b/posix-configs/bebop/px4.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/eagle/200qx/mainapp.config b/posix-configs/eagle/200qx/mainapp.config index eca8d025ed..8698c10177 100644 --- a/posix-configs/eagle/200qx/mainapp.config +++ b/posix-configs/eagle/200qx/mainapp.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) diff --git a/posix-configs/eagle/210qc/mainapp.config b/posix-configs/eagle/210qc/mainapp.config index eca8d025ed..8698c10177 100644 --- a/posix-configs/eagle/210qc/mainapp.config +++ b/posix-configs/eagle/210qc/mainapp.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) diff --git a/posix-configs/eagle/flight/mainapp.config b/posix-configs/eagle/flight/mainapp.config index eca8d025ed..8698c10177 100644 --- a/posix-configs/eagle/flight/mainapp.config +++ b/posix-configs/eagle/flight/mainapp.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) diff --git a/posix-configs/eagle/init/rcS b/posix-configs/eagle/init/rcS index 8d8b122584..7bd3c972d3 100644 --- a/posix-configs/eagle/init/rcS +++ b/posix-configs/eagle/init/rcS @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) diff --git a/posix-configs/excelsior/mainapp.config b/posix-configs/excelsior/mainapp.config index 415bc5b420..20d4f9a31d 100644 --- a/posix-configs/excelsior/mainapp.config +++ b/posix-configs/excelsior/mainapp.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/ocpoc/px4.config b/posix-configs/ocpoc/px4.config index af40c1406b..a1e137ec6e 100644 --- a/posix-configs/ocpoc/px4.config +++ b/posix-configs/ocpoc/px4.config @@ -1,41 +1,41 @@ -#!/usr/bin/bash -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -source px4-alias.sh - -uorb start - -param select /root/rootfs/eeprom/parameters -if [ -f /root/rootfs/eeprom/parameters ] -then - param load -fi -param set SYS_AUTOSTART 4001 -param set MAV_BROADCAST 1 -param set MAV_TYPE 2 -param set MAV_SYS_ID 1 -param set SYS_MC_EST_GROUP 2 - -df_mpu9250_wrapper start_without_mag -R 10 -df_hmc5883_wrapper start -D /dev/i2c-4 -df_ms5611_wrapper start -rgbled start -b 1 -ocpoc_adc start -gps start -d /dev/ttyS3 -s -sensors start -commander start -navigator start -dataman start -ekf2 start -land_detector start multicopter -mc_pos_control start -mc_att_control start - -mavlink start -x -d /dev/ttyPS1 -mavlink stream -d /dev/ttyPS1 -s HIGHRES_IMU -r 50 -mavlink stream -d /dev/ttyPS1 -s ATTITUDE -r 50 - -linux_sbus start -d /dev/ttyS2 -c 10 -linux_pwm_out start -p ocpoc_mmap -m ROMFS/px4fmu_common/mixers/ocpoc_quad_x.main.mix -logger start -t -b 200 -mavlink boot_complete +#!/bin/sh +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + +uorb start + +param select /root/rootfs/eeprom/parameters +if [ -f /root/rootfs/eeprom/parameters ] +then + param load +fi +param set SYS_AUTOSTART 4001 +param set MAV_BROADCAST 1 +param set MAV_TYPE 2 +param set MAV_SYS_ID 1 +param set SYS_MC_EST_GROUP 2 + +df_mpu9250_wrapper start_without_mag -R 10 +df_hmc5883_wrapper start -D /dev/i2c-4 +df_ms5611_wrapper start +rgbled start -b 1 +ocpoc_adc start +gps start -d /dev/ttyS3 -s +sensors start +commander start +navigator start +dataman start +ekf2 start +land_detector start multicopter +mc_pos_control start +mc_att_control start + +mavlink start -x -d /dev/ttyPS1 +mavlink stream -d /dev/ttyPS1 -s HIGHRES_IMU -r 50 +mavlink stream -d /dev/ttyPS1 -s ATTITUDE -r 50 + +linux_sbus start -d /dev/ttyS2 -c 10 +linux_pwm_out start -p ocpoc_mmap -m ROMFS/px4fmu_common/mixers/ocpoc_quad_x.main.mix +logger start -t -b 200 +mavlink boot_complete diff --git a/posix-configs/rpi/px4.config b/posix-configs/rpi/px4.config index cdcfcf9494..1a641203a7 100644 --- a/posix-configs/rpi/px4.config +++ b/posix-configs/rpi/px4.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/rpi/px4_fw.config b/posix-configs/rpi/px4_fw.config index b759ee22f7..5dce1afc4a 100644 --- a/posix-configs/rpi/px4_fw.config +++ b/posix-configs/rpi/px4_fw.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/rpi/px4_hil.config b/posix-configs/rpi/px4_hil.config index 961a410c9c..6518dab5a1 100644 --- a/posix-configs/rpi/px4_hil.config +++ b/posix-configs/rpi/px4_hil.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/posix-configs/rpi/px4_no_shield.config b/posix-configs/rpi/px4_no_shield.config index 75649c3de1..9ea50cf3aa 100644 --- a/posix-configs/rpi/px4_no_shield.config +++ b/posix-configs/rpi/px4_no_shield.config @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) source px4-alias.sh diff --git a/src/modules/local_position_estimator/fault_table.py b/src/modules/local_position_estimator/fault_table.py index 8a9eccf84e..9c84074836 100644 --- a/src/modules/local_position_estimator/fault_table.py +++ b/src/modules/local_position_estimator/fault_table.py @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env python from __future__ import print_function import pylab as pl import scipy.optimize