From 706d6e2671d854c89fa8578401a02954c6958b9c Mon Sep 17 00:00:00 2001 From: Jordan Mulcahey Date: Fri, 7 Jan 2022 02:29:58 -0800 Subject: [PATCH] Use /usr/bin/env in bash and python script shebangs --- bin/build-all.sh | 2 +- bin/dump-ram-users.sh | 2 ++ bin/gen-images.sh | 2 +- bin/genpartitions.py | 4 ++-- bin/install-bootloader.sh | 2 ++ bin/install-eink.sh | 2 ++ bin/mqtt-listen.sh | 1 + bin/mqtt-send-status.sh | 2 ++ bin/native-gdbserver.sh | 2 ++ bin/native-run.sh | 2 ++ bin/nrf52-console.sh | 4 ++-- bin/nrf52832-gdbserver.sh | 2 +- bin/nrf52833-gdbserver.sh | 2 +- bin/nrf52840-gdbserver.sh | 2 +- bin/program-1.0-tbeam.sh | 2 ++ bin/program-1.1-tbeam.sh | 2 ++ bin/program-release-heltec.sh | 1 + bin/program-release-tbeam.sh | 1 + bin/program-release-universal.sh | 1 + bin/promote-release.sh | 2 ++ bin/qspi-flash-test.sh | 2 ++ bin/read-system-info.sh | 2 ++ bin/regen-protos.sh | 4 ++-- bin/run-0-monitor.sh | 2 ++ bin/run-1-monitor.sh | 2 ++ bin/run-both-monitor.sh | 2 ++ bin/run-both.sh | 2 ++ bin/run-openocd.sh | 2 +- bin/start-terminal0.sh | 2 ++ bin/start-terminal1.sh | 2 ++ bin/test-simulator.sh | 2 ++ bin/upload-to-bootloader.sh | 2 ++ bin/upload-to-rak4631.sh | 2 ++ bin/upload-usb1.sh | 2 ++ bin/view-map.sh | 2 ++ 35 files changed, 60 insertions(+), 12 deletions(-) diff --git a/bin/build-all.sh b/bin/build-all.sh index 1cf83c62f..dec3bd2f6 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/bin/dump-ram-users.sh b/bin/dump-ram-users.sh index f0438834e..3cc3ce5dc 100755 --- a/bin/dump-ram-users.sh +++ b/bin/dump-ram-users.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + arm-none-eabi-readelf -s -e .pio/build/nrf52dk/firmware.elf | head -80 nm -CSr --size-sort .pio/build/nrf52dk/firmware.elf | grep '^200' diff --git a/bin/gen-images.sh b/bin/gen-images.sh index c4335718e..0c10fddb8 100755 --- a/bin/gen-images.sh +++ b/bin/gen-images.sh @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash set -e diff --git a/bin/genpartitions.py b/bin/genpartitions.py index 0edca5574..2e1a9f1de 100755 --- a/bin/genpartitions.py +++ b/bin/genpartitions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python2 # This is a layout for 4MB of flash # Name, Type, SubType, Offset, Size, Flags @@ -38,4 +38,4 @@ app0, app, ota_0, , 0x{app:x}, app1, app, ota_1, , 0x{app:x}, spiffs, data, spiffs, , 0x{spi:x} """.format(**locals()) -print(table) \ No newline at end of file +print(table) diff --git a/bin/install-bootloader.sh b/bin/install-bootloader.sh index eeb2071b9..4d2568f28 100755 --- a/bin/install-bootloader.sh +++ b/bin/install-bootloader.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # You probably don't want to use this script, it programs a custom bootloader build onto a nrf52 board set -e diff --git a/bin/install-eink.sh b/bin/install-eink.sh index b1c3d87cc..a0b5bab79 100755 --- a/bin/install-eink.sh +++ b/bin/install-eink.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # You probably don't want to use this script, it programs a custom bootloader build onto a nrf52 board set -e diff --git a/bin/mqtt-listen.sh b/bin/mqtt-listen.sh index 73ccb50a3..29c4e3956 100755 --- a/bin/mqtt-listen.sh +++ b/bin/mqtt-listen.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash mosquitto_sub -h mqtt.meshtastic.org -v -t \$SYS/\# -t msh/+/stat/\# -t msh/+/json/\# # mosquitto_sub -h test.mosquitto.org -v -t mesh/\# -F "%j" diff --git a/bin/mqtt-send-status.sh b/bin/mqtt-send-status.sh index 4df8a895e..042819752 100755 --- a/bin/mqtt-send-status.sh +++ b/bin/mqtt-send-status.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + mosquitto_pub -h mqtt.meshtastic.org -u meshdev -P large4cats -t msh/1/stat/FakeNode -m online -d diff --git a/bin/native-gdbserver.sh b/bin/native-gdbserver.sh index cbcbae4f9..f779d6670 100755 --- a/bin/native-gdbserver.sh +++ b/bin/native-gdbserver.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e pio run --environment native gdbserver --once localhost:2345 .pio/build/native/program "$@" diff --git a/bin/native-run.sh b/bin/native-run.sh index 64d44df52..6566fc591 100755 --- a/bin/native-run.sh +++ b/bin/native-run.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e pio run --environment native .pio/build/native/program "$@" diff --git a/bin/nrf52-console.sh b/bin/nrf52-console.sh index 55c586b8c..a25666e40 100755 --- a/bin/nrf52-console.sh +++ b/bin/nrf52-console.sh @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash # JLinkRTTViewer -JLinkRTTClient \ No newline at end of file +JLinkRTTClient diff --git a/bin/nrf52832-gdbserver.sh b/bin/nrf52832-gdbserver.sh index 122a43301..7ee12d8f5 100755 --- a/bin/nrf52832-gdbserver.sh +++ b/bin/nrf52832-gdbserver.sh @@ -1,3 +1,3 @@ - +#!/usr/bin/env bash JLinkGDBServerCLExe -if SWD -select USB -port 2331 -device NRF52832_XXAA diff --git a/bin/nrf52833-gdbserver.sh b/bin/nrf52833-gdbserver.sh index 03636e755..117b7d85e 100755 --- a/bin/nrf52833-gdbserver.sh +++ b/bin/nrf52833-gdbserver.sh @@ -1,3 +1,3 @@ - +#!/usr/bin/env bash JLinkGDBServerCLExe -if SWD -select USB -port 2331 -device NRF52833_XXAA diff --git a/bin/nrf52840-gdbserver.sh b/bin/nrf52840-gdbserver.sh index 010c1003f..7aaea2dfa 100755 --- a/bin/nrf52840-gdbserver.sh +++ b/bin/nrf52840-gdbserver.sh @@ -1,3 +1,3 @@ - +#!/usr/bin/env bash JLinkGDBServerCLExe -if SWD -select USB -port 2331 -device NRF52840_XXAA -SuppressInfoUpdateFW -DisableAutoUpdateFW -rtos GDBServer/RTOSPlugin_FreeRTOS diff --git a/bin/program-1.0-tbeam.sh b/bin/program-1.0-tbeam.sh index b2b37756b..a5e257970 100755 --- a/bin/program-1.0-tbeam.sh +++ b/bin/program-1.0-tbeam.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + esptool.py --baud 921600 write_flash 0x10000 release/archive/old/firmware-tbeam-EU865-1.0.0.bin echo "Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used" esptool.py --baud 921600 erase_region 0xe000 0x2000 diff --git a/bin/program-1.1-tbeam.sh b/bin/program-1.1-tbeam.sh index 98ba5c682..31d7ce2e8 100755 --- a/bin/program-1.1-tbeam.sh +++ b/bin/program-1.1-tbeam.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + esptool.py --baud 921600 write_flash 0x10000 release/archive/old/firmware-tbeam-1.1.50.bin diff --git a/bin/program-release-heltec.sh b/bin/program-release-heltec.sh index 90506473b..f88446b0d 100755 --- a/bin/program-release-heltec.sh +++ b/bin/program-release-heltec.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash set -e diff --git a/bin/program-release-tbeam.sh b/bin/program-release-tbeam.sh index 615ec66dc..08e0a4e8d 100755 --- a/bin/program-release-tbeam.sh +++ b/bin/program-release-tbeam.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash set -e diff --git a/bin/program-release-universal.sh b/bin/program-release-universal.sh index 554f55256..b2f3ae2ca 100755 --- a/bin/program-release-universal.sh +++ b/bin/program-release-universal.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash set -e diff --git a/bin/promote-release.sh b/bin/promote-release.sh index e79a06aaf..b9380b02b 100755 --- a/bin/promote-release.sh +++ b/bin/promote-release.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e echo "This script is only for developers who are publishing new builds on github. Most users don't need it" diff --git a/bin/qspi-flash-test.sh b/bin/qspi-flash-test.sh index 6c03635dd..542b96a78 100755 --- a/bin/qspi-flash-test.sh +++ b/bin/qspi-flash-test.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # You probably don't need this - it is a basic test of the serial flash on the TTGO eink board nrfjprog --qspiini nrf52/ttgo_eink_qpsi.ini --qspieraseall diff --git a/bin/read-system-info.sh b/bin/read-system-info.sh index d078d9ba4..f116087b2 100755 --- a/bin/read-system-info.sh +++ b/bin/read-system-info.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + esptool.py --baud 921600 read_flash 0x1000 0xf000 system-info.img diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index 2d96f2b7b..6cb6c2aaa 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e @@ -12,4 +12,4 @@ cd proto #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." -#bin/regen-docs.sh \ No newline at end of file +#bin/regen-docs.sh diff --git a/bin/run-0-monitor.sh b/bin/run-0-monitor.sh index 712a61981..1ad231667 100755 --- a/bin/run-0-monitor.sh +++ b/bin/run-0-monitor.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + pio run --upload-port /dev/ttyUSB0 -t upload -t monitor diff --git a/bin/run-1-monitor.sh b/bin/run-1-monitor.sh index a25d99489..38d43c58b 100755 --- a/bin/run-1-monitor.sh +++ b/bin/run-1-monitor.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + pio run --upload-port /dev/ttyUSB1 -t upload -t monitor diff --git a/bin/run-both-monitor.sh b/bin/run-both-monitor.sh index ae1b36fd9..6703ce982 100755 --- a/bin/run-both-monitor.sh +++ b/bin/run-both-monitor.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e echo uploading to usb1 diff --git a/bin/run-both.sh b/bin/run-both.sh index 1d8c8fdb2..2cb2e0bb0 100755 --- a/bin/run-both.sh +++ b/bin/run-both.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e TARG=tbeam diff --git a/bin/run-openocd.sh b/bin/run-openocd.sh index f7ec6e1fb..3afed0793 100755 --- a/bin/run-openocd.sh +++ b/bin/run-openocd.sh @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash # /home/kevinh/.platformio/packages/tool-openocd-esp32/bin/openocd -s /home/kevinh/.platformio/packages/tool-openocd-esp32 -c gdb_port pipe; tcl_port disabled; telnet_port disabled -s /home/kevinh/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f interface/jlink.cfg -f board/esp-wroom-32.cfg /home/kevinh/.platformio/packages/tool-openocd-esp32/bin/openocd -s /home/kevinh/.platformio/packages/tool-openocd-esp32 -s /home/kevinh/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f interface/jlink.cfg -f ./lora32-openocd.cfg diff --git a/bin/start-terminal0.sh b/bin/start-terminal0.sh index 3ad4e7822..3cb406928 100755 --- a/bin/start-terminal0.sh +++ b/bin/start-terminal0.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + pio device monitor -b 921600 diff --git a/bin/start-terminal1.sh b/bin/start-terminal1.sh index 3433501ea..ca59c8096 100755 --- a/bin/start-terminal1.sh +++ b/bin/start-terminal1.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + pio device monitor -p /dev/ttyUSB1 -b 921600 diff --git a/bin/test-simulator.sh b/bin/test-simulator.sh index 46158dc56..3c5f8f811 100755 --- a/bin/test-simulator.sh +++ b/bin/test-simulator.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e echo "Starting simulator" diff --git a/bin/upload-to-bootloader.sh b/bin/upload-to-bootloader.sh index 5ee008057..f48cc38bf 100755 --- a/bin/upload-to-bootloader.sh +++ b/bin/upload-to-bootloader.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e echo "building for t-echo" diff --git a/bin/upload-to-rak4631.sh b/bin/upload-to-rak4631.sh index 95ade3e37..185fa5597 100755 --- a/bin/upload-to-rak4631.sh +++ b/bin/upload-to-rak4631.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e echo "Converting to uf2 for NRF52 Adafruit bootloader" diff --git a/bin/upload-usb1.sh b/bin/upload-usb1.sh index b44b95c22..92cc051c8 100755 --- a/bin/upload-usb1.sh +++ b/bin/upload-usb1.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + pio run --upload-port /dev/ttyUSB1 -t upload diff --git a/bin/view-map.sh b/bin/view-map.sh index badeb0843..735dd7cd6 100755 --- a/bin/view-map.sh +++ b/bin/view-map.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + echo using amap tool to display memory map amap .pio/build/output.map