summaryrefslogtreecommitdiffstats
path: root/cmodprobe
diff options
context:
space:
mode:
authorRaghavendra D Prabhu <rprabhu@wnohang.net>2011-04-10 14:58:38 +0530
committerRaghavendra D Prabhu <rprabhu@wnohang.net>2011-04-10 14:58:38 +0530
commit9be7ca6fd73c99610bec6c2ec608e8f3ffd1fdd0 (patch)
tree723f9870d10e750ae6b14cbb0b409b4ac04a57ab /cmodprobe
parentd116dc185b304f35c357f6db2863532ed2a158d1 (diff)
downloadScripts-9be7ca6fd73c99610bec6c2ec608e8f3ffd1fdd0.tar.gz
Scripts-9be7ca6fd73c99610bec6c2ec608e8f3ffd1fdd0.tar.bz2
Scripts-9be7ca6fd73c99610bec6c2ec608e8f3ffd1fdd0.zip
Updated scripts/ tomit - mouse killer / cmodprobe - modprobe handler
Diffstat (limited to 'cmodprobe')
-rwxr-xr-xcmodprobe42
1 files changed, 42 insertions, 0 deletions
diff --git a/cmodprobe b/cmodprobe
new file mode 100755
index 0000000..4ff7864
--- /dev/null
+++ b/cmodprobe
@@ -0,0 +1,42 @@
+#!/bin/zsh
+exec &>>~/logs/cmod.log
+export HHOME="/home/raghavendra"
+modname=$1
+mprobe="/sbin/modprobe"
+
+typeset -A module_table
+module_table=(
+nvidia nvidia
+ip_set ipset
+xt_set ipset
+setx ipset
+vbox vboxdrv
+)
+
+prefix="$HHOME/Arch/Build/external"
+
+$mprobe "$@"
+
+
+
+if [[ $? != 0 ]];then
+ echo "Kernel module $@ is not there"
+ echo "Brewing $modname module......."
+ export PATH="/usr/bin/vendor_perl:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/perl5/vendor_perl/bin:/usr/bin/core_perl:/opt/plan9/bin"
+ # Optional
+ #unset CFLAGS CXXFLAGS LDFLAGS
+ #export EXTRA_LDFLAGS=" -s "
+ pushd $prefix || exit 1
+ for key in ${(k)module_table};do
+ if [[ $modname == *$key* ]];then
+ file=$module_table[$key]
+ if [[ -n $file ]];then
+ ./$file
+ /sbin/depmod
+ $mprobe $file
+ else
+ exit 1
+ fi
+ fi
+ done
+fi