Patchwork populate_sdk: verify executable or dynamically linked library

login
register
mail settings
Submitter yanjun.zhu
Date Nov. 26, 2013, 8:38 a.m.
Message ID <1385455108-25311-1-git-send-email-yanjun.zhu@windriver.com>
Download mbox | patch
Permalink /patch/62363/
State New
Headers show

Comments

yanjun.zhu - Nov. 26, 2013, 8:38 a.m.
When toolchain directory is changed to execute mode, some non-executable
files or empty files are sorted. This will result in some errors. Thus when
sorting executable files or dynamically linked library, additional conditions
are to exclude non-executable files or empty files.
---
 meta/classes/populate_sdk_base.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index b7ea851..29890e3 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -253,7 +253,7 @@  if [ "$dl_path" = "" ] ; then
 	echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
 	exit 1
 fi
-executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111)
+executable_files=$($SUDO_EXEC find $native_sysroot -type f -perm /111 -exec file '{}' \;| grep "\(executable\|dynamically linked\)" | cut -f 1 -d ':') 
 
 tdir=`mktemp -d`
 if [ x$tdir = x ] ; then