You are not logged in.
Hi,
I recently installed Arch 0.7.1 on my laptop.
So far I am very impressed with the speed and the simplicity :-)
I just have one small problem: madwifi-ng
Currently, I have to manually create the ath0 interface with wlanconfig, which is annoying. On the Gentoo forum I have found a partial script with preup/predown functions (the thread is located here)
preup() {
if [ "${IFACE}" == "ath0" ]; then
/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta > /dev/null
return $?
fi
if mii-tool ${IFACE} 2> /dev/null | grep -q 'no link'; then
ewarn "No link on ${IFACE}, aborting configuration"
return 1
fi
return 0
}
predown() {
if [ "${IFACE}" == "ath0" ]; then
killall wpa_supplicant
/sbin/wlanconfig ath0 destroy
return $?
fi
return 0
}
I am using a Netgear WG511T pcmcia card.
I would really appreciate any suggestions on where to put this code, and how to modify it for use with Arch Linux, or if I should use something else alltogether.
Thanks in advance!
Offline
While my problem isn't really solved, for the time being I have added the following line to /etc/rc.local
/usr/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta > /dev/null
But because the ath0 network interface does not exist untill the very last moment, netcfg tries to configure ath0 during boot before it exists and I have to run "netcfg netgear" again after ath0 is created ("netgear" is the name of my network-profile). So I think I'll just add that to rc.local too. I'm not a scripting expert unfortunately, but I think it'll work. Nonetheless, I would certainly welcome any suggestions for improvement, because I think this essentially breaks the whole idea of selecting network profiles :-)
Should I try modifying sections of /etc/rc.d/network, or should I really leave that alone?
Offline
I put it in the /etc/conf.d/wireless file. I create the device and then apply firewall rules. This file is sourced at the beginning of /etc/rc.d/network. To make it not complain, I pass $1 from network and then use a case statement to destroy the device on stop. I don't do anything for restart.
Offline
OK, I'll try putting something together in the wireless file. Thanks for your help!
Offline
there is another thread about using the network profiles to do this in a better way
Offline
Would you mind posting a link? I searched the forum again, to see if I missed it the first time, but I can't find it.
Offline
Offline
Thanks for the link :-)
I'm not sure if I already read it, but I was already using a network profile to configure ath0. The main question was how to (properly) create and detroy the ath0 interface with the new madwifi-ng code before netcfg tries to configure a non-existing ath0 with wpa_supplicant, because that just results in ioctl errors and longer boot-up time.
I am not yet appending [solved] to the thread title, even though you did answer my question, as I would still welcome any tips/suggestions for better solutions (if possible).
Offline
Another interesting problem: I recently upgraded to the latest madwifi-ng code with svn update and also started using wpa_supplicant 0.5.0 (upgraded from 0.4.7)
The netcfg script stopped working and after a little tinkering I discovered that the following section from start_profile() in the netcfg script was killing wpa_supplicant before it could connect:
while ! wpa_cli status | grep "wpa_state=COMPLETED" >/dev/null 2>&1; do
if [ $i -gt 10 ]; then
wpa_cli terminate >/dev/null 2>&1
ifconfig $WIFI_INTERFACE down
stat_fail && return
fi
sleep 2
let i++
done
fi
I have now commented out the loop and running the command "netcfg netgear" no longer halts there and so far everything seems to be fine again. I am guessing more than a 20 second timeout is needed, so I'll try having the iterator increment to 30 or something and see if that solves it.
[EDIT]
Now using [ $i -gt 30 ]; and it works. On second thought, since everything now really just works and my main question was essentially answered, I am adding [solved] to the title.
Thanks again!
[/EDIT]
Offline
You may already be way past this, and reviving this old thread might be silly, but I came across this thread when addressing this issue myself. The solution I came up with was to create a utility script in /etc/rc.d/ath_dev that does the wlanconfig. I added start/stop/restart commands, as one would expect, and simply added it to the DAEMONS array before 'network'. This creates the ath0 device before netcfg runs, and works for me. I did this because it also helps with suspending with suspend2; I destroy the interface with '/etc/rc.d/ath_dev stop' when suspending, and recreate it on resume with 'etc/rc.d/ath_dev start'. Anyway, hope somebody can use this tip when dealing with madwifi-ng.
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
Whould you mind posting your Utility scripts.
And how to ad start/stop/restart command
//Claman
Offline
Sure; it's modelled after any of the other scripts in /etc/rc.d
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Creating ath0 device"
wlanconfig ath0 create wlandev wifi0 wlanmode sta
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
stop)
stat_busy "Destroying ath0 device"
wlanconfig ath0 destroy
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
If you are using new madwifi-ng drivers, then you don't need to create or destroy the virtual device any more. By default, a device is created when you load the module. There is a parameter that you can pass if you want to call it something else.
Offline
colnago: i'm using madwifi-ng but it doesn't create ath0 by default for me. I still have to create it manually. i just built madwifi-ng today.
Offline
why not just add 'wlanconfig ath0 create wlandev wifi0 wlanmode sta' to /etc/rc.d/network
if [ "$iwcfg" != "" ]; then
/usr/sbin/iwconfig $iwcfg
/bin/sleep 2
fi
change it to
if [ "$iwcfg" != "" ]; then
/usr/bin/wlanconfig ath0 create wlandev wifi0 wlanmode sta
/usr/sbin/iwconfig $iwcfg
/bin/sleep 2
fi
works good for me. also don't forget to add wlan-scan-sta after ath-pci in your modules array. then you can scan
wlanconfig ath0 list scan
Offline