summaryrefslogtreecommitdiffstats
path: root/debian/initramfs-tools/hooks/klibc-utils
blob: 3a3afca6bc71e04aa7b7e84a608730a13a44f0e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"