summaryrefslogtreecommitdiff
path: root/hooks/busybox
blob: 1a275b7da6f6b7d6a0bd4ffaaab64c5aaffdb483 (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
#!/bin/sh

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

# busybox
if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
	# those root need busybox
	eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')"
	if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then
		echo "W: Busybox is required for successful boot!"
	fi
else
	. /usr/share/initramfs-tools/hook-functions
	rm -f ${DESTDIR}/bin/sh
	rm -f ${DESTDIR}/bin/busybox
	copy_exec ${BUSYBOXDIR}/busybox /bin/busybox
	ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh
fi