Jump to content

Mandriva 2007: conflicting software udev && hostap


wingcom
 Share

Recommended Posts

Hi,

 

I installed Mandriva 2007 Free on which i have a pcmcia-to-pci device with a Senao NL-2511CD Plus Ext 2 wifi card. By default the orinocco driver was loaded for this card and that seemed to work allthough it did not have the AP functionality I wanted. So I blacklisted the orinocco driver:

 

[root@VOYAGER modprobe.d]# cat blacklist

blacklist orinoco_plx

blacklist orinoco_cs

blacklist orinoco_pci

blacklist orinoco

 

fine, now the hostap_cs driver was loaded by default. great no? It would be if the driver would work but NOTHING happens. Ethereal isn't picking ANY activity on this interface and network scans deliver nothing.

 

So after alot of digging I found that with this new hostap-kernel module there is somewhat a conflict with udev. I got weird interface names like eth6 and wlan0_rename. Tried to adjust the rules in /etc/udev/rules.d/61-net_config.rules but apart from some other weird naming, nothing solved my problem.

 

after a few hours of googling I found some info and I tried to stop udev with the command: /etc/init.d/udev stop. It said udev stopped [OK].

i ran pccardctl eject and pccardctl insert but the problem remained while with other distributions this seemed to work.

 

So I tried starting it again: /etc/init.d/udev start which gave me an error tthat udev was already bound and could not be started again. tiens, I just stopped it didn't I? continued->

 

[root@VOYAGER src]# ps aux | grep udev

root 1021 0.0 0.1 4948 1856 ? S<s 09:03 0:00 udevd -d

root 8631 0.0 0.0 5028 772 pts/4 R+ 09:39 0:00 grep --color udev

[root@VOYAGER src]# kill -9 1021

[root@VOYAGER src]# ps aux | grep udev

root 8637 0.0 0.0 5028 772 pts/4 R+ 09:40 0:00 grep --color udev

[root@VOYAGER src]# pccardctll eject

bash: pccardctll: command not found

[root@VOYAGER src]# pccardctl eject

[root@VOYAGER src]# pccardctl insert

[root@VOYAGER src]# iwconfig

lo no wireless extensions.

 

eth0 no wireless extensions.

 

eth1 no wireless extensions.

 

sit0 no wireless extensions.

 

eth2 no wireless extensions.

 

wifi0 IEEE 802.11b ESSID:"test"

Mode:Master Access Point: Not-Associated Bit Rate:11 Mb/s

Sensitivity=1/3

Retry min limit:8 RTS thr:off Fragment thr:off

Encryption key:off

Power Management:off

 

wlan0 IEEE 802.11b ESSID:"test"

Mode:Master Access Point: Not-Associated Bit Rate:11 Mb/s

Sensitivity=1/3

Retry min limit:8 RTS thr:off Fragment thr:off

Encryption key:off

Power Management:off

Link Quality:0 Signal level:0 Noise level:0

Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0

Tx excessive retries:0 Invalid misc:0 Missed beacon:0

 

 

and it even works now!

 

Now for the real question: how do i properly fix this?

1. Is it ok to leave udev off?(I dont seem to need it) If so, which script starts that udevd deamon (cus udev start/stop dont seem to work)? And how can I disable it?

2. Or would it be better to compile in a new version? If so how can i check my current version and where is the source located at in the new 2.6.18-rc7 source?

 

I'll probably find it but since I spent some time fixing this I thought I'd post my partial solution

 

thanx for your help,

wingcom

Link to comment
Share on other sites

i can definitly not go without udev :))

Well installed the udev_103 version. and renamed the interface inthe 61-net_config.rules and now the interface IS picking up traffic

joy joy, we are getting there

 

2 problems remain:

 

1. wifi0 is still named wifi0_rename instead of plain old wifi0

2. I got 64bit architecture and my udev scripts are in /lib64/udev instead of /lib/udev which gives me errors:

 

Dec 24 12:07:48 VOYAGER kernel: pccard: card ejected from slot 0

Dec 24 12:07:48 VOYAGER udevd-event[6249]: run_program: exec of program '/lib/udev/net_action' failed

Dec 24 12:07:48 VOYAGER udevd-event[6252]: run_program: exec of program '/lib/udev/net_action' failed

Dec 24 12:07:52 VOYAGER kernel: pccard: PCMCIA card inserted into slot 0

Dec 24 12:07:52 VOYAGER kernel: pcmcia: registering new device pcmcia0.0

Dec 24 12:07:52 VOYAGER kernel: hostap_cs: Registered netdevice wifi0

Dec 24 12:07:52 VOYAGER kernel: hostap_cs: index 0x01: , irq 177, io 0x7100-0x713f

Dec 24 12:07:52 VOYAGER kernel: wifi0: NIC: id=0x800c v1.0.0

Dec 24 12:07:52 VOYAGER kernel: wifi0: PRI: id=0x15 v1.1.1

Dec 24 12:07:52 VOYAGER kernel: wifi0: STA: id=0x1f v1.7.4

Dec 24 12:07:52 VOYAGER udevd-event[6260]: run_program: exec of program '/lib/udev/net_create_ifcfg' failed

Dec 24 12:07:52 VOYAGER udevd-event[6261]: run_program: exec of program '/lib/udev/net_action' failed

Edited by wingcom
Link to comment
Share on other sites

ok the error-messages are gone.

In the source files there was a test for running commands(initiated from the rules-files) that did not supply whole path info (so no '/' given) this was hardcode to /lib without an architecture test. I (dirty quick fix) changed that to /lib64 but of course it would be better to have some sort of architecture test. but meh it works now. Just the wifi0_rename thingie remains

 

 

udev_rules_parce.c :

				/* allow programs in /lib/udev called without the path */
			if (strchr(file, '/') == NULL) {
				strlcpy(file, "/lib64/udev/", sizeof(file));
				strlcat(file, value, sizeof(file));
				pos = strchr(file, ' ');
				if (pos)
					pos[0] = '\0';
			}

 

udev_utils_run.c

	/* allow programs in /lib/udev called without the path */
if (strchr(argv[0], '/') == NULL) {
	strlcpy(program, "/lib64/udev/", sizeof(program));
	strlcat(program, argv[0], sizeof(program));
	argv[0] = program;
}

 

Renaming the interfacename in the rules file was the first thing i did but that didnt help with the default 64bit udev that came with mandriva. With this new version103 it seems to work. Allthough that was yesterday, i might have made another mistake back then but anyways: it works now

Link to comment
Share on other sites

I hope so daniewicz :) At least I will benefit from it when I crash my box within 3 months or so :)

Anyways: found some additional information about the renaming. I think I already know what the problem is:

 

wlan0 and wifi0 both get offered/exported by the driver. [uEVENT] for both is raised when that happens. [uDEV] then checks the rules what to do with it. It first checks /sys/class/net/wlan0 and leaves it as is then it checks /sys/class/net/wifi0 and finds a rule to change that devicename to wlan0 but that device already exists: hence the weird naming wifi0_rename

 

so now i just gotta weed out that name but i've noticed that for some cards the name actually HAS to be renamed from wifi to wlan. So i'm reading rule building cus i think it will be better to create an additional rule instead of deleting the one that renames wifi to wlan. To be continued

Link to comment
Share on other sites

Ok, this is my solution on this... As you can see here it is working with udev running (version 103)

 

[root@VOYAGER wingcom]# iwconfig

lo no wireless extensions.

 

eth0 no wireless extensions.

 

eth1 no wireless extensions.

 

sit0 no wireless extensions.

 

eth2 no wireless extensions.

 

wifi0 IEEE 802.11b ESSID:"test"

Mode:Master Access Point: Not-Associated Bit Rate:11 Mb/s

Sensitivity=1/3

Retry min limit:8 RTS thr:off Fragment thr:off

Encryption key:off

Power Management:off

 

wlan0 IEEE 802.11b ESSID:"test"

Mode:Master Access Point: Not-Associated Bit Rate:11 Mb/s

Sensitivity=1/3

Retry min limit:8 RTS thr:off Fragment thr:off

Encryption key:off

Power Management:off

Link Quality:0 Signal level:0 Noise level:0

Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0

Tx excessive retries:0 Invalid misc:0 Missed beacon:0

 

Steps to make this work. I actually did f*ck it up a bit by trying different versions not build for mdv cus it moves some of the files to different locations then the 'make install' does from the original udev-103 source. There is also a 2007 cooker rpm available for version 103 but that wouldn't install on my system. Saying it would break stability. Also the 64bit vs. 32bit is a bitch and leaves some garbage behind when you try to install from source.

 

1. Current version installed on the Mandriva 2007 DvD is 98. Uninstalling this is not possible (not by means I know nl. urpmi) cos it would break the system or so urpmi claims.

2. Updating it with the cooker rpm didn't work either: conflicting files all the way. --force wouldn't help me either.

3. So I think the best way is to install v103 from source (kernel.org). The 'make install' overwrites the old files and that actually works though i did need som lib vs lib64 replacing. From that moment on I had wlan0 instead of eth6

4. Then (not done with the 'make install' of the main package) goto the extra's directory in the udev-103 source and further in the rules_generator directory. Install these scripts by doing make install-bin.

5. Depending on 64vs32 bit your /lib/udev/ directory now has write_net_rules. (you need to change that manual! I wonder if there isn't some sort of environment variable that you can use in C to get the current lib directory -> /lib or /lib64. Something like %windir% in windows)

6. In /etc/udev/rules.d rename your 70-persistent-net.rules file to 70-persistent-net.rules.old

7. Run the script: ./write_net_rules all_interfaces

 

This will have made a new 70-persistent-net.rules with the - changed - following line:

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:02:6f:3b:70:6a", ATTRS{type}=="1", NAME="wlan0"

 

the ATTRS{type}=="1" line makes sure the device doesn't get renamed. I found a nice post on this problem on the debian lists

 

You might also just adjust the rules but this one works for sure. You gotta delete or rename the original persistent-rules file cus it won't update!

I hope I get the chance to test this on a clean install cus I've been messing alot with it so much and ive noticed that other versions have other rules files and stuff so no i guess i have a few to much of them and my udev install needs cleaning up :s

 

Ah there is also a mdv2007 cooker SOURCE package but that is just a complete joke. When you look which files are inside, i didn't see ANY real source files but just some scripts :s

 

cheers,

wingcom

Link to comment
Share on other sites

  • 1 month later...

Back with a better solution:

 

hostap and udev etc were so messed up that I reinstalled keeping my home dirs/settings. With the knowledge I got now I got it working.

 

1. When you install Mandriva 2007 with a prism2 card (mine is a senao prism 2.5) both the orinoco_cs and hostap_cs modules are loaded. No way to connect to your wireless access point with this setup.

2. udev made rules (in /etc/udev/rules.d) based on the orinoco_cs driver. So it creates a line in /etc/udev/rules.d/61-net_config.rules stating the card with that MAC address should be named "ethx". This is orinoco naming.

3. The card won't connect like this + I want only hostap_cs so that i'm sure it loads that one.

4. You blacklist the orinoco_cs, orinoco_plx, orinoco_pci and orinoco modules in /etc/modprobe.d/blacklist (create if it does not exist)

5. pccardctl eject

6. modprobe -r orinoco_cs

7. Remove or comment out the line earlier mentioned in /etc/udev/rules.d/61-net_config.rules

8. Now with only hostap_cs loaded, reinsert the card (pccardctl insert)

9. udev will now make the rules for hostap_cs correctly and add it to /etc/udev/rules.d/61-net_config.rules

 

Both well known device names wlan0 and wifi0 are there and you can start using them.

 

Another thing that makes it not work sometimes is the wizard (currently trying to figure out what they do and where they place their info but they tend to mess up stuff) For instance: when I moved it all to hostap and my devices reported back as wlan0 and wifi0 (through iwconfig/ifconfig) I opened up "Reconfigure Network Interface" from the mcc, in the list of interfaces i found ehternet: eth3! This was the orinoco naming and was still there, had to delete it, create it again (now with wlan0/INTERSIL). Without these corrected wizard settings there was no connect/associate possible on the card! Fixed it and connection succeeded.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...