summaryrefslogtreecommitdiffstats
path: root/remote/setup_tools
diff options
context:
space:
mode:
authorJonathan Bauer2013-02-08 17:39:04 +0100
committerJonathan Bauer2013-02-08 17:39:04 +0100
commitd9e747a690f34401e1d545fa4c794310d105f510 (patch)
tree2bb6650c6403caf2b17a0d85a17febb4c041d633 /remote/setup_tools
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-d9e747a690f34401e1d545fa4c794310d105f510.tar.gz
tm-scripts-d9e747a690f34401e1d545fa4c794310d105f510.tar.xz
tm-scripts-d9e747a690f34401e1d545fa4c794310d105f510.zip
[setup_tools] cleaned up debug message, use -d for debug output or it will write to file.
Diffstat (limited to 'remote/setup_tools')
-rwxr-xr-xremote/setup_tools47
1 files changed, 36 insertions, 11 deletions
diff --git a/remote/setup_tools b/remote/setup_tools
index 091a63da..ef498960 100755
--- a/remote/setup_tools
+++ b/remote/setup_tools
@@ -44,6 +44,7 @@ copyfileswithdependencies ()
[ ! -d build ] && echo "No build directory for ${TOOL} found." && return
cd build
+ [ "x$DEBUG" != "x1" ] && echo "Logging to build_stage32.log" && exec 6>&1 > build_stage32.log
COPYFILES_LIST="list_wanted_stage3.2"
[ -e ${COPYFILES_LIST} ] && rm ${COPYFILES_LIST}
@@ -56,35 +57,46 @@ copyfileswithdependencies ()
echo "-----------------------------------------------------------------"
continue
fi
- echo "Found ${FILENAME} at ${FILE}. Searching libraries..."
+ echo "Found ${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
+ echo "ldd $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//=>/ })
- echo "--------------------------------------------------------"
- echo "Searching ${arrIN[0]} under $(pwd)..."
+ echo -e -n "\t${arrIN[0]}"
LOCAL_MATCHES=$(find . -name $(echo ${arrIN[0]}|awk -F "." '{print $1}').*)
if [ "x${LOCAL_MATCHES}" != "x" ];
then
for llib in ${LOCAL_MATCHES};
do
- echo "Copying ${llib}"
+ echo -ne " ->${llib}"
echo ${llib} >> ${COPYFILES_LIST}
done
+ echo ""
else
- echo "Did not found ${arrIN[0]} in $(pwd)"
if [ -e ${arrIN[1]} ];
then
- echo -n "Trying ${arrIN[1]} ..."
- echo " found! Copying."
echo ${arrIN[1]} >> ${COPYFILES_LIST}
- [ -L ${arrIN[1]} ] && echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST}
+
+ if [ ! -L ${arrIN[1]} ];
+ then
+ echo -e " -> ${arrIN[1]}"
+ else
+ echo -e " -> ${arrIN[1]} -> $(readlink -f ${arrIN[1]})"
+ echo $(readlink -f ${arrIN[1]}) >> ${COPYFILES_LIST}
+ fi
fi
fi
done
- echo "Copied ${FILENAME}."
echo "-----------------------------------------------------------------"
done
@@ -137,8 +149,12 @@ copyfileswithdependencies ()
echo ".${ENTRY}" >> ${COPYFILES_LIST}
done
+ # reset pipes
+ [ "x$DEBUG" != "x1" ] && exec 1>&6 6>&-
+
#copy to initramfsdir
- tar -cpv $(cat ${COPYFILES_LIST}|sort -u) | tar -xpv -C ${INIT_DIR} &>/dev/null
+ echo "[stage32] Completed file list generation at ${TOOL_DIR}/${TOOL}/build/${COPYFILES_LIST}."
+ (tar -cpv $(cat ${COPYFILES_LIST}|sort -u) | tar -xpv -C ${INIT_DIR}) &>/dev/null
unset REQUIRED_BINARIES
unset REQUIRED_LIBRARIES
unset REQUIRED_DIRECTORIES
@@ -150,6 +166,7 @@ get_basic_libs () {
[ ! -d ${INIT_DIR} ] && mkdir ${INIT_DIR}
# copy libc and ld-linux separatly
+ echo "----------------------------------------------------"
echo "Looking for libc and ld-linux used for ${SHELL}..."
BASICLIBS=""
for i in $(ldd ${SHELL})
@@ -160,7 +177,7 @@ get_basic_libs () {
BASICLIBS="${BASICLIBS} $i $(readlink -f "$i")"
fi
done
- tar -cpv ${BASICLIBS} | tar -xpv -C ${INIT_DIR} &>/dev/null
+ (tar -cpv ${BASICLIBS} | tar -xpv -C ${INIT_DIR}) &>/dev/null
echo "Basic libs copied."
}
@@ -183,6 +200,10 @@ generate_stage32 () {
TOOL=$1
if [ -d ${TOOL} ];
then
+ echo "###############################################################"
+ echo "# BUILDING $TOOL"
+ echo "###############################################################"
+
cd ${TOOL}
read_config
read_build
@@ -192,6 +213,10 @@ generate_stage32 () {
copyfileswithdependencies
post_copy
cd ${TOOL_DIR}
+
+ echo "###############################################################"
+ echo "# COMPLETED $TOOL"
+ echo "###############################################################"
else
echo "Tool directory not found."
fi