summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2020-12-24 12:06:38 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-01-25 08:57:40 +0000
commit0ad5fbd48d0169576d6ed4666b909635b7cde89b (patch)
tree461417a934399902915ee8f69738cc6010f2c636 /util
parent2cee2ff256297b1c3de204c66f918b3991f96a40 (diff)
downloadcoreboot-0ad5fbd48d0169576d6ed4666b909635b7cde89b.tar.gz
coreboot-0ad5fbd48d0169576d6ed4666b909635b7cde89b.tar.bz2
coreboot-0ad5fbd48d0169576d6ed4666b909635b7cde89b.zip
util: Update all shebangs to use /usr/bin/env
Instead of hardcoding paths to the executables, use the version in the path. This allows the scripts to work on more systems, and allows the binary version to be changed more easily if needed. Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: Ifcc56aa21092cd3866eacb6a02d198110ec6051d Reviewed-on: https://review.coreboot.org/c/coreboot/+/48904 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/board_status/board_status.sh2
-rwxr-xr-xutil/board_status/getrevision.sh2
-rwxr-xr-xutil/chromeos/gen_test_hwid.sh2
-rwxr-xr-xutil/crossgcc/buildgcc2
-rwxr-xr-xutil/docker/coreboot.org-status/board-status.html/bucketize.sh2
-rwxr-xr-xutil/docker/coreboot.org-status/board-status.html/status-to-html.sh2
-rwxr-xr-xutil/docker/coreboot.org-status/board-status.html/tohtml.sh2
-rwxr-xr-xutil/docker/coreboot.org-status/run.sh2
-rwxr-xr-xutil/docker/doc.coreboot.org/ditaa.sh2
-rwxr-xr-xutil/docker/doc.coreboot.org/makeSphinx.sh2
-rwxr-xr-xutil/find_usbdebug/find_usbdebug.sh2
-rwxr-xr-xutil/genbuild_h/genbuild_h.sh2
-rwxr-xr-xutil/gitconfig/commit-msg2
-rwxr-xr-xutil/gitconfig/pre-commit2
-rwxr-xr-xutil/gitconfig/test/commit-message-hook.sh2
-rw-r--r--util/gitconfig/test/helpers.sh2
-rwxr-xr-xutil/gitconfig/test/timeout.sh2
-rwxr-xr-xutil/kconfig/check.sh2
-rwxr-xr-xutil/kconfig/lxdialog/check-lxdialog.sh2
-rwxr-xr-xutil/lint/lint2
-rwxr-xr-xutil/lint/lint-000-license-headers2
-rwxr-xr-xutil/lint/lint-001-no-global-config-in-romstage2
-rwxr-xr-xutil/lint/lint-007-checkpatch2
-rwxr-xr-xutil/lint/lint-008-kconfig2
-rwxr-xr-xutil/lint/lint-014-qualified-types2
-rwxr-xr-xutil/lint/lint-extended-007-checkpatch2
-rwxr-xr-xutil/lint/lint-extended-015-final-newlines2
-rwxr-xr-xutil/lint/lint-extended-020-signed-off-by2
-rwxr-xr-xutil/lint/lint-stable-000-license-headers2
-rwxr-xr-xutil/lint/lint-stable-003-whitespace2
-rwxr-xr-xutil/lint/lint-stable-004-style-labels2
-rwxr-xr-xutil/lint/lint-stable-005-board-status2
-rwxr-xr-xutil/lint/lint-stable-006-board-name2
-rwxr-xr-xutil/lint/lint-stable-008-kconfig2
-rwxr-xr-xutil/lint/lint-stable-009-old-licenses2
-rwxr-xr-xutil/lint/lint-stable-010-asm-syntax2
-rwxr-xr-xutil/lint/lint-stable-012-executable-bit2
-rwxr-xr-xutil/lint/lint-stable-013-site-local2
-rwxr-xr-xutil/lint/lint-stable-016-non-ascii2
-rwxr-xr-xutil/lint/lint-stable-017-configs2
-rwxr-xr-xutil/lint/lint-stable-018-symlinks2
-rwxr-xr-xutil/lint/lint-stable-019-header-files2
-rwxr-xr-xutil/lint/lint-stable-021-coreboot-lowercase2
-rwxr-xr-xutil/lint/lint-stable-022-clang-format2
-rwxr-xr-xutil/lint/lint-stable-023-filenames2
-rwxr-xr-xutil/lint/lint-stable-024-kconfig-no-subsystem2
-rw-r--r--util/lint/remccoms3.sed2
-rwxr-xr-xutil/msrtool/configure2
-rwxr-xr-xutil/release/gerrit_stats.pl2
-rwxr-xr-xutil/riscv/make-spike-elf.sh2
-rwxr-xr-xutil/scripts/cross-repo-cherrypick2
-rwxr-xr-xutil/scripts/decode_spd.sh2
-rwxr-xr-xutil/scripts/find-unused-kconfig-symbols.sh2
-rwxr-xr-xutil/scripts/no-fsf-addresses.sh2
54 files changed, 54 insertions, 54 deletions
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 31c3e7c483d4..8073ae444478 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
#
diff --git a/util/board_status/getrevision.sh b/util/board_status/getrevision.sh
index 20871f6beec3..ddbfde0e7677 100755
--- a/util/board_status/getrevision.sh
+++ b/util/board_status/getrevision.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# From the flashrom project but heavily modified since then.
diff --git a/util/chromeos/gen_test_hwid.sh b/util/chromeos/gen_test_hwid.sh
index f77564a971a3..163a12aa0cde 100755
--- a/util/chromeos/gen_test_hwid.sh
+++ b/util/chromeos/gen_test_hwid.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 5af3d5aadfd0..96256cdfb104 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# shellcheck disable=SC2030,SC2031,SC2059
# The above line must be directly after the shebang line.
# Disables these warnings:
diff --git a/util/docker/coreboot.org-status/board-status.html/bucketize.sh b/util/docker/coreboot.org-status/board-status.html/bucketize.sh
index cb643e73bcc0..fd3a94b3722b 100755
--- a/util/docker/coreboot.org-status/board-status.html/bucketize.sh
+++ b/util/docker/coreboot.org-status/board-status.html/bucketize.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# usage: $0 [weekly|monthly|quarterly] < filenames
# sorts files of the form VENDOR/BOARD/COMMIT/DATE/revision.txt
# into buckets of the given granularity
diff --git a/util/docker/coreboot.org-status/board-status.html/status-to-html.sh b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh
index 6630b30c1f47..2fb958c2d4a6 100755
--- a/util/docker/coreboot.org-status/board-status.html/status-to-html.sh
+++ b/util/docker/coreboot.org-status/board-status.html/status-to-html.sh
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/usr/bin/env sh
ls -d */*/*/*/ | `dirname $0`/bucketize.sh weekly | `dirname $0`/tohtml.sh
diff --git a/util/docker/coreboot.org-status/board-status.html/tohtml.sh b/util/docker/coreboot.org-status/board-status.html/tohtml.sh
index 98bbc9481e6a..0244b8e27200 100755
--- a/util/docker/coreboot.org-status/board-status.html/tohtml.sh
+++ b/util/docker/coreboot.org-status/board-status.html/tohtml.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
export COREBOOT_DIR="../coreboot.git"
export GIT_DIR="$COREBOOT_DIR/.git"
CODE_GITWEB="https://review.coreboot.org/gitweb/cgit/coreboot.git/commit/?id="
diff --git a/util/docker/coreboot.org-status/run.sh b/util/docker/coreboot.org-status/run.sh
index ba5ec9192938..84de3caa20a7 100755
--- a/util/docker/coreboot.org-status/run.sh
+++ b/util/docker/coreboot.org-status/run.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/docker/doc.coreboot.org/ditaa.sh b/util/docker/doc.coreboot.org/ditaa.sh
index 5f27f5349735..637379f3e7e3 100755
--- a/util/docker/doc.coreboot.org/ditaa.sh
+++ b/util/docker/doc.coreboot.org/ditaa.sh
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/usr/bin/env sh
exec java -jar /usr/lib/ditaa0_9.jar $*
diff --git a/util/docker/doc.coreboot.org/makeSphinx.sh b/util/docker/doc.coreboot.org/makeSphinx.sh
index 3b0c4e336fe6..96a593c7eda9 100755
--- a/util/docker/doc.coreboot.org/makeSphinx.sh
+++ b/util/docker/doc.coreboot.org/makeSphinx.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
if [ "$1" == "livehtml" ]; then
echo "Starting live documentation build"
diff --git a/util/find_usbdebug/find_usbdebug.sh b/util/find_usbdebug/find_usbdebug.sh
index ec81dd34dc8d..53b9a7f8f2c7 100755
--- a/util/find_usbdebug/find_usbdebug.sh
+++ b/util/find_usbdebug/find_usbdebug.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 3df3730ef2b2..b82a74b5132a 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
index f0c0b659e29e..99c8941be470 100755
--- a/util/gitconfig/commit-msg
+++ b/util/gitconfig/commit-msg
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
index 7b7ab4846cf0..8b571a72df7b 100755
--- a/util/gitconfig/pre-commit
+++ b/util/gitconfig/pre-commit
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
##
## SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/gitconfig/test/commit-message-hook.sh b/util/gitconfig/test/commit-message-hook.sh
index a99570f19845..f231f1425ef3 100755
--- a/util/gitconfig/test/commit-message-hook.sh
+++ b/util/gitconfig/test/commit-message-hook.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/util/gitconfig/test/helpers.sh b/util/gitconfig/test/helpers.sh
index 2e8b4070f92f..fbb844264b7a 100644
--- a/util/gitconfig/test/helpers.sh
+++ b/util/gitconfig/test/helpers.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/util/gitconfig/test/timeout.sh b/util/gitconfig/test/timeout.sh
index 989afcc2b497..2d600f4a779c 100755
--- a/util/gitconfig/test/timeout.sh
+++ b/util/gitconfig/test/timeout.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/util/kconfig/check.sh b/util/kconfig/check.sh
index 55b79ba1ba2a..2e0060fd4583 100755
--- a/util/kconfig/check.sh
+++ b/util/kconfig/check.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# Needed for systems without gettext
$* -x c -o /dev/null - > /dev/null 2>&1 << EOF
#include <libintl.h>
diff --git a/util/kconfig/lxdialog/check-lxdialog.sh b/util/kconfig/lxdialog/check-lxdialog.sh
index 78939da0b2ee..6833febc2ca7 100755
--- a/util/kconfig/lxdialog/check-lxdialog.sh
+++ b/util/kconfig/lxdialog/check-lxdialog.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# Check ncurses compatibility
# What library to link
diff --git a/util/lint/lint b/util/lint/lint
index a8c08d537042..6bf982d1afa0 100755
--- a/util/lint/lint
+++ b/util/lint/lint
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index c43151acfc5b..2f65321a6fe0 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-001-no-global-config-in-romstage b/util/lint/lint-001-no-global-config-in-romstage
index 1ed55e0ca7ab..e81bea7d3414 100755
--- a/util/lint/lint-001-no-global-config-in-romstage
+++ b/util/lint/lint-001-no-global-config-in-romstage
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-007-checkpatch b/util/lint/lint-007-checkpatch
index bc34e6bb4f7d..113d0ae9d129 100755
--- a/util/lint/lint-007-checkpatch
+++ b/util/lint/lint-007-checkpatch
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-008-kconfig b/util/lint/lint-008-kconfig
index 31aba55e921c..c24ff14069c9 100755
--- a/util/lint/lint-008-kconfig
+++ b/util/lint/lint-008-kconfig
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-014-qualified-types b/util/lint/lint-014-qualified-types
index 8da23b6d1fb4..48810cf3cd4b 100755
--- a/util/lint/lint-014-qualified-types
+++ b/util/lint/lint-014-qualified-types
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-extended-007-checkpatch b/util/lint/lint-extended-007-checkpatch
index e2b39de3e6ae..8ec11885b1d1 100755
--- a/util/lint/lint-extended-007-checkpatch
+++ b/util/lint/lint-extended-007-checkpatch
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-extended-015-final-newlines b/util/lint/lint-extended-015-final-newlines
index 74f1f03ecc46..3ab0fbfbc902 100755
--- a/util/lint/lint-extended-015-final-newlines
+++ b/util/lint/lint-extended-015-final-newlines
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-extended-020-signed-off-by b/util/lint/lint-extended-020-signed-off-by
index cc1b7acf8113..6d569aa80a7c 100755
--- a/util/lint/lint-extended-020-signed-off-by
+++ b/util/lint/lint-extended-020-signed-off-by
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check for a signed-off-by line on the latest git commit
diff --git a/util/lint/lint-stable-000-license-headers b/util/lint/lint-stable-000-license-headers
index 518b232f327a..ccecba6ce493 100755
--- a/util/lint/lint-stable-000-license-headers
+++ b/util/lint/lint-stable-000-license-headers
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-only
#
# DESCR: Check that files have license headers
diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace
index 430404383a68..fd4d0e4d12ef 100755
--- a/util/lint/lint-stable-003-whitespace
+++ b/util/lint/lint-stable-003-whitespace
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-004-style-labels b/util/lint/lint-stable-004-style-labels
index 36d2581974e6..393774fdaef6 100755
--- a/util/lint/lint-stable-004-style-labels
+++ b/util/lint/lint-stable-004-style-labels
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-005-board-status b/util/lint/lint-stable-005-board-status
index d87f8a41e942..617440bd1466 100755
--- a/util/lint/lint-stable-005-board-status
+++ b/util/lint/lint-stable-005-board-status
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that every board has a meaningful board_info.txt
diff --git a/util/lint/lint-stable-006-board-name b/util/lint/lint-stable-006-board-name
index 77d4e5670851..6f4e4b675123 100755
--- a/util/lint/lint-stable-006-board-name
+++ b/util/lint/lint-stable-006-board-name
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that every vendor and board has a Kconfig.name
diff --git a/util/lint/lint-stable-008-kconfig b/util/lint/lint-stable-008-kconfig
index 3b204fbd577b..3323971fac20 100755
--- a/util/lint/lint-stable-008-kconfig
+++ b/util/lint/lint-stable-008-kconfig
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-009-old-licenses b/util/lint/lint-stable-009-old-licenses
index d2aff3a83ae3..8226fdd64238 100755
--- a/util/lint/lint-stable-009-old-licenses
+++ b/util/lint/lint-stable-009-old-licenses
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-010-asm-syntax b/util/lint/lint-stable-010-asm-syntax
index 344068fcb353..474a05d4236b 100755
--- a/util/lint/lint-stable-010-asm-syntax
+++ b/util/lint/lint-stable-010-asm-syntax
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-012-executable-bit b/util/lint/lint-stable-012-executable-bit
index 5651a67d5438..640bb08870e0 100755
--- a/util/lint/lint-stable-012-executable-bit
+++ b/util/lint/lint-stable-012-executable-bit
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that source files are not executable
diff --git a/util/lint/lint-stable-013-site-local b/util/lint/lint-stable-013-site-local
index 4579cf94c522..53693f21d35c 100755
--- a/util/lint/lint-stable-013-site-local
+++ b/util/lint/lint-stable-013-site-local
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Verify that site-local is not in the coreboot repository
diff --git a/util/lint/lint-stable-016-non-ascii b/util/lint/lint-stable-016-non-ascii
index 4c97c37ba026..52b6679aa19c 100755
--- a/util/lint/lint-stable-016-non-ascii
+++ b/util/lint/lint-stable-016-non-ascii
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-017-configs b/util/lint/lint-stable-017-configs
index 4f298508cea2..311ef38cd0c6 100755
--- a/util/lint/lint-stable-017-configs
+++ b/util/lint/lint-stable-017-configs
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-018-symlinks b/util/lint/lint-stable-018-symlinks
index 8739a8b0190c..cd5c8440c1e9 100755
--- a/util/lint/lint-stable-018-symlinks
+++ b/util/lint/lint-stable-018-symlinks
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-019-header-files b/util/lint/lint-stable-019-header-files
index 11cb6b750c91..fc440d1b6955 100755
--- a/util/lint/lint-stable-019-header-files
+++ b/util/lint/lint-stable-019-header-files
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-021-coreboot-lowercase b/util/lint/lint-stable-021-coreboot-lowercase
index 45bc8199fdca..b13cb4487ed4 100755
--- a/util/lint/lint-stable-021-coreboot-lowercase
+++ b/util/lint/lint-stable-021-coreboot-lowercase
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-022-clang-format b/util/lint/lint-stable-022-clang-format
index 031fdb1f394c..9c94fbc06012 100755
--- a/util/lint/lint-stable-022-clang-format
+++ b/util/lint/lint-stable-022-clang-format
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-023-filenames b/util/lint/lint-stable-023-filenames
index a70f98895780..8b519a80dd35 100755
--- a/util/lint/lint-stable-023-filenames
+++ b/util/lint/lint-stable-023-filenames
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/lint/lint-stable-024-kconfig-no-subsystem b/util/lint/lint-stable-024-kconfig-no-subsystem
index 46dbc971f08a..9a532e8c5ef8 100755
--- a/util/lint/lint-stable-024-kconfig-no-subsystem
+++ b/util/lint/lint-stable-024-kconfig-no-subsystem
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# DESCR: Check that no board's Kconfig sets SUBSYSTEM_(VENDOR|DEVICE)_ID
diff --git a/util/lint/remccoms3.sed b/util/lint/remccoms3.sed
index 429d3bd4229b..fd700df80fb6 100644
--- a/util/lint/remccoms3.sed
+++ b/util/lint/remccoms3.sed
@@ -1,4 +1,4 @@
-#! /bin/sed -nf
+#!/usr/bin/env sed -nf
# Remove C and C++ comments, by Brian Hiles (brian_hiles@rocketmail.com)
diff --git a/util/msrtool/configure b/util/msrtool/configure
index cf78ad14102a..59d5c63639eb 100755
--- a/util/msrtool/configure
+++ b/util/msrtool/configure
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
#
# This program is free software; you can redistribute it and/or modify
diff --git a/util/release/gerrit_stats.pl b/util/release/gerrit_stats.pl
index 650042630724..94681579e191 100755
--- a/util/release/gerrit_stats.pl
+++ b/util/release/gerrit_stats.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/riscv/make-spike-elf.sh b/util/riscv/make-spike-elf.sh
index 834e8d2cb67b..135b62ad9772 100755
--- a/util/riscv/make-spike-elf.sh
+++ b/util/riscv/make-spike-elf.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# This script is based on:
# https://docs.google.com/document/d/1Pvf9Yxorcd3sbgs8WcomcTl3J4bmX6e1UE0ROCefR88
diff --git a/util/scripts/cross-repo-cherrypick b/util/scripts/cross-repo-cherrypick
index 35e4b335025c..c640e33f6542 100755
--- a/util/scripts/cross-repo-cherrypick
+++ b/util/scripts/cross-repo-cherrypick
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# cross-repo-cherrypick - rebase helper script
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/scripts/decode_spd.sh b/util/scripts/decode_spd.sh
index e515154ee7c9..252a4b7d324d 100755
--- a/util/scripts/decode_spd.sh
+++ b/util/scripts/decode_spd.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
#
# SPDX-License-Identifier: GPL-2.0-only
diff --git a/util/scripts/find-unused-kconfig-symbols.sh b/util/scripts/find-unused-kconfig-symbols.sh
index 3b84d25f57ee..48a89b96dfe0 100755
--- a/util/scripts/find-unused-kconfig-symbols.sh
+++ b/util/scripts/find-unused-kconfig-symbols.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
diff --git a/util/scripts/no-fsf-addresses.sh b/util/scripts/no-fsf-addresses.sh
index ef54fc1be84a..aceeeb831faf 100755
--- a/util/scripts/no-fsf-addresses.sh
+++ b/util/scripts/no-fsf-addresses.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
# SPDX-License-Identifier: ISC
filelist=$(git ls-files $* | \