Skip to contentSkip to conversation

tests reproducible_build.sh: Try first to find a vmlinux using pahole --running_kernel_vmlinux

PATCH In review Arnaldo Carvalho de Melo 2 participants 2 messages Oct 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests reproducible_build.sh: Try first to find a vmlinux using pahole --running_kernel_vmlinux

Otherwise it stops working when called directly.

---
 tests/reproducible_build.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
tests/reproducible_build.sh +2 -6
index a3603798a26de94c..19ef22708bbc969f 100755
@@ -4,16 +4,12 @@
 # Test if BTF generated serially matches reproducible parallel DWARF loading + serial BTF encoding
 # Arnaldo Carvalho de Melo <[email protected]> (C) 2024-
 
-vmlinux=${vmlinux:-1}
-
 if [ -z "$vmlinux" ] ; then
 	vmlinux=$(pahole --running_kernel_vmlinux)
-	if [ -z "$vmlinux" ] ; then
-		echo "Please specify a vmlinux file to operate on"
-		exit 2
-	fi
 fi
 
+vmlinux=${vmlinux:-1}
+
 if [ ! -f "$vmlinux" ] ; then
 	echo "$vmlinux file not available, please specify another"
 	exit 2
Signature · 1 line
2.46.2
#1 lore raw
Quoted 13 lines · Arnaldo Carvalho de Melo

Otherwise it stops working when called directly.

---
 tests/reproducible_build.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
tests/reproducible_build.sh +0 -0
index a3603798a26de94c..19ef22708bbc969f 100755

tests/reproducible_build.sh line 7

Quoted 4 lines
tests/reproducible_build.sh +0 -1
@@ -4,16 +4,12 @@
 # Test if BTF generated serially matches reproducible parallel DWARF loading + serial BTF encoding
 # Arnaldo Carvalho de Melo <[email protected]> (C) 2024-
 
-vmlinux=${vmlinux:-1}

sorry, my bad; this line should be

vmlinux=${vmlinux:-$1}

Quoted 14 lines
tests/reproducible_build.sh +2 -5
-
 if [ -z "$vmlinux" ] ; then
 	vmlinux=$(pahole --running_kernel_vmlinux)
-	if [ -z "$vmlinux" ] ; then
-		echo "Please specify a vmlinux file to operate on"
-		exit 2
-	fi
 fi
 
+vmlinux=${vmlinux:-1}
+
 if [ ! -f "$vmlinux" ] ; then
 	echo "$vmlinux file not available, please specify another"
 	exit 2