123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/bin/bash
- SCRIPT=`readlink -f "${BASH_SOURCE[0]}"`
- DIR=`dirname $SCRIPT`
- MOD=graphene-ipc
- VER=0.0.1
- /sbin/lsmod | grep -q graphene_ipc
- if [ $? -eq 0 ]; then
- echo "$MOD already running"
- exit 0
- fi
- /usr/sbin/dkms status | grep -q $MOD
- if [ $? -eq 0 ]; then
- modprobe $MOD || exit $?
- echo "$MOD loaded"
- exit 0
- fi
- dkms add $DIR || exit $?
- dkms build -m $MOD -v $VER
- if [ $? -ne 0 ]; then
- err=$?
- rm -rf /usr/src/$MOD-$VER
- exit $err
- fi
- dkms install -m $MOD -v $VER
- if [ $? -ne 0 ]; then
- err=$?
- dkms remove $MOD/$VER --all
- rm -rf /usr/src/$MOD-$VER
- exit $err
- fi
- modprobe $MOD || exit $?
- echo "$MOD loaded"
|