summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2013-03-11 12:39:35 +0100
committerJonathan Bauer2013-03-11 12:39:35 +0100
commit077b801cc4f6cd097d35870136642b62d3e284ab (patch)
tree1fd9bd2c963b545a269af520605ac134bdf6254a
parentbinutil.inc: old test removed (diff)
downloadtm-scripts-077b801cc4f6cd097d35870136642b62d3e284ab.tar.gz
tm-scripts-077b801cc4f6cd097d35870136642b62d3e284ab.tar.xz
tm-scripts-077b801cc4f6cd097d35870136642b62d3e284ab.zip
new function to list libc and ld-linux path, updated in setup_tools
-rw-r--r--helper/binutil.inc6
-rwxr-xr-xremote/setup_tools22
2 files changed, 4 insertions, 24 deletions
diff --git a/helper/binutil.inc b/helper/binutil.inc
index f65bd386..dcf19cd8 100644
--- a/helper/binutil.inc
+++ b/helper/binutil.inc
@@ -45,12 +45,12 @@ get_dynamic_dependencies() {
local liblink=(${LIB//=>/ })
lib_search
done
- rm $LDD_OUT
else
# Case 2: not a dynamic
pdebug "$BINARY not a dynamic, skipping."
continue
fi
+ rm -f $LDD_OUT
done
}
@@ -66,7 +66,7 @@ lib_search(){
for llib in ${LOCAL_MATCHES}; do
pdebug "\t\tFound locally, copying ${LOCALSEARCHDIR}/${llib}"
get_link_chain "${LOCALSEARCHDIR}"/"${llib}" "${LOCALSEARCHDIR}"
-
+ get_dynamic_dependencies -l "${LOCALSEARCHDIR}" "${llib}"
done
# found the libs, we are done
return
@@ -159,7 +159,7 @@ get_link_chain() {
}
# Function to get libc and ld-linux
-get_basic_libs() {
+list_basic_libs() {
for i in $(ldd ${SHELL})
do
[ $(echo $i | grep '^/' | grep -c ld) -eq 1 -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ] && get_link_chain $i
diff --git a/remote/setup_tools b/remote/setup_tools
index 4ddd0ef0..fdc2da40 100755
--- a/remote/setup_tools
+++ b/remote/setup_tools
@@ -132,31 +132,11 @@ copyfileswithdependencies ()
fi
}
-get_basic_libs () {
-
- [ ! -d ${INIT_DIR} ] && mkdir ${INIT_DIR}
-
- # copy libc and ld-linux separatly
- pinfo "Adding basic libs"
- BASICLIBS=""
- for i in $(ldd ${SHELL})
- do
- if [ $(echo $i | grep '^/' | grep -c ld) -eq 1 -o $(echo $i | grep '^/' | grep -c libc.so) -eq 1 ];
- then
- pdebug "Adding $i"
- BASICLIBS="${BASICLIBS} $i $(readlink -f "$i")"
- fi
- done
- tar -cp ${BASICLIBS} | tar -xp -C ${INIT_DIR}
- local RET=$?
- [ "x$RET" != "x0" ] && perror "Could not tar-copy to $INIT_DIR"
-}
-
generate_stage32 () {
initial_checks
- get_basic_libs
+ tarcopy "$(list_basic_libs)" "${INIT_DIR}"
# if no arguments assume all.
if [ "x$1" = "x" -o "x$1" = "xall" ]; then