summaryrefslogtreecommitdiffstats
path: root/remote/tools/base
diff options
context:
space:
mode:
authorSimon Rettberg2013-02-25 18:07:40 +0100
committerSimon Rettberg2013-02-25 18:07:40 +0100
commit6115aa3769390404c3f03f29b4006fa2be212b66 (patch)
treed8857ef05ebc149d9e44c4688f3c751a78c77a59 /remote/tools/base
parentbinutil external binary functions (diff)
downloadtm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.tar.gz
tm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.tar.xz
tm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.zip
[tools] replace locate by find in base.build as it is faster, [setup_tools] treat scripts as binaries too but skip ldd part
Diffstat (limited to 'remote/tools/base')
-rw-r--r--remote/tools/base/base.build18
1 files changed, 8 insertions, 10 deletions
diff --git a/remote/tools/base/base.build b/remote/tools/base/base.build
index b9d96fd5..98f24047 100644
--- a/remote/tools/base/base.build
+++ b/remote/tools/base/base.build
@@ -8,11 +8,11 @@ fetch_source() {
build() {
- BUILDDIR=${TOOL_DIR}/${TOOL}/build
- mkdir -p ${BUILDDIR}
+ BUILDDIR="${TOOL_DIR}/${TOOL}/build"
+ mkdir -p "${BUILDDIR}"
FILELIST="list_binaries_and_files"
- [ -e ${FILELIST} ] && rm ${FILELIST}
+ [ -e "${FILELIST}" ] && rm "${FILELIST}"
for BIN in ${REQUIRED_BINARIES}
do
@@ -31,7 +31,7 @@ build() {
for LIB in ${REQUIRED_LIBRARIES}
do
- for LIB_LOCATION in $(locate ${LIB} | grep ^/lib/)
+ for LIB_LOCATION in $(find /lib/ -name "${LIB}.so\*")
do
echo ${LIB_LOCATION} >> "${FILELIST}"
done
@@ -51,9 +51,7 @@ build() {
local NUMFILES=$(cat "${FILELIST}" | wc -l)
if [ "x$NUMFILES" != "x" -a "x$NUMFILES" != "x0" ]; then
pinfo "File list generated at ${BUILDDIR}/${FILELIST} ($NUMFILES entries)"
- tar -cp $(cat "${FILELIST}") | tar -xp -C "${BUILDDIR}"
- local RET=$?
- [ $RET -ne 0 ] && perror "tar-copy from '$FILELIST' to '$BUILDDIR' failed."
+ tarcopy "${FILELIST}" "${BUILDDIR}"
fi
}
@@ -64,14 +62,14 @@ post_copy() {
# copy devices from running system
cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \
- "${INIT_DIR}"/dev
+ "${INIT_DIR}"/dev || perror "Copying devices from running system failed."
# set /etc/environment to include /openslx/bin and /openslx/sbin
echo "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/openslx/sbin:/openslx/bin\"" \
> "${INIT_DIR}/etc/environment"
# copy static files
- cp -r "${TOOL_DIR}/${TOOL}"/data/* "${INIT_DIR}"
+ cp -r "${TOOL_DIR}/${TOOL}"/data/* "${INIT_DIR}" || perror "Copying static files from data/* failed."
# better: dirname $(ldd $SHELL|grep libc | awk -F " " '{print $3}')
# copy pam modules, TODO: better way to find arch-dependant interfix...
@@ -92,7 +90,7 @@ post_copy() {
# setup root accoun
USER=root PASSWORD='!r00t' add_user
- [ ! -d ${INIT_DIR}/root ] && mkdir ${INIT_DIR}/root
+ mkdir -p ${INIT_DIR}/root
echo "minilinux-$(hostname)" > "${INIT_DIR}/etc/hostname"