Commit 51bb8ff4 authored by Lorenzo Pivetta's avatar Lorenzo Pivetta
Browse files

Initial import

parent 89803b94
This diff is collapsed.
#!/bin/bash
#
# WARNING! WARNING! WARNING!
#
# Do **NOT** edit this file! Your changes will be overwritten!
PATH="/runtime/bin:/sbin:/usr/bin:/bin"
HOSTNAME=`hostname`
KERNREL=`uname -r`
MODULE_PATH=/runtime/lib/modules/${KERNREL}
CONFFILE=/runtime/site/${HOSTNAME}/etc/vme.conf
load() {
if [ `lsmod|grep $MOD1|wc -l` -gt 0 ]; then
echo "$MOD1 driver module already installed"
else
echo -n "Loading $MOD1 driver module... "
/sbin/insmod $MODULE_PATH/misc/${MOD1}${SUFFIX} m_vmewin=${M_VMEWIN} m_vmeaddr=${M_VMEADDR} m_pciaddr=${M_PCIADDR} m_size=${M_SIZE} m_am=${M_AM} m_dw=${M_DW}
echo "done"
echo -n "Loading $MOD2 driver module... "
/sbin/insmod $MODULE_PATH/misc/${MOD2}${SUFFIX}
echo "done"
fi
}
unload() {
echo "Unloading $MOD2 driver module"
/sbin/rmmod $MOD2
echo "Unloading $MOD1 driver module"
/sbin/rmmod $MOD1
}
device_status() {
if [ "`lsmod|grep $MOD1|wc -l`" -gt 0 ]; then
echo "$MOD1 driver is loaded"
else
echo "$MOD1 driver is unloaded"
fi
if [ "`lsmod|grep $MOD2|wc -l`" -gt 0 ]; then
echo "$MOD2 driver is loaded"
else
echo "$MOD2 driver is unloaded"
fi
}
#
# main body
#
if [ -f ${CONFFILE} ]; then
. ${CONFFILE}
else
echo "${CONFFILE} not found! Aborting!"
exit 0
fi
if [ $KERNREL == "2.4.25" -o $KERNREL == "2.4.25-rtai" ]; then
SUFFIX=".o"
else
SUFFIX=".ko"
fi
case "$1" in
start)
load
;;
stop)
unload
;;
status)
device_status
;;
restart)
unload
load
;;
load)
load
;;
unload)
unload
;;
*)
echo $"Usage: $0 {start|stop|restart|load|unload|status}"
;;
esac
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment