summaryrefslogtreecommitdiffstats
path: root/cmodprobe
Side-by-side diff
Diffstat (limited to 'cmodprobe') (more/less context) (ignore whitespace changes)
-rwxr-xr-xcmodprobe42
1 files changed, 42 insertions, 0 deletions
diff --git a/cmodprobe b/cmodprobe
new file mode 100755
index 0000000..4ff7864
--- a/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"
+
+
+
+
+if [[ $? != 0 ]];then
+ echo "Kernel module [email protected] 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