void-packages/srcpkgs/initramfs-tools/files/hooks/busybox

36 lines
645 B
Plaintext
Raw Normal View History

#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
# Busybox
. /etc/initramfs-tools/initramfs.conf
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 "Warning: 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
exit 0