From: Chris D. <chr...@gm...> - 2009-01-31 17:42:21
|
I'm testing one of the beta Overo boards that have the built-in wireless/bluetooth module onboard. Currently the wireless device (which is a sdio card that shows up in slot 2) gets assigned eth0 from the libertas-sdio driver. Since the /etc/network/interfaces file assumes eth0 is wired and wlan0 is wireless you have to manually run iwconfig to set the essid for eth0 and then ifup the interface or run udhcpc to get an ip. This works fine, but I wanted to automate things a bit more. So I wrote a udev rule to rename the libertas interface to wlan0. I created the file /etc/udev/rules.d/40-libertas-sdio.rules which contains the single line : SUBSYSTEMS=="sdio", DRIVERS=="libertas_sdio", NAME="wlan0" This made it work about half the time. Other times I would get an error from udev at boot time when it tried to rename the device, saying that the device was busy. After looking at the output and examining the udev networking script I came to the conclusion that the networking script was sometimes getting called before udev could rename the device, which was causing the error. So I commented out the "auto wlan0" in the interfaces file. This (from what I can gather from the udev networking script) lets udev completely take over ifupping the device, and with that change things seem to be reliable and the device is always renamed and upped properly at boot time. So my question is is writing a rule for this the correct approach? If so, is there a better file I should put the rule in rather than creating a file as I did? And lastly, is my assumption about the interfaces file getting called before the udev rule causing the error reasonable? Since I can't seem to get reliable results without removing the auto wlan0 line thats the only conclusion I can come to. I'm far from a udev expert, so any thoughts or advice is appreciated! I'm attaching the udev rule file in case anyone else wants to test it. Chris |