diff options
| author | Jonathan Bauer | 2013-02-25 17:39:16 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2013-02-25 17:39:16 +0100 |
| commit | 64b52244915f7a73403d54f5316bb2c3bd33239b (patch) | |
| tree | 4034cd78b7d6bd78205e9e044757f3e374da9368 /remote/setup_tools | |
| parent | Merge branch 'master' of ssh://openslx/openslx-ng/tm-scripts (diff) | |
| download | tm-scripts-64b52244915f7a73403d54f5316bb2c3bd33239b.tar.gz tm-scripts-64b52244915f7a73403d54f5316bb2c3bd33239b.tar.xz tm-scripts-64b52244915f7a73403d54f5316bb2c3bd33239b.zip | |
?
Diffstat (limited to 'remote/setup_tools')
| -rwxr-xr-x | remote/setup_tools | 116 |
1 files changed, 43 insertions, 73 deletions
diff --git a/remote/setup_tools b/remote/setup_tools index 76f163f5..116dc4b1 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -47,59 +47,24 @@ copyfileswithdependencies () [ ! -z "${REQUIRED_BINARIES}" ] && pinfo "Gathering required binaries from config file..." for FILENAME in ${REQUIRED_BINARIES} do - FILE=$(find . -name ${FILENAME} -type f -executable | xargs grep -l '^.ELF') # FIXME: What happens on multiple matches? Maybe add " | head -1" - if [ -z "$FILE" ]; then - pwarning "\tNo Binary found for ${FILENAME}. Skipping." - continue - fi - pdebug "\tFound ${FILENAME} at ${FILE}" - echo "${FILE}" >> "${COPYFILES_LIST}" - # fetch dependencies - # quick fix to exclude libc*, else it copies unneeded libs... - # workaround for - ldd ${FILE} &>/dev/null - ldd_exit_code=$? - if [ "x$ldd_exit_code" != "x0" ]; - then - pdebug "\tldd $FILE failed." - continue - fi - for i in $(ldd "${FILE}" | awk '{print $1 $2 $3}' | grep -v ld-linux | grep -v libc.so | grep -v linux-gate | grep -v linux-vdso) - do - arrIN=(${i//=>/ }) - pdebug "* ${arrIN[0]}" - LOCAL_MATCHES=$(find . -name "$(echo ${arrIN[0]} | awk -F '.' '{print $1}')".so\*) - if [ "x${LOCAL_MATCHES}" != "x" ]; - then - for llib in ${LOCAL_MATCHES}; - do - pdebug " at ${llib}" - echo ${llib} >> "${COPYFILES_LIST}" - done - else - if [ -e ${arrIN[1]} ]; - then - echo ${arrIN[1]} >> "${COPYFILES_LIST}" - - if [ ! -L ${arrIN[1]} ]; - then - pdebug " at ${arrIN[1]}" - else - pdebug " at ${arrIN[1]} -> $(readlink -f ${arrIN[1]})" - echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST} - fi - fi + FILE=$(find . -name ${FILENAME} -type f -executable | xargs grep -l '^.ELF'|head -1) # FIXME: What happens on multiple matches? Maybe add " | head -1" + if [ -z "$FILE" ]; then + pwarning "\tNo Binary found for ${FILENAME}. Skipping." + continue fi - done + pdebug "\tFound ${FILENAME} at ${FILE}" + echo "${FILE}" >> "${COPYFILES_LIST}" + get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" "$FILE" >> "${COPYFILES_LIST}" done [ ! -z "${REQUIRED_LIBRARIES}" ] && pinfo "Gathering required libraries from config file..." for LIB in ${REQUIRED_LIBRARIES} do - for LOCATION in $(find . -name ${LIB}*) + for LOCATION in $(find . -name ${LIB}) do pdebug "* $LOCATION" - echo ${LOCATION} >> ${COPYFILES_LIST} + echo "${LOCATION}" >> ${COPYFILES_LIST} + get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" ${LOCATION} >> ${COPYFILES_LIST} done done @@ -109,34 +74,39 @@ copyfileswithdependencies () do pdebug "* ./$ENTRY" echo "./${ENTRY}" >> "${COPYFILES_LIST}" - for BIN in $(find "./${ENTRY}" -type f -not -name '*.a' | xargs grep -l '^.ELF') - do - pdebug " Searching libs for ${BIN}..." - for i in $(ldd ${BIN} | awk '{print $1 $2 $3}' | grep -v ld-linux | grep -v libc.so | grep -v linux-gate | grep -v linux-vdso) - do - arrIN=(${i//=>/ }) - pdebug " Searching for ${arrIN[0]}...($i)" - local LOCAL_MATCHES=$(find . -name "$(echo ${arrIN[0]} | awk -F '.' '{print $1}')".so\*) - if [ "x${LOCAL_MATCHES}" != "x" ]; - then - for llib in ${LOCAL_MATCHES}; - do - pdebug " Found locally, copying ${llib}" - echo ${llib} >> "${COPYFILES_LIST}" - done - else - if [ ! -z ${arrIN[1]} ] && [ "x${arrIN[1]}" != "xnot" ]; - then - pdebug " Not found locally but in system, copying ${arrIN[1]}" - echo ${arrIN[1]} >> "${COPYFILES_LIST}" - [ -L ${arrIN[1]} ] && echo $(readlink -f "${arrIN[1]}") >> "${COPYFILES_LIST}" - else - pwarning "Lib '${arrIN[0]}' from required dir '$ENTRY' neither found in build directory nor on this system." - pwarning "If this lib is not supplied by another module, this module will probably fail in your final system" - fi - fi - done - done + get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" ${ENTRY} >> ${COPYFILES_LIST} + + + #as as \n + #echo "./${ENTRY}" >> "${COPYFILES_LIST}" + #for BIN in $(find "./${ENTRY}" -type f -not -name '*.a' | xargs grep -l '^.ELF') + #do + # pdebug " Searching libs for ${BIN}..." +# for i in $(ldd ${BIN} | awk '{print $1 $2 $3}' | grep -v ld-linux | grep -v libc.so | grep -v linux-gate | grep -v linux-vdso) +# do +# arrIN=(${i//=>/ }) +# pdebug " Searching for ${arrIN[0]}...($i)" +# local LOCAL_MATCHES=$(find . -name "$(echo ${arrIN[0]} | awk -F '.' '{print $1}')".so\*) +# if [ "x${LOCAL_MATCHES}" != "x" ]; +# then +# for llib in ${LOCAL_MATCHES}; +# do +# pdebug " Found locally, copying ${llib}" +# echo ${llib} >> "${COPYFILES_LIST}" +# done +# else +# if [ ! -z ${arrIN[1]} ] && [ "x${arrIN[1]}" != "xnot" ]; +# then +# pdebug " Not found locally but in system, copying ${arrIN[1]}" +# echo ${arrIN[1]} >> "${COPYFILES_LIST}" +# [ -L ${arrIN[1]} ] && echo $(readlink -f "${arrIN[1]}") >> "${COPYFILES_LIST}" +# else +# pwarning "Lib '${arrIN[0]}' from required dir '$ENTRY' neither found in build directory nor on this system." +# pwarning "If this lib is not supplied by another module, this module will probably fail in your final system" +# fi +# fi +# done +# done done [ ! -z "${REQUIRED_FILES}" ] && pinfo "Gathering required files from config file..." |
