# Network init script not starting my wireless card as wireles

## LonelyStar

Hello together,

I have a wireless card working with the rt2500 kernel module.

It works if I set all the needed parameters using iwconfig by hand! But if I do /etc/init.d/net.ra0 start, I get:

```

Starting ra0

 *   Configuration not set for ra0 - assuming DHCP

 *   Bringing up ra0

 *     dhcp

 *       Running dhcpcd ...                                               [ !! ]

```

Which looks like it is not recognizing my config.

This is my /etc/conf.d/net:

```
modules_ra0=( "iwconfig" )
```

And this is /etc/conf.d/wireless:

```
essid_ra0="HOME_NET"

mode_ra0="ad-hoc"

channel_ra0="3"

iwconfig_ra0=""

sleep_scan_ra0="1"

key_HOME_NET="s:XXXXXXXXXXXXXX enc open"

config_HOME_NET=( "192.168.0.1 netmask 255.255.255.0" )

```

And here you can see, that net.ra0 is a correct symlink:

```
ls -l /etc/init.d/net.ra0 

lrwxrwxrwx 1 root root 6 Mar 27 01:08 /etc/init.d/net.ra0 -> net.lo
```

Why does the init script not use the wireless-configuration?

Thanks!

Nathan

----------

## UberLord

Set RC_VERBOSE="yes" and restart the script to get more details.

----------

## LonelyStar

Ok, now I get:

```

/etc/init.d/net.ra0 restart

 * Starting ra0

 *   Loading networking modules for ra0

 *     modules: apipa arping macchanger macnet rename iwconfig essidnet iptunnel ifconfig system dhcpcd ip6to4

 *       iwconfig provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Configuring ra0 for MAC address 00:11:09:9A:9D:44 ...                [ ok ]

 *   Wireless extensions not found for ra0

 *   Configuration not set for ra0 - assuming DHCP

 *   Bringing up ra0

 *     dhcp

 *       Running dhcpcd ...

```

That is strange, because iwconfig seems to find the "wireless extension":

```

iwconfig 

lo        no wireless extensions.

eth0      no wireless extensions.

ra0       RT2500 Wireless  ESSID:""  

          Mode:Managed  Frequency=2.412 GHz  Bit Rate:54 Mb/s   Tx-Power=-1   

          RTS thr:off   Fragment thr:off

          Encryption key:off

```

Any Ideas?

Thanks!

Nathan

----------

## UberLord

Sure you're using the rt2500 driver and not the r2x00 driver cvs? r2x00 driver cvs using the devicescape ieee 802.11 stack doesn't register in /proc/net/wireless which is what is happening here, and we rely on that for baselayout to think it's a wireless device.

----------

## LonelyStar

I am using the rt2500 driver from cvs! But not the rt2x00.

If I try to use rt2500 from portage, the following happands:

```
modprobe rt2500

FATAL: Error inserting rt2500 (/lib/modules/2.6.15-no4/net/rt2500.ko): Invalid argument

```

And dmesg tells me:

```

rt2500: falsely claims to have parameter ifname

```

I am using no-sources-2.6.15-no4.

Any way I can get the portage-rt2500 to work?

Thanks! 

Nathan

----------

## UberLord

Try using an official kernel, like vanilla-sources or gentoo-sources.

----------

## LonelyStar

It works with gentoo-sources. Thanks for your help!!!

----------

## Brain Fury

I have a similar problem with the rt2500 module from portage. I am using gentoo-souces-2.6.16. When I wat to load the module I get

```
# modprobe rt2500

FATAL: Error inserting rt2500 (/lib/modules/2.6.16-gentoo/net/rt2500.ko): Invalid argumen
```

and

```
# dmesg | grep rt2500

rt2500: falsely claims to have parameter ifname
```

----------

## davidcie

I run into exactly the same problem a few hours ago. The bottom line is that you cannot use rt2500-1.1.0_beta3 with 2.6.16. Even if you correct the way module registers paramters to get rid of that ifname message (will post a corrcted ebuild on bugzilla soon), your kernel will segfault.

Well, but if you do want to run .16, here are some instructions you might find helpful:

you'll need cvs so emerge that first

create yourself an overlay if you don't have one yet (if you don't know how, google for it)

make sure your overlay is configured in make.conf

within the overlay create directory net-wireless/rt2500-cvs

copy my ebuild from here and put it in the rt2500-cvs directory you've just created

cd to /usr/overlays/myovr/net-wireless/rt2500-cvs (or wherever your overlay lives)

digest the ebuild:

```
ebuild rt2500-cvs-20060411.ebuild digest
```

unmerge rt2500 and install the cvs version:

```
emerge -C rt2500

emerge rt2500-cvs
```

That's not the end of the story... Since as mentioned above the driver doesn't register in /proc/net/wireless, you'll have to disable the check for that directory in a baselayout script:

open /lib/rcscripts/net.modules.d/iwconfig in your fav editor [hopefully vim   :Cool: ]

scroll down to line 56 to function iwconfig_exists

modify it so that it looks as follows (note the semicolon  :Exclamation:  ):

```
iwconfig_exists() { :

#    [[! -e /proc/net/wireless ]] && return 1

#    grep -q "^[ \t]*$1:[ \t]" /proc/net/wireless

}
```

save & exit...

That should be it! After reboot your wireless should be up & running joyfully.

Now you should have a nice pizza / treat of choice for successfully hacking your gentoo  :Wink: 

PS: Modifying rcscripts is not the best workaround, the iwconfig_exists function is there for a reason. So as soon as the driver gets a fix, uncomment the check.

PPS: Cannot guarantee the above won't permanently erase your drive, kill your cat, or make you go bald... So use at your own risk  :Wink: 

----------

## overkll

 *davidcie wrote:*   

> I run into exactly the same problem a few hours ago. The bottom line is that you cannot use rt2500-1.1.0_beta3 with 2.6.16. Even if you correct the way module registers paramters to get rid of that ifname message (will post a corrcted ebuild on bugzilla soon), your kernel will segfault.

 

Huh?  Whatever you've been smoking, I want some!  Sorry, couldn't resist   :Wink: 

```
emerge -pv rt2500

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-wireless/rt2500-1.1.0_beta3  +qt 0 kB
```

```
uname -r

2.6.16-ck9
```

I've had absolutely no problems with 1.1.0_beta3 and 2.6.16 series kernels.  

Just curious - Did yall follow the kernel config instructions on the Gentoo Wiki?  If so, the IEEE80211 settings are NOT required.  Maybe this is the issue?Last edited by overkll on Fri May 05, 2006 6:23 pm; edited 1 time in total

----------

## davidcie

 *Quote:*   

> Huh? Whatever you've been smoking, I want some! Sorry, couldn't resist

 

Well, the ifname bug is not there anymore (you could have a look at gentoo bugzilla to find out why). And surprising as you may find it, the stock module still doesn't work on my hardware configuration. So I'll stick with CVS until a solution pops up... Feel free to contact me should you find one  :Wink: 

 *Quote:*   

> IEEE802.11 setings are NOT required

 

Of course - that's only for the rewritten 2.0 betas.

----------

## overkll

 *Quote:*   

> Well, the ifname bug is not there anymore (you could have a look at gentoo bugzilla to find out why). 

 

Is this the ifname bug you are referring to?  The changelog lists it as a gcc-4.1 issue, not a 2.6.16 kernel issue.  If it was a kernel issue, I surely would have been bitten by it, especially since I upgraded to 2.6.16-ck1 about 10 days before the bug was filed.  rt2500-1.1.0_beta3 was one of the external kernel module ebuilds I DIDN"T have problems with while upgrading from 2.6.15 to 2.6.16.

 *Quote:*   

> And surprising as you may find it, the stock module still doesn't work on my hardware configuration. So I'll stick with CVS until a solution pops up... Feel free to contact me should you find one  

 

You're not using a SMP kernel, are you?  The stable rt2500 won't work with a SMP kernel, but I believe the latest CVS version does.

I don't know which method you are using to bring up ra0.  Personally, I find the .dat file created by the RaConig2500 utility (emerge with qt use flag) works best for me.  I have a hidden ssid and utilize WPA with TKIP and it works very well.  I've tried  "The Gentoo Way" using the unstable baselayout, but had to unhide my ssid  :Sad:  so I switched back to the stable base layout and use the .dat file.  I'll probably have another go at the gentoo way  once rt2x00_beta4 is released.

----------

## davidcie

 *Quote:*   

> Is this the ifname bug you are referring to? The changelog lists it as a gcc-4.1 issue, not a 2.6.16 kernel issue. If it was a kernel issue, I surely would have been bitten by it, especially since I upgraded to 2.6.16-ck1 about 10 days before the bug was filed.

 

Ehh, I can't help thinking it's just an empty discussion. Yes, I am using GCC 4.1, but the bug being filed as GCC-related does not have to mean it's *only* a GCC problem - rather a little more complex problem of which GCC is the most easily spotted part. FYI, it all worked fine (4.1) with older kernels, it was solely the up to .16 when I started to have problems.

 *Quote:*   

> You're not using a SMP kernel, are you? The stable rt2500 won't work with a SMP kernel, but I believe the latest CVS version does.

 

Believe me, I spent the whole night trying out different things. No, I don't use SMP.

 *Quote:*   

> I don't know which method you are using to bring up ra0. Personally, I find the .dat file created by the RaConig2500 utility (emerge with qt use flag) works best for me.

 

I didn't like the idea of external config files for separate devices. An aesthetic choice if anything; I have mine configured with the standard wireless / net under conf.d. And you don't need to emerge with the qt flag to get the .dat, btw. At least on my system  :Wink: 

----------

