[PATCH dwarves 1/2] tests/reproducible_build: fix vmlinux finding logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In updating the logic that finds the path for vmlinux, it is useful
to support a few different options

1. command-line parameter specification
2. retrieval via pahole option
3. environment variable based retrieval

Options 2 and 3 are useful for the case where the script is run
via the tests script.  When adding support for 3 I incorrectly
specified

vmlinx=${vmlinux:-1}

...which should have been

vmlinux=${vmlinux:-$1}

i.e. assign var vmlinux to the env var vmlinux if set, and if that
is not set, use the first parameter for the vmlinux value.  If neither
are set we can then fall back to the pahole option.

Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
---
 tests/reproducible_build.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/reproducible_build.sh b/tests/reproducible_build.sh
index 19ef227..c595636 100755
--- a/tests/reproducible_build.sh
+++ b/tests/reproducible_build.sh
@@ -4,12 +4,12 @@
 # Test if BTF generated serially matches reproducible parallel DWARF loading + serial BTF encoding
 # Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> (C) 2024-
 
+vmlinux=${vmlinux:-$1}
+
 if [ -z "$vmlinux" ] ; then
 	vmlinux=$(pahole --running_kernel_vmlinux)
 fi
 
-vmlinux=${vmlinux:-1}
-
 if [ ! -f "$vmlinux" ] ; then
 	echo "$vmlinux file not available, please specify another"
 	exit 2
-- 
2.43.5





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux