Skip to content
Snippets Groups Projects
rstrip_and_set_rpath.sh 532 B
Newer Older
  • Learn to ignore specific revisions
  • #!/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
    
    	"$@" \
    	-type f \
    	-not -name 'ld-linux*.so*' \
    	'(' \
    
    		-or \
    		-executable \
    	')' \
    
    	-exec file {} \; | grep -E ':.*ELF' | awk -F ': ' '{print $1}' | \
    		xargs -rt -I {} "$PATCHELF" --no-default-lib --add-rpath '/${LIB}/broadcom:/usr/${LIB}/broadcom' '{}' || true