summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2005-11-17 19:59:00 +0100
committermaximilian attems <maks@debian.org>2005-11-17 19:59:00 +0100
commitaa1e3cb6e0a9ab2d8a34676b719d278caea1bc17 (patch)
treef3b970e41f955f8371edddc38ab124d21f3b4d89 /hook-functions
parent32b031319c9696f35246b482c23d8d060cb5c6c8 (diff)
downloadinitramfs-tools-aa1e3cb6e0a9ab2d8a34676b719d278caea1bc17.tar.gz
initramfs-tools-aa1e3cb6e0a9ab2d8a34676b719d278caea1bc17.zip
revert usage of mklibs-copy - reduces python dep.
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions30
1 files changed, 30 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions
index d222d97..c715df5 100644
--- a/hook-functions
+++ b/hook-functions
@@ -51,6 +51,36 @@ manual_add_modules()
done
}
+# $1 is source
+# $2 is relative destination
+copy_exec() {
+ ln -s ${1} ${DESTDIR}/${2}
+
+ # Copy the dependant libraries
+ for x in $(ldd ${1} 2>/dev/null | sed -e '
+ /\//!d;
+ /linux-gate/d;
+ /=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};
+ s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' 2>/dev/null); do
+
+ # Try to use non-optimised libraries where possible.
+ # We assume that all HWCAP libraries will be in tls.
+ nonoptlib=$(echo ${x} | sed -e 's#/lib/tls.*/\(lib.*\)#/lib/\1#')
+
+ if [ -e ${nonoptlib} ]; then
+ x=${nonoptlib}
+ fi
+
+ libname=$(basename ${x})
+ dirname=$(dirname ${x})
+
+ mkdir -p ${DESTDIR}/${dirname}
+ if [ ! -e ${DESTDIR}/${dirname}/${libname} ]; then
+ ln -s ${x} ${DESTDIR}/${dirname}
+ fi
+ done
+}
+
# Copy entire subtrees to the initramfs
copy_modules_dir()
{