summaryrefslogtreecommitdiffstats
path: root/cmodprobe
diff options
context:
space:
mode:
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 @@
1#!/bin/zsh
2exec &>>~/logs/cmod.log
3export HHOME="/home/raghavendra"
4modname=$1
5mprobe="/sbin/modprobe"
6
7typeset -A module_table
8module_table=(
9nvidia nvidia
10ip_set ipset
11xt_set ipset
12setx ipset
13vbox vboxdrv
14)
15
16prefix="$HHOME/Arch/Build/external"
17
18$mprobe "[email protected]"
19
20
21
22if [[ $? != 0 ]];then
23 echo "Kernel module [email protected] is not there"
24 echo "Brewing $modname module......."
25 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"
26 # Optional
27 #unset CFLAGS CXXFLAGS LDFLAGS
28 #export EXTRA_LDFLAGS=" -s "
29 pushd $prefix || exit 1
30 for key in ${(k)module_table};do
31 if [[ $modname == *$key* ]];then
32 file=$module_table[$key]
33 if [[ -n $file ]];then
34 ./$file
35 /sbin/depmod
36 $mprobe $file
37 else
38 exit 1
39 fi
40 fi
41 done
42fi