Linuxのドライバーアンインストールについて教えてください

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
Rara

Linuxのドライバーアンインストールについて教えてください

#1

投稿記事 by Rara » 9年前

ダウンロードしたドライバーにmakefileの代わりにinstall.shが入っていました。
make install
としてインストールした場合は
make uninstall
でアンインストールするかと思いますが、
今回はシェルでのインストールだったので、
sh install.sh
として、シェルスクリプトでインストールしました。
このドライバーが不要になったのでアンインストールしたいです。

コード:

#!/bin/bash
# Auto install for 8192cu
# September, 1 2010 v1.0.0, willisTang
# 
# Add make_drv to select chip type
# Novembor, 21 2011 v1.1.0, Jeff Hung
################################################################################

echo "##################################################"
echo "Realtek Wi-Fi driver Auto installation script"
echo "Novembor, 21 2011 v1.1.0"
echo "##################################################"

################################################################################
#            Decompress the driver source tal ball
################################################################################
cd driver
Drvfoulder=`ls |grep .tar.gz`
echo "Decompress the driver source tar ball:"
echo "    "$Drvfoulder
tar zxvf $Drvfoulder

Drvfoulder=`ls |grep -iv '.tar.gz'`
echo "$Drvfoulder"
cd  $Drvfoulder

################################################################################
#            If makd_drv exixt, execute it to select chip type
################################################################################
if [ -e ./make_drv ]; then
    ./make_drv
fi

################################################################################
#                       make clean
################################################################################
echo "Authentication requested [root] for make clean:"
if [ "`uname -r |grep fc`" == " " ]; then
        sudo su -c "make clean"; Error=$?
else
        su -c "make clean"; Error=$?
fi

################################################################################
#            Compile the driver
################################################################################
echo "Authentication requested [root] for make driver:"
if [ "`uname -r |grep fc`" == " " ]; then
    sudo su -c make; Error=$?
else    
    su -c make; Error=$?
fi
################################################################################
#            Check whether or not the driver compilation is done
################################################################################
module=`ls |grep -i 'ko'`
echo "##################################################"
if [ "$Error" != 0 ];then
    echo "Compile make driver error: $Error"
    echo "Please check error Mesg"
    echo "##################################################"
    exit
else
    echo "Compile make driver ok!!"    
    echo "##################################################"
fi

if [ "`uname -r |grep fc`" == " " ]; then
    echo "Authentication requested [root] for remove driver:"
    sudo su -c "rmmod $module"
    echo "Authentication requested [root] for insert driver:"
    sudo su -c "insmod $module"
    echo "Authentication requested [root] for install driver:"
    sudo su -c "make install"
else
    echo "Authentication requested [root] for remove driver:"
    su -c "rmmod $module"
    echo "Authentication requested [root] for insert driver:"
    su -c "insmod $module"
    echo "Authentication requested [root] for install driver:"
    su -c "make install"
fi
echo "##################################################"
echo "The Setup Script is completed !"
echo "##################################################"
これがinstall.shなのですが、
最初にdriverディレクトリに移行し、そのディレクトリ内のtar.gzを解凍しています。
そのあとゴチャゴチャ続いてるのですが、
そのdriverディレクトリ内にmakefileを見つけました。
スクリプトにもmake installとありますし、このmakefileで
make uninstallしても大丈夫ですか?

“C言語何でも質問掲示板” へ戻る