From 915ff5eb09ca853893d962da13f14d1e74931212 Mon Sep 17 00:00:00 2001 From: Andrei Radulescu Date: Sat, 31 Aug 2024 20:34:25 +0300 Subject: [PATCH] update bash scripts to #!/usr/bin/env bash (#268) * update bash shebang for better compatibility including macOS * re-build --- build_kernel.sh | 2 +- build_kernel_headers.sh | 2 +- build_system.sh | 2 +- flash_all.sh | 2 +- flash_kernel.sh | 2 +- flash_system.sh | 2 +- load_kernel.sh | 4 +++- load_kernel_headers.sh | 2 +- scripts/bootchart.sh | 2 +- scripts/check-space.sh | 3 ++- scripts/kernel_faddr2line.sh | 2 +- scripts/ota_push.sh | 3 ++- scripts/pull_ota.sh | 3 ++- scripts/setup-on-device.sh | 2 +- scripts/shell.sh | 2 +- tools/edl | 2 +- tools/extract_tools.sh | 3 ++- 17 files changed, 23 insertions(+), 17 deletions(-) diff --git a/build_kernel.sh b/build_kernel.sh index 7fcfbc1..453ea8b 100755 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e DEFCONFIG=tici_defconfig diff --git a/build_kernel_headers.sh b/build_kernel_headers.sh index 8320f4e..d94474f 100755 --- a/build_kernel_headers.sh +++ b/build_kernel_headers.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e DEFCONFIG=tici_defconfig diff --git a/build_system.sh b/build_system.sh index a899588..6cfe49f 100755 --- a/build_system.sh +++ b/build_system.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e UBUNTU_BASE_URL="http://cdimage.ubuntu.com/ubuntu-base/releases/24.04/release" diff --git a/flash_all.sh b/flash_all.sh index 59a4727..8fef907 100755 --- a/flash_all.sh +++ b/flash_all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/flash_kernel.sh b/flash_kernel.sh index a38a066..7d530c2 100755 --- a/flash_kernel.sh +++ b/flash_kernel.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/flash_system.sh b/flash_system.sh index d0e4d6d..d4c9ecb 100755 --- a/flash_system.sh +++ b/flash_system.sh @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/load_kernel.sh b/load_kernel.sh index b5693b7..55deb77 100755 --- a/load_kernel.sh +++ b/load_kernel.sh @@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e + cd "$(dirname "$0")" DEVICE=${DEVICE:-comma-ethernet} diff --git a/load_kernel_headers.sh b/load_kernel_headers.sh index f8b7ec6..cb1f1c4 100755 --- a/load_kernel_headers.sh +++ b/load_kernel_headers.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash scp output/linux-headers*.deb comma:/tmp/ ssh comma "sudo apt install -yq /tmp/linux-headers*.deb" diff --git a/scripts/bootchart.sh b/scripts/bootchart.sh index 9e969ad..100526b 100755 --- a/scripts/bootchart.sh +++ b/scripts/bootchart.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e ssh tici "systemd-analyze plot > /tmp/bootchart.svg" diff --git a/scripts/check-space.sh b/scripts/check-space.sh index d1956a7..e8f09d7 100755 --- a/scripts/check-space.sh +++ b/scripts/check-space.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # sudo apt install ncdu diff --git a/scripts/kernel_faddr2line.sh b/scripts/kernel_faddr2line.sh index 34ea14c..7300770 100755 --- a/scripts/kernel_faddr2line.sh +++ b/scripts/kernel_faddr2line.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"/.. TOOLS=$ROOT_DIR/tools diff --git a/scripts/ota_push.sh b/scripts/ota_push.sh index 1add886..913301f 100755 --- a/scripts/ota_push.sh +++ b/scripts/ota_push.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # Make sure we're in the correct directory DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/pull_ota.sh b/scripts/pull_ota.sh index aafc54b..90448a6 100755 --- a/scripts/pull_ota.sh +++ b/scripts/pull_ota.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # Make sure we're in the correct directory DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/setup-on-device.sh b/scripts/setup-on-device.sh index e5d1bd0..0ce1ebd 100755 --- a/scripts/setup-on-device.sh +++ b/scripts/setup-on-device.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/shell.sh b/scripts/shell.sh index fed9621..59b374e 100755 --- a/scripts/shell.sh +++ b/scripts/shell.sh @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash docker run -it --rm agnos-builder:latest /bin/bash diff --git a/tools/edl b/tools/edl index 0fd3cf1..40de9cb 100755 --- a/tools/edl +++ b/tools/edl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/tools/extract_tools.sh b/tools/extract_tools.sh index ba86f79..634727b 100755 --- a/tools/extract_tools.sh +++ b/tools/extract_tools.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e git lfs &> /dev/null || { echo "ERROR: git lfs not installed"