Commit 3ac5d88c authored by Lorenzo Pivetta's avatar Lorenzo Pivetta
Browse files

Initial import

parent 832d3615
#!/bin/bash
#
# phbpm - load/unload phbpm module
PATH="/runtime/bin:/sbin:/usr/bin:/bin"
MODULE_PATH=/runtime/lib/modules/`uname -r`
HOSTNAME=`hostname`
CONFFILE=/runtime/site/${HOSTNAME}/etc/phbpm.conf
MOD=phbpm
load() {
if [ "`lsmod | grep $MOD | wc -l`" -gt 0 ]; then
echo $MOD " driver module already installed"
else
echo -n "Loading $MOD driver module... "
#/sbin/insmod $MODULE_PATH/misc/$MOD.ko enable_mask=${MASK} eth=${ETH} buf=${BUFFER} buf_size=${SIZE} period=${PERIOD} pos_period=${POS_PERIOD}
#/sbin/insmod /root/rt_tcp.ko eth=3 period=10000
#sleep 1
#/sbin/insmod /root/$MOD.ko enable_mask=${MASK} eth=${ETH} buf=${BUFFER} buf_size=${SIZE} period=${PERIOD} pos_period=${POS_PERIOD}
#/sbin/insmod /root/phbpm_fill0/$MOD.ko enable_mask=${MASK} eth=${ETH} buf=${BUFFER} buf_size=${SIZE} period=${PERIOD} pos_period=${POS_PERIOD}
#/sbin/insmod /root/phbpm_udp/$MOD.ko enable_mask=${MASK} eth=${ETH} buf=${BUFFER} buf_size=${SIZE} period=${PERIOD} pos_period=${POS_PERIOD}
/sbin/insmod /root/phbpm_udp_ethtx/$MOD.ko enable_mask=${MASK} eth=${ETH} buf=${BUFFER} buf_size=${SIZE} period=${PERIOD} pos_period=${POS_PERIOD} serialized_tx=1
echo "OK"
sleep 1
/bin/chmod 666 /dev/phbpm*
fi
}
unload() {
echo -n "Unloading $MOD driver modules... "
/sbin/rmmod $MOD
#sleep 2
#/sbin/rmmod rt_tcp
echo "OK"
}
device_status() {
# check if driver loaded
if [ "`lsmod|grep $MOD|wc -l`" -gt 0 ]; then
echo "$MOD driver loaded"
else
echo "$MOD driver unloaded"
fi
}
#
# main body
#
if [ -f ${CONFFILE} ]; then
. ${CONFFILE}
else
echo "${CONFFILE} not found! Aborting!"
exit 0
fi
case "$1" in
start)
load
;;
stop)
unload
;;
status)
device_status
;;
restart)
unload
load
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
;;
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