#!/bin/sh

. config/options $1

VER=`ls $BUILD/linux*/modules/lib/modules`

mkdir -p $INSTALL/lib/firmware
  cp $PKG_BUILD/firmware/fwbin/*/*.bin $INSTALL/lib/firmware

mkdir -p $INSTALL/usr/lib
  cp -P $PKG_BUILD/linux_lib/libcrystalhd/*.so* $INSTALL/usr/lib

mkdir -p $INSTALL/lib/udev/rules.d
  cp $PKG_BUILD/driver/linux/*.rules $INSTALL/lib/udev/rules.d

mkdir -p $INSTALL/lib/modules/$VER/crystalhd
  cp $PKG_BUILD/driver/linux/crystalhd.ko $INSTALL/lib/modules/$VER/crystalhd

strip_kmod $INSTALL/lib/modules/$VER/crystalhd

$ROOT/$TOOLCHAIN/sbin/depmod -b $INSTALL $VER > /dev/null
for i in `ls $INSTALL/lib/modules/*/modules.* | grep -v modules.dep | grep -v modules.alias | grep -v modules.symbols`; do
  rm -f $i
done
