diff --git a/Dockerfile b/Dockerfile index 956343d9c7..a75375f88c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,4 +33,4 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone & WORKDIR /mm RUN git config --global --add safe.directory /mm -ENTRYPOINT ["/bin/bash", "-c"] +ENTRYPOINT ["/usr/bin/env", "bash", "-c"] diff --git a/Makefile b/Makefile index 6c0787e77f..a153953d09 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ MAKEFLAGS += --no-builtin-rules # Ensure the build fails if a piped command fails -SHELL = /bin/bash +SHELL = /usr/bin/env bash .SHELLFLAGS = -o pipefail -c # OS Detection diff --git a/docs/BUILDING_DOCKER.md b/docs/BUILDING_DOCKER.md index 5fa7b48650..98eb9f1567 100644 --- a/docs/BUILDING_DOCKER.md +++ b/docs/BUILDING_DOCKER.md @@ -29,7 +29,7 @@ and look for `mm` under the "REPOSITORY" column. To start the container, you can mount your local filesystem into the Docker container and run an interactive bash session. ```bash -docker run -it --rm --mount type=bind,source="$(pwd)",destination=/mm mm /bin/bash +docker run -it --rm --mount type=bind,source="$(pwd)",destination=/mm mm "/usr/bin/env bash" ``` - The `-it` flags Keep STDIN open even if not attached to the container and allocates a pseudo-tty terminal. diff --git a/tools/asm-processor/compile-test.sh b/tools/asm-processor/compile-test.sh index 65516629e1..c6ded825d8 100755 --- a/tools/asm-processor/compile-test.sh +++ b/tools/asm-processor/compile-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o pipefail INPUT="$1" OUTPUT="${INPUT%.*}.o" diff --git a/tools/calc_bss.sh b/tools/calc_bss.sh index 18e9248277..25e9ff7f3e 100755 --- a/tools/calc_bss.sh +++ b/tools/calc_bss.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Given a list of header files, compute the bss index that results from # including them. (See prevent_bss_reordering.h for more information.) diff --git a/tools/check_format.sh b/tools/check_format.sh index e614db6654..61c70265bf 100755 --- a/tools/check_format.sh +++ b/tools/check_format.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash STATUSOLD=`git status --porcelain` ./tools/format.py -j diff --git a/tools/reloc_spec_check.sh b/tools/reloc_spec_check.sh index 434a49ec36..b0f18922b3 100755 --- a/tools/reloc_spec_check.sh +++ b/tools/reloc_spec_check.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script checks for overlay's relocs to be correctly used on the spec file depending on the overlay's NON_MATCHING/NON_EQUIVALENT # and minimize possible broken NON_MATCHING builds. diff --git a/tools/rename_sym.sh b/tools/rename_sym.sh index ea99769974..9604d6291d 100755 --- a/tools/rename_sym.sh +++ b/tools/rename_sym.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash shopt -s globstar diff --git a/tools/warnings_count/check_new_warnings.sh b/tools/warnings_count/check_new_warnings.sh index a76754e36d..71801601be 100755 --- a/tools/warnings_count/check_new_warnings.sh +++ b/tools/warnings_count/check_new_warnings.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # This script can be used when you want to test locally the amount of warnings produced by your changes before doing a PR. diff --git a/tools/warnings_count/compare_warnings.sh b/tools/warnings_count/compare_warnings.sh index 080649d82a..d477cd72d3 100755 --- a/tools/warnings_count/compare_warnings.sh +++ b/tools/warnings_count/compare_warnings.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Terminal colour codes # when $TERM is empty (non-interactive shell), then expand tput with '-T xterm-256color' diff --git a/tools/warnings_count/update_current_warnings.sh b/tools/warnings_count/update_current_warnings.sh index f481ab3684..36c2bb5c3b 100755 --- a/tools/warnings_count/update_current_warnings.sh +++ b/tools/warnings_count/update_current_warnings.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # This script should only be used when we need to modify the accepted amount of warnings.