summaryrefslogtreecommitdiffstats
path: root/debian/initramfs-tools
diff options
context:
space:
mode:
Diffstat (limited to 'debian/initramfs-tools')
-rwxr-xr-xdebian/initramfs-tools/hooks/klibc-utils37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/initramfs-tools/hooks/klibc-utils b/debian/initramfs-tools/hooks/klibc-utils
new file mode 100755
index 0000000..3a3afca
--- /dev/null
+++ b/debian/initramfs-tools/hooks/klibc-utils
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+prereqs()
+{
+ if [ "${BUSYBOX}" = "n" ] || [ -z "${BUSYBOXDIR}" ]; then
+ echo ''
+ else
+ # Ensure busybox installs all its commands before
+ # checking what we should provide
+ echo zz-busybox
+ fi
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+for src in /usr/lib/klibc/bin/*; do
+ command="$(basename "$src")"
+ case "$command" in
+ gzip | kinit | zcat)
+ # Don't install; these will not be needed
+ ;;
+ *)
+ # Don't install commands that already exist in /bin or /sbin
+ if ! [ -e "${DESTDIR}/sbin/$command" ] \
+ && ! [ -e "${DESTDIR}/bin/$command" ]; then
+ cp -pL "$src" "${DESTDIR}/bin"
+ fi
+ ;;
+ esac
+done
+cp -pL /usr/lib/klibc-*.so "${DESTDIR}/lib"