[问题]T60的Intel 3945网卡驱动安装问题

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
tomshi
帖子: 123
注册时间: 2006-12-25 21:15
送出感谢: 0
接收感谢: 0

[问题]T60的Intel 3945网卡驱动安装问题

#1

帖子 tomshi » 2008-03-10 9:59

给一台联想T60安装7.10系统,原本使用缺省的受限网卡驱动,连接无线网关,采用加密口令,一切都没问题。昨天突然发现在ubuntu下,无线网卡的指示灯疯狂闪烁,网卡能够扫描到无线网关,但是采用dchp方式无法建立连接,指定IP方式提示连接成功,但实际根本无法ping通网关。在网上查了一下,发现也有人遇到类似现象,并推荐安装intel3945的最新驱动。
我按照google上找到的这个安装指示,
http://ubuntuforums.org/showthread.php?t=140085

逐步操作,但到最后一步遇到问题:

代码: 全选

Now just download the driver and compile it with make

Then there is a load script with the driver that will run the daemon
Code:

sudo ./load

每次我运行load这个脚本时,马上系统就提示:

代码: 全选

zhanghong@T60:~/tmp/intel/ipw3945-1.2.2$ sudo ./load
./load: 5: Syntax error: "(" unexpected
我用 debug=0参数关闭调试,提示依旧。我对shell脚本完全不了解,请问这是否是不兼容的脚本?但是在这个帖子中,明显有很多人是执行成功的。请懂脚本程序的高手指点一下,我该怎么修改这个脚本?或者,是我什么地方操作错误?

脚本代码如下:

代码: 全选

#!/bin/sh
# Copyright (C) 2004-2005 Intel Corporation
MODULE=ipw3945

function check_root()
{
	[ `whoami` != "root" ] &&
		echo "You must be root to run this script." &&
		return 1
}

function unload()
{ 
	./unload -ipw3945d=${path} || return 1
}

function load_pre
{
    for i in firmware_class; do
	if ! (lsmod | grep -q $i) && \
	    ! (modprobe $i > /dev/null 2>&1 && LOADED="${LOADED}${i} ") && \
	    ! (grep -q request_firmware /proc/kallsyms); then
	    if [ ! -e /proc/kallsyms ]; then
		echo "Could not be determine if firmware_class is already loaded."
		echo "Attempting to load driver anyway..."
	    else
		echo "Firmware capabilities not found.  See INSTALL."
		return 1
	    fi
	fi
    done
}


function load_modules
{
    I_DEBUG=""
    
    for i in ieee80211; do
	modprobe ieee80211 ${I_DEBUG} && LOADED="${LOADED}${i} "
    done
    
    insmod ./${MODULE}.ko $@ && LOADED="${LOADED}${MODULE} "
}

function load()
{
	load_pre && load_modules $@ && {
		if [ -z "${LOADED}" ]; then
			echo "No modules loaded."
		else
			echo "Loaded: ${LOADED}"
		fi

		return 0
	} 

	echo "Load failed."

	return 1
}

function parse_args()
{
        driver_args=
        while [ "$1" ]; do
                case $1 in
                -ipw3945d=*)
                        path=$1
                        path=${path/*=//}
                        shift
                        ;;
		
		--)
			shift
			break
			;;

		*)
			driver_args="$driver_args $1"
			shift
			;;
		esac
	done

	daemon_args=$@
	path=${path/%\//}/
	
	[ -x ${path}ipw3945d ] || {
cat << EOD
${path}ipw3945d does not exist or is not an executable.

You can specify the path for the ipw3945d via the -ipw3945d parameter:

	% ./load -ipw3945d=~/bin

The above will attempt to locate ipw3945d in the ~/bin directory.
EOD
		return 1
	}

}

unset LOADED

path=/sbin

parse_args $@ &&
unload && 
load $driver_args && 
echo -n "Loading ipw3945d."
${path}ipw3945d $daemon_args && 
echo -n "." &&
sleep 1 &&
echo -n "." &&
sleep 1 &&
echo "done."
回复

回到 “网卡问题以及网络和拨号”