#!/bin/sh

. config/options $1

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

mkdir -p $INSTALL/lib/modules/$VER/rtl8192se
  cp $PKG_BUILD/HAL/rtl8192/r8192se_pci.ko $INSTALL/lib/modules/$VER/rtl8192se

mkdir -p $INSTALL/lib/firmware/RTL8192SE
  cp $PKG_BUILD/firmware/RTL8192SE/* $INSTALL/lib/firmware/RTL8192SE

  for MOD in `find $INSTALL/lib/modules/$VER/rtl8192se -name *.ko`; do
    $STRIP --strip-debug $MOD
  done

  $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
