#!/bin/sh

MODULENAMENOEXT=rtai_smi
MODULENAME="${MODULENAMENOEXT}.ko"

MODULEDIR=`rtai-config --module-dir`
if test $? != 0 ; then
	echo "$CMDNAME: cannot find rtai-config (hint: make sure it's in the path; usual location: \$PREFIX/bin)"
	exit 1
fi

if test x"$MODULEDIR" = x ; then
	echo "$CMDNAME: rtai-config --module-dir: cannot find module dir"
	exit 1
fi

insmod "$MODULEDIR/$MODULENAME" disp_smi_count=1
rmmod -s "$MODULENAMENOEXT"

# FIXME: cleanup
dmesg | tail -@CONFIG_RTAI_CPUS@
