[49/50] strip: Do not try to strip QEMU

Message ID 20220222125135.1211290-50-michael.tremer@ipfire.org
State Accepted
Commit 1432531ac87a9807908c12bc9a9e64787fa9a284
Headers
Series [01/50] expat: Update to version 2.4.6 - Security/CVE fixes |

Commit Message

Michael Tremer Feb. 22, 2022, 12:51 p.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 lfs/strip    | 1 +
 make.sh      | 2 +-
 src/stripper | 4 +++-
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lfs/strip b/lfs/strip
index c577c954b..64f5c702f 100644
--- a/lfs/strip
+++ b/lfs/strip
@@ -58,6 +58,7 @@  else
 	# /usr/sbin/vdr.
 	$(DIR_SRC)/src/stripper / \
 		--exclude=$(TOOLS_DIR) \
+		--exclude=$(QEMU_TARGET_HELPER) \
 		--exclude=/tmp \
 		--exclude=/usr/src \
 		--exclude=/usr/lib/vdr \
diff --git a/make.sh b/make.sh
index 1fb14c9ea..b6d8153d2 100755
--- a/make.sh
+++ b/make.sh
@@ -781,7 +781,7 @@  fake_environ() {
 }
 
 qemu_environ() {
-	local env
+	local env="QEMU_TARGET_HELPER=${QEMU_TARGET_HELPER}"
 
 	# Don't add anything if qemu is not used.
 	if ! qemu_is_required; then
diff --git a/src/stripper b/src/stripper
index 498a8a30e..fadbc514b 100755
--- a/src/stripper
+++ b/src/stripper
@@ -11,7 +11,9 @@  while [ $# -gt 0 ]; do
 			strip="${1#*=}"
 			;;
 		--exclude=*)
-			excludes+=( "!" "-path" "${1#*=}/*" )
+			if [ -n "${1#*=}" ]; then
+				excludes+=( "!" "-path" "${1#*=}" "!" "-path" "${1#*=}/*" )
+			fi
 			;;
 		--ignore-errors)
 			break_on_error="0"