From d37fc4dad7a16c5459f273a99d65ff820414c242 Mon Sep 17 00:00:00 2001
From: Chris Burr <christopher.burr@cern.ch>
Date: Mon, 28 Feb 2022 14:55:22 +0100
Subject: [PATCH] Make endian detection in work on non-RHEL distributions

---
 tests/toolbox.inc.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/toolbox.inc.sh b/tests/toolbox.inc.sh
index e7b9635..83dea62 100644
--- a/tests/toolbox.inc.sh
+++ b/tests/toolbox.inc.sh
@@ -12,11 +12,10 @@
 
 echo === $OUTPUTFILE ===
 
-endian=`file -L /proc/$$/exe`
-if expr "$endian" : '.* MSB \+\(executable\|shared object\).*' >&/dev/null
+if lscpu | grep 'Big Endian' >&/dev/null
 then
     endian=BE
-elif expr "$endian" : '.* LSB \+\(executable\|shared object\).*' >&/dev/null
+elif lscpu | grep 'Little Endian' >&/dev/null
 then
     endian=LE
 else
-- 
2.28.0

