#!/bin/sh -e
# Copy the compatibility symlinks until initramfs-tools will be converted
# to use the kmod program.

if [ "$1" = "prereqs" ]; then exit 0; fi

. /usr/share/initramfs-tools/hook-functions

copy_exec /bin/kmod
cp -a /sbin/modprobe /sbin/rmmod $DESTDIR/sbin/

mkdir -p $DESTDIR/lib/modprobe.d/
for file in /lib/modprobe.d/*; do
  if [ -f "$file" ]; then
     cp -pL $file $DESTDIR/lib/modprobe.d/
  fi
done
