summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2013-02-27 17:15:49 +0100
committerJonathan Bauer2013-02-27 17:15:49 +0100
commit60c6a93345ed696ce975e36ceca4d3733717666a (patch)
tree50ca2e872b2cc2cbcecffc67e04e97108140c144
parentbinutil.inc fixed functionality, see comments (diff)
downloadtm-scripts-60c6a93345ed696ce975e36ceca4d3733717666a.tar.gz
tm-scripts-60c6a93345ed696ce975e36ceca4d3733717666a.tar.xz
tm-scripts-60c6a93345ed696ce975e36ceca4d3733717666a.zip
using binutils EVERYWHERE
-rwxr-xr-xdata/stage3.1/init1
-rwxr-xr-xremote/setup_tools103
-rw-r--r--remote/tools/base/base.build9
-rw-r--r--remote/tools/base/base.conf7
-rw-r--r--remote/tools/dbus/dbus.build2
5 files changed, 31 insertions, 91 deletions
diff --git a/data/stage3.1/init b/data/stage3.1/init
index f25ddc7b..d5df6995 100755
--- a/data/stage3.1/init
+++ b/data/stage3.1/init
@@ -38,7 +38,6 @@ mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt
mkdir -p /mnt/uniontmp /mnt/tmp
mount -n --move /dev/shm/uniontmp /mnt/uniontmp
-[ ! -d /lib ] && unlink /lib && mkdir /lib
mount --bind /mnt/lib /lib
#ln -sf /mnt/lib /
diff --git a/remote/setup_tools b/remote/setup_tools
index bf3f5157..0660e2ef 100755
--- a/remote/setup_tools
+++ b/remote/setup_tools
@@ -40,66 +40,32 @@ copyfileswithdependencies ()
cd build
- local COPYFILES_LIST="list_wanted_stage3.2"
+ COPYFILES_LIST="list_wanted_stage3.2"
[ -e ${COPYFILES_LIST} ] && rm ${COPYFILES_LIST}
[ ! -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 -E '^(.ELF|#!)' | 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
- local 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 "Processing lib ${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 -E '^(.ELF|#!)' | head -1)
+ if [ -z "$FILE" ]; then
+ pwarning "\tNo Binary found for ${FILENAME}. Skipping."
+ continue
fi
- done
- done
+
+ pdebug "\tFound ${FILENAME} at ${FILE}"
+ get_link_chain "${TOOL_DIR}/${TOOL}/build/${FILE}" "${TOOL_DIR}/${TOOL}/build" >> "${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}.so\*)
do
pdebug "* $LOCATION"
- echo ${LOCATION} >> ${COPYFILES_LIST}
+ get_link_chain "${TOOL_DIR}/${TOOL}/build/${LOCATION}" "${TOOL_DIR}/${TOOL}/build" >> "${COPYFILES_LIST}"
+ get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" "${LOCATION}" >> "${COPYFILES_LIST}"
done
done
@@ -112,37 +78,16 @@ copyfileswithdependencies ()
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
+ get_link_chain "${TOOL_DIR}/${TOOL}/build/${BIN}" "${TOOL_DIR}/${TOOL}/build" >> "${COPYFILES_LIST}"
+ get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" "${BIN}" >> "${COPYFILES_LIST}"
done
done
[ ! -z "${REQUIRED_FILES}" ] && pinfo "Gathering required files from config file..."
for ENTRY in ${REQUIRED_FILES}
do
- echo "./${ENTRY}" >> "${COPYFILES_LIST}"
+ get_link_chain "${TOOL_DIR}/${TOOL}/build/${ENTRY}" "${TOOL_DIR}/${TOOL}/build" >> "${COPYFILES_LIST}"
+ get_dynamic_dependencies -l "${TOOL_DIR}/${TOOL}/build" "${TOOL_DIR}/${TOOL}/build/.${ENTRY}" >> "${COPYFILES_LIST}"
done
@@ -151,7 +96,9 @@ copyfileswithdependencies ()
if [ -s "$COPYFILES_LIST" ]; then
local CLISTCOUNT=$(cat "$COPYFILES_LIST" | wc -l)
pinfo "Copying $CLISTCOUNT files to stage 3.2 target directory."
- tarcopy "$(cat ${COPYFILES_LIST}|sort -u)" "${INIT_DIR}"
+ tar -cp $(cat ${COPYFILES_LIST}|sort -u) | tar -xp -C "${INIT_DIR}"
+ local RET=$?
+ [ "x$RET" != "x0" ] && perror "Could not tar-copy to $INIT_DIR"
fi
unset REQUIRED_BINARIES
unset REQUIRED_LIBRARIES
@@ -174,7 +121,9 @@ get_basic_libs () {
BASICLIBS="${BASICLIBS} $i $(readlink -f "$i")"
fi
done
- tarcopy "${BASICLIBS}" "${INIT_DIR}"
+ tar -cp ${BASICLIBS} | tar -xp -C ${INIT_DIR}
+ local RET=$?
+ [ "x$RET" != "x0" ] && perror "Could not tar-copy to $INIT_DIR"
}
generate_stage32 () {
@@ -238,9 +187,8 @@ clean_tools() {
if [ "x$1" = "x" -o "x$1" = "xall" ]; then
#clean all
if [ -d ${INIT_DIR} ]; then
- pinfo "Cleaning ${INIT_DIR}..."
rm -rf "${INIT_DIR}" || perror "Error deleting $INIT_DIR"
- pinfo "done."
+ pinfo "Cleaned ${INIT_DIR}"
fi
for TOOL in $(ls ${TOOL_DIR}); do
clean_tool $TOOL
@@ -275,7 +223,4 @@ clean_tool() {
if [ -e ${TOOLDIR}/list_binaries_and_files ]; then
rm "${TOOLDIR}/list_binaries_and_files" || perror "Could not delete list_binaries_and_files"
fi
- pinfo "done."
}
-
-#generate_stage32 $@
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build
index 06ff22b7..efabaedd 100644
--- a/remote/tools/base/base.build
+++ b/remote/tools/base/base.build
@@ -20,10 +20,7 @@ build() {
if [ ! -z ${BIN_LOCATION} -a -e ${BIN_LOCATION} ];
then
pdebug "Processing $BIN at $BIN_LOCATION ..."
- echo ${BIN_LOCATION} >> "${FILELIST}"
- [ -L "${BIN_LOCATION}" ] \
- && pdebug "${BIN_LOCATION} is a symbolic link, copying $(readlink -f "${BIN_LOCATION}")" \
- && echo $(readlink -f "${BIN_LOCATION}") >> "${FILELIST}"
+ get_link_chain ${BIN_LOCATION} >> "${FILELIST}"
else
perror "${BIN} not found on the system! Please install it."
fi
@@ -31,9 +28,9 @@ build() {
for LIB in ${REQUIRED_LIBRARIES}
do
- for LIB_LOCATION in $(find /lib/ -name "${LIB}.so\*")
+ for LIB_LOCATION in $(find /lib/ -name "${LIB}.so*")
do
- echo ${LIB_LOCATION} >> "${FILELIST}"
+ get_link_chain "${LIB_LOCATION}" >> "${FILELIST}"
done
done
diff --git a/remote/tools/base/base.conf b/remote/tools/base/base.conf
index 85b638e6..6a95ab2c 100644
--- a/remote/tools/base/base.conf
+++ b/remote/tools/base/base.conf
@@ -9,7 +9,8 @@ REQUIRED_BINARIES=" bash
sulogin
mount
umount
- mount.nfs
+ mount.nfs4
+ umount.nfs4
mount.aufs
umount.aufs
rm
@@ -40,9 +41,7 @@ REQUIRED_LIBRARIES=" libcap
libau"
REQUIRED_DIRECTORIES=" /etc/pam.d
/etc/security"
-REQUIRED_FILES=" /sbin/mount.nfs4
- /sbin/umount.nfs4
- /etc/environment
+REQUIRED_FILES=" /etc/environment
/etc/pam.conf
/etc/issue
/etc/inputrc
diff --git a/remote/tools/dbus/dbus.build b/remote/tools/dbus/dbus.build
index 5254497f..331d49e4 100644
--- a/remote/tools/dbus/dbus.build
+++ b/remote/tools/dbus/dbus.build
@@ -21,7 +21,7 @@ build() {
# prepare target dir & copy there
[ ! -d ${BUILDDIR} ] && mkdir -p ${BUILDDIR}
- (tar -cpv $(cat ${COPYLIST}|sort -u) | tar -xpv -C ${BUILDDIR}) &> /dev/null
+ tar -cp $(cat ${COPYLIST}|sort -u) | tar -xp -C ${BUILDDIR}
}
post_copy() {