LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 08-29-2005, 03:45 PM   #1
c_mcgeecc
LQ Newbie
 
Registered: Aug 2005
Location: Michigan
Posts: 8

Rep: Reputation: 0
Problem loading ndiswrapper module on start up.


I'm trying to get my wireless card to activate at start up without having to manually start it myself by typing (code) modprobe ndiswrapper (next line) dhclient wlan0 (end code) as root. Alias wlan0 ndiswrapper is in my /etc/modprobe.conf but it isn't loading on aboot. Can someone help me with these please?
 
Old 08-29-2005, 04:42 PM   #2
kz26
Member
 
Registered: Aug 2005
Location: USA
Distribution: Fedora, Ubuntu, Backtrack
Posts: 70

Rep: Reputation: 15
1. Do /sbin/depmod -a
2. Do /sbin/modprobe ndiswrapper
3. You should be good to go.
 
Old 08-29-2005, 06:14 PM   #3
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
Which distribution? There is different ways in different linux distributions.
 
Old 08-30-2005, 12:21 AM   #4
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Rep: Reputation: 15
answer to initial post; but similar problem of my own

the way i get ndiswrapper to load at boot is to put the entry ndiswrapper in my modules file in /etc/

to be clear, in /etc/modules there is a line that has the word ndiswrapper on it

so my /etc/modules file looks something like this:

# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.

sr_mod
ide-floppy
ide-cd
ide-scsi
ohci1394
agpgart
apm
isa-pnp
libranet-sound-0
libranet-ethernet-0
ndiswrapper

as you can read, these are the modules that get loaded at boot time.
hope this helps!

************************************************************

but here is my problem. so i do all this and ndiswrapper loads at boot. i can do a lsmod after booting up and i seen ndiswrapper loaded. but when i stick in my card, i get the dreaded "Windows driver couldn't initialize device" in a dmesg. but then i rmmod ndiswrapper, take out the card, stick the card back in, then modprobe ndiswrapper and then it works just fine. but if i have to always do this, then this is no better than just loading it manually after boot up !!

what gives here? anyone have a clue?

thanks.
 
Old 08-30-2005, 12:40 PM   #5
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
You might want hotplug to install ndsiwrapper when you insert your card. So you remove ndiswrapper from /etc/modules and check how to make hotplug "insmod ndsiwrapper" when you insert your card.

Look in /sys/bus/ or something like that. This is where hotplug looks for information. Then you should be able to tell hotplug by putting a file in /etc/hotplugd/ (depending your installation and distribution). In that file you tell hotplug what to du with your hardware when you plug it in. (But this should realy be a program lissening an DBUS for HAL information about your device. But not for you or me to do )

You could use Hal Device Manager to have a look on which bus and what id numbers (or names) your card have instead of looking in /sys/....

Google for your distribution and hotplug. This should give you some information.

This is when you have a card that isn't on or inserted all the time.
 
Old 08-30-2005, 11:22 PM   #6
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Rep: Reputation: 15
get hotplug to load ndiswrapper upon card insertion

thanks for the reply.

indeed, after much fooling around, i determined what jaxan wrote- that the better way to solve the problem was to remove ndiswrapper from my /etc/modules file and to get hotplug to load ndiswrapper upon detecting that i had inserted my card. the question was, how to get hotplug to recognize the card upon insertion?

using google, i found one post (in the UK!) about my exact same dilemma. it all boiled down to, how do you get the kernel to put an entry for your card/ndiswrapper combo into the /lib/modules/<kernel version>/modules.pcimap file? if you manually put an entry in, everything works great. but after rebooting, this file gets rewritten and that manual addition is no longer there.

this is a very odd problem b/c i don't think the solution is anything you can do under normal circumstances unless you consider source code hacking normal. my take is that when a module like ndiswrapper gets compiled, it must include code that tells the kernel to put an entry into the modules.pcimap when the module gets installed. i have compiled and installed other modules such as prism54 and when i install the package, that's when modules.pcimap gets written. and even though i never compiled linuxant's driverloader, when i installed that package, it too wrote an entry into modules.pcimap

so basically, that route was out the door. this is what i ended up doing to get it to work. i took advantage of my kernel's (could be standard across all distros) "if-pre-up" scripts. apparently, when i give a command like "ifup wlan0" my kernel will run all of the if-pre-up scripts in the if-pre-up.d directory. so i included a script in the directory that looks like:

#!/bin/sh

case $IFACE in
wlan0)
/sbin/modprobe ndiswrapper
/bin/sleep 10
/usr/bin/wpa_supplicant -Bw -iwlan0 -c/etc/wpa_supplicant.conf -Dndiswrapper
/bin/sleep 10
esac

so everything gets setup just before the interface goes active. nice.

similarly, i have a if-post-down script that will run after i take the interface down with "ifdown wlan0"

#!/bin/sh

case $IFACE in
wlan0)
/usr/bin/killall wpa_supplicant
/sbin/rmmod ndiswrapper
/sbin/cardctl eject
esac

finally, one might ask, this is all great and all, but do i always have to issue the "ifup wlan0" command after i boot-up? afterall, you can only issue that command if you are root (at least for my system). the answer is no. to get around that, i have this is my /etc/network/interfaces file:

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto wlan0
iface wlan0 inet dhcp

the "auto wlan0" will try to bring up the interface at bootup. (my take is it is like running an ifup command during boot.) now, this will fail if the card is not inserted. in this case, then you would have to run ifup after logging in as root.

i hope this helps someone.
 
Old 09-01-2005, 12:43 PM   #7
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
Aha, you found another hook to place this in. Good work!

(pcmcia cards is found under /sys/bus/pcmcia/* I think. You could also try /sys/class/net or something like this. Don't have pcmcia on this computer)

If you want to have your system run "ifup wlan0" automaticli when you insert the card, you still should be look into hotplug.

/etc/network/interfaces specifies attributes about your LAN access and LAN cards. It has nothing to do with adding and removing cards. That is hotplugs job.

You could have a look at /etc/hotplug/net.ifup or /etc/hotplug/net.agent
See /usr/share/doc/hotplug/README.Debian

There could be another place for this,

Maybe, maybe /etc/hotplug.d/net is where you want to place a script.

(reading man page)

Hmm, I guess that /etc/hotplug/pcmcia.agent is used for pcmcia-cards found by kernel and hotplug. Does hotplug supports pcmcia-cards? What kernel subsystem does handle pcmcia-cards?

Hmm:
USB, ISAPNP, NET and PCI (for CardBus) is suported. They are working on SCSI. Not PCMCIA?

Maybe some other way then.

(Hmmm, I might be barking up the wrong tree. Should have checked this a litle bit more befor this post. Look if you can get any information from this )

Good luck!

Last edited by Jaxån; 09-01-2005 at 12:44 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading module and connection parameters for wi-fi at start up? Kramer Linux - General 6 08-31-2005 03:58 PM
ndiswrapper module loading error kushalkoolwal Debian 1 08-19-2005 02:14 PM
problem loading a module alaios Linux - General 5 06-09-2005 08:01 AM
module loading problem tiluu Linux - Networking 0 06-28-2004 09:20 AM
Finding Module Dependencies...(Still loading...still loading..still loading..HANG!!!) Aeudian Linux - General 3 08-11-2003 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 05:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration