OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [driver/] [pexdrv/] [insert] - Diff between revs 2 and 6

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 6
Line 2... Line 2...
 
 
#
#
# This script is loading modules in the kernel.
# This script is loading modules in the kernel.
#
#
 
 
kernel=`uname -r | grep 2.6`
status ()
 
{
 
   if [ $1 -eq 0 ] ; then
 
       echo "[SUCCESS]"
 
   else
 
       echo "[FAILED]"
 
 
 
       if [ $2 -eq 1 ] ; then
 
           echo "... loading aborted."
 
           exit 1
 
       fi
 
   fi
 
}
 
 
if [ ${kernel} = "" ]
echo
 
 
 
kernel=`uname -r | grep 2.4`
 
 
 
if [ $kernel ]
    then
    then
        module=ambpex.o
        module=pexdrv.o
        mname=${module%.o}
        mname=${module%.o}
    else
    else
        module=`find *.ko`
        module=`find *.ko`
        mname=${module%.ko}
        mname=${module%.ko}
fi
fi
module="pexdrv.ko"
 
 
 
if [ ${module} = "" ]
device=pexdrv
 
mode="666"
 
 
 
chmod 777 /dev/shm
 
 
 
if [ ${module} ]
    then
    then
        echo No kernel module found. ${module}
        echo -n " Find ${module} module      : "
 
        status $? 0
 
    else
 
        echo -n " Kernel module not found    : "
 
        status 1 0
        exit
        exit
 
fi
 
 
 
was_loaded=`/sbin/lsmod | cut -c 1-6 | grep $device`
 
 
 
if [ ${was_loaded} ]
 
    then
 
        echo -n " Remove loaded module       : "
 
        /sbin/rmmod $device
 
        status $? 0
    else
    else
        echo Find ${module} - kernel module.
        echo Loading module: ${module}
fi
fi
 
 
/sbin/insmod ./$module $* || exit 1
echo -n " Loading pexdrv module      : "
 
insmod ./${module}
 
 
sleep 1
until [ -e /dev/pexdrv0 ]
 
do
 
    sleep 1.5
 
done
 
 
devfiles=`ls /dev/* | grep AMB`
chmod 666 /dev/pexdrv*
 
 
#echo ${devfiles}
status $? 0
 
 
chmod -v 666 ${devfiles}
echo
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.