From f7d41017127bb329b5d0ae90f7731443e681eff2 Mon Sep 17 00:00:00 2001
From: Andreas Gnau <andreas.gnau@iopsys.eu>
Date: Wed, 20 Mar 2024 13:04:38 +0100
Subject: [PATCH] brcmkernel: Fix issue where RUNPATH was not set

Fix issue where RUNPATH was not set for some libraries due to a too
strict condition. Add an additional comment to the code explaining why
we are filtering files by name to begin with.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
---
 bcmkernel/scripts/rstrip_and_set_rpath.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bcmkernel/scripts/rstrip_and_set_rpath.sh b/bcmkernel/scripts/rstrip_and_set_rpath.sh
index b0f1351..23aa29e 100755
--- a/bcmkernel/scripts/rstrip_and_set_rpath.sh
+++ b/bcmkernel/scripts/rstrip_and_set_rpath.sh
@@ -1,12 +1,14 @@
 #!/bin/sh -eux
 "$RSTRIP_SH" "$@"
 
+# we want to run it on all ELF files for the target, but not on other ELF files such as WiFi firmware.
+# by looking for executables bit for executables and for .so* for libraries we should catch everything
 find \
 	"$@" \
 	-type f \
 	-not -name 'ld-linux*.so*' \
 	'(' \
-		-name '*.so' \
+		-name '*.so*' \
 		-or \
 		-executable \
 	')' \
-- 
GitLab