[coreboot-gerrit] Change in coreboot[master]: treewide: use /usr/bin/env where appropriate

Yegor Timoshenko (Code Review) gerrit at coreboot.org
Sun Oct 7 04:07:36 CEST 2018


Yegor Timoshenko has uploaded this change for review. ( https://review.coreboot.org/28953


Change subject: treewide: use /usr/bin/env where appropriate
......................................................................

treewide: use /usr/bin/env where appropriate

Some Unix systems (GuixSD, NixOS) do not install programs like
Bash and Python to /usr/bin, and /usr/bin/env has to be used to
locate these instead.

Change-Id: I7546bcb881c532adc984577ecb0ee2ec4f2efe00
Signed-off-by: Yegor Timoshenko <yegortimoshenko at riseup.net>
---
M util/acpi/acpidump-all
M util/amdtools/k8-compare-pci-space.pl
M util/amdtools/k8-interpret-extended-memory-settings.pl
M util/amdtools/k8-read-mem-settings.sh
M util/amdtools/parse-bkdg.pl
M util/board_status/set_up_live_image.sh
M util/broadcom/secimage/test/hmac.sh
M util/cavium/devicetree_convert.py
M util/cbfstool/Makefile
M util/cbmem/Makefile
M util/chromeos/crosfirmware.sh
M util/chromeos/extract_blobs.sh
M util/ectool/Makefile
M util/genprof/log2dress
M util/gitconfig/gitconfig.sh
M util/ifdtool/Makefile
M util/intelmetool/Makefile
M util/inteltool/Makefile
M util/ipqheader/createxbl.py
M util/ipqheader/mbn_tools.py
M util/k8resdump/Makefile
M util/kconfig/miniconfig
M util/lint/check_lint_tests
M util/lint/checkpatch_json.py
M util/lint/kconfig_lint
M util/me_cleaner/me_cleaner.py
M util/me_cleaner/setup.py
M util/mma/mma_automated_test.sh
M util/mma/mma_get_result.sh
M util/mma/mma_setup_test.sh
M util/nvramtool/Makefile
M util/pmh7tool/Makefile
M util/release/build-release
M util/release/genrelnotes
M util/riscv/sifive-gpt.py
M util/scripts/config
M util/scripts/dts-to-fmd.sh
M util/scripts/gerrit-rebase
M util/scripts/get_maintainer.pl
M util/scripts/parse-maintainers.pl
M util/scripts/prepare-commit-msg.clang-format
M util/scripts/ucode_h_to_bin.sh
M util/scripts/update_submodules
M util/superiotool/Makefile
M util/util_readme/util_readme.sh
M util/viatool/Makefile
46 files changed, 53 insertions(+), 46 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/28953/1

diff --git a/util/acpi/acpidump-all b/util/acpi/acpidump-all
index 2a04af0..f43b7ef 100755
--- a/util/acpi/acpidump-all
+++ b/util/acpi/acpidump-all
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Copyright (C) 2007-2010 by coresystems GmbH
 #
diff --git a/util/amdtools/k8-compare-pci-space.pl b/util/amdtools/k8-compare-pci-space.pl
index 77fdb59..505d5b4 100755
--- a/util/amdtools/k8-compare-pci-space.pl
+++ b/util/amdtools/k8-compare-pci-space.pl
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 use Getopt::Long;
 
 use strict;
+use warnings;
 
 my $NAME = $0;
 my $VERSION = '0.01';
diff --git a/util/amdtools/k8-interpret-extended-memory-settings.pl b/util/amdtools/k8-interpret-extended-memory-settings.pl
index 176defc..104e669 100755
--- a/util/amdtools/k8-interpret-extended-memory-settings.pl
+++ b/util/amdtools/k8-interpret-extended-memory-settings.pl
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 use Getopt::Long;
 
 use strict;
+use warnings;
 
 my $NAME = $0;
 my $VERSION = '0.01';
diff --git a/util/amdtools/k8-read-mem-settings.sh b/util/amdtools/k8-read-mem-settings.sh
index a0e6254..55b7071 100755
--- a/util/amdtools/k8-read-mem-settings.sh
+++ b/util/amdtools/k8-read-mem-settings.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This is an example that generates data files that are understood by the
 # k8-interpret-extended-memory-settings.pl script. Adjust the pci ids for your
diff --git a/util/amdtools/parse-bkdg.pl b/util/amdtools/parse-bkdg.pl
index d0bb4c7..31f3873 100755
--- a/util/amdtools/parse-bkdg.pl
+++ b/util/amdtools/parse-bkdg.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 my $NAME = $0;
 my $VERSION = '0.01';
@@ -11,6 +11,7 @@
 my $DEBUG = 0;
 
 use strict;
+use warnings;
 
 # Run the bkdg for k8 through pdftotext first (from the poppler package)
 
diff --git a/util/board_status/set_up_live_image.sh b/util/board_status/set_up_live_image.sh
index d80434e..9fac153 100755
--- a/util/board_status/set_up_live_image.sh
+++ b/util/board_status/set_up_live_image.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This script is used to set up a ubuntu-based live image to be used
 # with coreboot's board_status script.  It modifies the system so that
diff --git a/util/broadcom/secimage/test/hmac.sh b/util/broadcom/secimage/test/hmac.sh
index 21176bd..ded0eb7 100755
--- a/util/broadcom/secimage/test/hmac.sh
+++ b/util/broadcom/secimage/test/hmac.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ##
 ## This file is part of the coreboot project.
diff --git a/util/cavium/devicetree_convert.py b/util/cavium/devicetree_convert.py
index 70d89af..656fdf6 100644
--- a/util/cavium/devicetree_convert.py
+++ b/util/cavium/devicetree_convert.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # devicetree_convert Tool to convert a DTB to a static C file
 # Copyright (C) 2018 Facebook Inc.
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index ba8fdff..365641b 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -6,7 +6,7 @@
 HOSTCC ?= $(CC)
 PREFIX ?= /usr/local
 BINDIR ?= $(PREFIX)/bin
-INSTALL ?= /usr/bin/install
+INSTALL ?= /usr/bin/env install
 OBJCOPY ?= objcopy
 
 VBOOT_SOURCE ?= $(top)/3rdparty/vboot
diff --git a/util/cbmem/Makefile b/util/cbmem/Makefile
index 694cac7..664d575 100644
--- a/util/cbmem/Makefile
+++ b/util/cbmem/Makefile
@@ -16,7 +16,7 @@
 PROGRAM   = cbmem
 ROOT      = ../../src
 CC       ?= $(CROSS_COMPILE)gcc
-INSTALL  ?= /usr/bin/install
+INSTALL  ?= /usr/bin/env install
 PREFIX   ?= /usr/local
 CFLAGS   ?= -O2
 CFLAGS   += -Wall -Werror
diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh
index 9e00ba6..ba0c259 100755
--- a/util/chromeos/crosfirmware.sh
+++ b/util/chromeos/crosfirmware.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # This file is part of the coreboot project.
 #
diff --git a/util/chromeos/extract_blobs.sh b/util/chromeos/extract_blobs.sh
index af9d026..a674ada 100755
--- a/util/chromeos/extract_blobs.sh
+++ b/util/chromeos/extract_blobs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/usr/bin/env bash
 #
 # This file is part of the coreboot project.
 #
@@ -14,6 +14,8 @@
 # GNU General Public License for more details.
 #
 
+set -x
+
 IMAGE=$1
 
 if [ ! -r "$IMAGE" ]; then
diff --git a/util/ectool/Makefile b/util/ectool/Makefile
index 234e931..c4b94da 100644
--- a/util/ectool/Makefile
+++ b/util/ectool/Makefile
@@ -17,7 +17,7 @@
 CC = gcc
 CFLAGS = -O2 -Wall -W
 PROGRAM = ectool
-INSTALL = /usr/bin/install
+INSTALL = /usr/bin/env install
 PREFIX  = /usr/local
 OS_ARCH = $(shell uname)
 
diff --git a/util/genprof/log2dress b/util/genprof/log2dress
index 99d1f2f..a7ec4bf 100755
--- a/util/genprof/log2dress
+++ b/util/genprof/log2dress
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #Parse a log and get back the function names and line numbers
 #Provide a log file as first argument
 
diff --git a/util/gitconfig/gitconfig.sh b/util/gitconfig/gitconfig.sh
index 5d6fe36..4df93cf 100755
--- a/util/gitconfig/gitconfig.sh
+++ b/util/gitconfig/gitconfig.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ##
 ## This file is part of the coreboot project.
diff --git a/util/ifdtool/Makefile b/util/ifdtool/Makefile
index cf6d378..e1188b2 100644
--- a/util/ifdtool/Makefile
+++ b/util/ifdtool/Makefile
@@ -16,7 +16,7 @@
 PROGRAM = ifdtool
 
 CC      = gcc
-INSTALL = /usr/bin/install
+INSTALL = /usr/bin/env install
 PREFIX  = /usr/local
 CFLAGS  = -O2 -g -Wall -W -Werror -I../../src/commonlib/include
 LDFLAGS =
diff --git a/util/intelmetool/Makefile b/util/intelmetool/Makefile
index d8c056c..128c1fe 100644
--- a/util/intelmetool/Makefile
+++ b/util/intelmetool/Makefile
@@ -15,7 +15,7 @@
 PROGRAM = intelmetool
 
 CC      ?= gcc
-INSTALL ?= /usr/bin/install
+INSTALL ?= /usr/bin/env install
 PREFIX  ?= /usr/local
 CFLAGS  ?= -O0 -g -Wall -W -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function
 LDFLAGS += -lpci -lz
diff --git a/util/inteltool/Makefile b/util/inteltool/Makefile
index 96fd140..d88063b 100644
--- a/util/inteltool/Makefile
+++ b/util/inteltool/Makefile
@@ -20,7 +20,7 @@
 top ?= $(abspath ../..)
 
 CC      ?= gcc
-INSTALL ?= /usr/bin/install
+INSTALL ?= /usr/bin/env install
 PREFIX  ?= /usr/local
 CFLAGS  ?= -O2 -g -Wall -W
 LDFLAGS += -lpci -lz
diff --git a/util/ipqheader/createxbl.py b/util/ipqheader/createxbl.py
index b01e628..7f2d987 100755
--- a/util/ipqheader/createxbl.py
+++ b/util/ipqheader/createxbl.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #============================================================================
 #
 #/** @file createxbl.py
diff --git a/util/ipqheader/mbn_tools.py b/util/ipqheader/mbn_tools.py
index c4d26c1..8a17563 100755
--- a/util/ipqheader/mbn_tools.py
+++ b/util/ipqheader/mbn_tools.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #===============================================================================
 #
 # MBN TOOLS
diff --git a/util/k8resdump/Makefile b/util/k8resdump/Makefile
index e260351..a1d4dfa 100644
--- a/util/k8resdump/Makefile
+++ b/util/k8resdump/Makefile
@@ -16,7 +16,7 @@
 PROGRAM = k8resdump
 
 CC      = gcc
-INSTALL = /usr/bin/install
+INSTALL = /usr/bin/env install
 PREFIX  = /usr/local
 #CFLAGS  = -O2 -g -Wall -Werror
 CFLAGS  = -Os -Wall -Werror
diff --git a/util/kconfig/miniconfig b/util/kconfig/miniconfig
index 065a784..29a4035 100755
--- a/util/kconfig/miniconfig
+++ b/util/kconfig/miniconfig
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # miniconfig - utility to minimize your coreboot config files
 #
diff --git a/util/lint/check_lint_tests b/util/lint/check_lint_tests
index 741d245..5ba33c8 100755
--- a/util/lint/check_lint_tests
+++ b/util/lint/check_lint_tests
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # test to make sure the lint tests fail
 SPACE=' '
diff --git a/util/lint/checkpatch_json.py b/util/lint/checkpatch_json.py
index 44b2a8b..74ad96a 100755
--- a/util/lint/checkpatch_json.py
+++ b/util/lint/checkpatch_json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # Copyright (C) 2018 Intel Corporation.
 # written by Naresh G Solanki<naresh.solanki at intel.com> and
 #            Maulik V Vaghela <maulik.v.vaghela at intel.com>
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index 62997dd..eddd8de 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 #
 # This file is part of the coreboot project.
diff --git a/util/me_cleaner/me_cleaner.py b/util/me_cleaner/me_cleaner.py
index 03fbbcb..f592863 100755
--- a/util/me_cleaner/me_cleaner.py
+++ b/util/me_cleaner/me_cleaner.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 # me_cleaner - Tool for partial deblobbing of Intel ME/TXE firmware images
 # Copyright (C) 2016-2018 Nicola Corna <nicola at corna.info>
diff --git a/util/me_cleaner/setup.py b/util/me_cleaner/setup.py
index 92fd359..c831ef8 100755
--- a/util/me_cleaner/setup.py
+++ b/util/me_cleaner/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 from setuptools import setup
 
diff --git a/util/mma/mma_automated_test.sh b/util/mma/mma_automated_test.sh
index b43325b..1c324f3 100755
--- a/util/mma/mma_automated_test.sh
+++ b/util/mma/mma_automated_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # This file is part of the coreboot project.
diff --git a/util/mma/mma_get_result.sh b/util/mma/mma_get_result.sh
index cb30a80..f797e7f 100755
--- a/util/mma/mma_get_result.sh
+++ b/util/mma/mma_get_result.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # This file is part of the coreboot project.
diff --git a/util/mma/mma_setup_test.sh b/util/mma/mma_setup_test.sh
index ec7baf9..b2a0de9 100755
--- a/util/mma/mma_setup_test.sh
+++ b/util/mma/mma_setup_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # This file is part of the coreboot project.
diff --git a/util/nvramtool/Makefile b/util/nvramtool/Makefile
index 8da7c76..f5a4fd5 100644
--- a/util/nvramtool/Makefile
+++ b/util/nvramtool/Makefile
@@ -17,7 +17,7 @@
 PROGRAM = nvramtool
 
 CC      = gcc
-INSTALL = /usr/bin/install
+INSTALL = /usr/bin/env install
 PREFIX  = /usr/local
 CFLAGS  = -O2 -g -Wall -W -I. -DCMOS_HAL=1
 #CFLAGS  = -Os -Wall
diff --git a/util/pmh7tool/Makefile b/util/pmh7tool/Makefile
index 091fbc5..384d3d9 100644
--- a/util/pmh7tool/Makefile
+++ b/util/pmh7tool/Makefile
@@ -16,7 +16,7 @@
 CC = gcc
 CFLAGS = -O2 -Wall -W -Werror
 PROGRAM = pmh7tool
-INSTALL = /usr/bin/install
+INSTALL = /usr/bin/env install
 PREFIX	= /usr/local
 
 all: $(PROGRAM)
diff --git a/util/release/build-release b/util/release/build-release
index a3cec3e..e4330d4 100755
--- a/util/release/build-release
+++ b/util/release/build-release
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # ${VERSION_NAME}: new version name
 # ${COMMIT_ID}: commit id (if not master)
 # ${USERNAME}: username (if not default to https)
diff --git a/util/release/genrelnotes b/util/release/genrelnotes
index 3038eb3..42848a1 100755
--- a/util/release/genrelnotes
+++ b/util/release/genrelnotes
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # This file is part of the coreboot project.
 #
diff --git a/util/riscv/sifive-gpt.py b/util/riscv/sifive-gpt.py
index fd82997..7f522d9 100755
--- a/util/riscv/sifive-gpt.py
+++ b/util/riscv/sifive-gpt.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # This file is part of the coreboot project.
 #
 # Copyright (C) 2018 Jonathan Neuschäfer
diff --git a/util/scripts/config b/util/scripts/config
index e0e3982..ba11e35 100755
--- a/util/scripts/config
+++ b/util/scripts/config
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 # Manipulate options in a .config file from the command line
 
diff --git a/util/scripts/dts-to-fmd.sh b/util/scripts/dts-to-fmd.sh
index 00e718be..b468b35 100755
--- a/util/scripts/dts-to-fmd.sh
+++ b/util/scripts/dts-to-fmd.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Copyright 2015 Google Inc.
 #
diff --git a/util/scripts/gerrit-rebase b/util/scripts/gerrit-rebase
index c4f8a80..276142d 100755
--- a/util/scripts/gerrit-rebase
+++ b/util/scripts/gerrit-rebase
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Copyright 2016 Google Inc.
 #
diff --git a/util/scripts/get_maintainer.pl b/util/scripts/get_maintainer.pl
index 4f34a4e..c24a6d4 100755
--- a/util/scripts/get_maintainer.pl
+++ b/util/scripts/get_maintainer.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # (c) 2007, Joe Perches <joe at perches.com>
 #           created from checkpatch.pl
 #
@@ -11,6 +11,7 @@
 # Licensed under the terms of the GNU GPL License version 2
 
 use strict;
+use warnings;
 
 my $P = $0;
 my $V = '0.26';
diff --git a/util/scripts/parse-maintainers.pl b/util/scripts/parse-maintainers.pl
index a0fe343..c0fd88c 100755
--- a/util/scripts/parse-maintainers.pl
+++ b/util/scripts/parse-maintainers.pl
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 use strict;
+use warnings;
 
 my %map;
 
diff --git a/util/scripts/prepare-commit-msg.clang-format b/util/scripts/prepare-commit-msg.clang-format
index 7033f3c..a6b3d08 100755
--- a/util/scripts/prepare-commit-msg.clang-format
+++ b/util/scripts/prepare-commit-msg.clang-format
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 files=`git diff --cached --name-only | grep '\.[ch]$'`
 if [ -z "$files" ]; then
 	exit 0
diff --git a/util/scripts/ucode_h_to_bin.sh b/util/scripts/ucode_h_to_bin.sh
index 2d7f5fa..f08b053 100755
--- a/util/scripts/ucode_h_to_bin.sh
+++ b/util/scripts/ucode_h_to_bin.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # This file is part of the coreboot project.
 #
diff --git a/util/scripts/update_submodules b/util/scripts/update_submodules
index b555495..68d8a94 100755
--- a/util/scripts/update_submodules
+++ b/util/scripts/update_submodules
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This file is part of the coreboot project.
 #
diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile
index cedd631..3a0bcf0 100644
--- a/util/superiotool/Makefile
+++ b/util/superiotool/Makefile
@@ -17,7 +17,7 @@
 PROGRAM = superiotool
 
 CC      ?= gcc
-INSTALL ?= /usr/bin/install
+INSTALL ?= /usr/bin/env install
 PREFIX  ?= /usr/local
 
 # Set the superiotool version string to the output of 'git describe'.
diff --git a/util/util_readme/util_readme.sh b/util/util_readme/util_readme.sh
index 420ffae..cdd94dc 100755
--- a/util/util_readme/util_readme.sh
+++ b/util/util_readme/util_readme.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Creates `./util/README.md` and `./Documentation/Util.md` of description files
 # in `./util` subdirectories
diff --git a/util/viatool/Makefile b/util/viatool/Makefile
index 365497a..b2a6291 100644
--- a/util/viatool/Makefile
+++ b/util/viatool/Makefile
@@ -19,7 +19,7 @@
 PROGRAM = viatool
 
 CC      ?= gcc
-INSTALL ?= /usr/bin/install
+INSTALL ?= /usr/bin/env install
 PREFIX  ?= /usr/local
 CFLAGS  ?= -O2 -g -Wall -W -I$(CURDIR)
 LDFLAGS += -lpci -lz

-- 
To view, visit https://review.coreboot.org/28953
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7546bcb881c532adc984577ecb0ee2ec4f2efe00
Gerrit-Change-Number: 28953
Gerrit-PatchSet: 1
Gerrit-Owner: Yegor Timoshenko <yegortimoshenko at riseup.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181007/1cba93b2/attachment-0001.html>


More information about the coreboot-gerrit mailing list