Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_supplicant 0.4.7, kernel 2.6.14 & madwifi-ng all working
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Fri Dec 02, 2005 10:25 pm    Post subject: wpa_supplicant 0.4.7, kernel 2.6.14 & madwifi-ng all wor Reply with quote

There have been a number of problems recently for those (unlucky) few who have Atheros cards, a WPA wireless connection and have installed the latest kernel (i.e. 2.6.14 or later).

The long and short being that there were changes to the way the kernel works with wireless extensions (i.e. no longer through /proc/net/wireless), that madwifi is transitioning to a new codebase (also known as madwifi-ng), and hence there are no updates for the old codebase to work with the new extensions system, and also from wpa_supplicant (about 0.4.5 I think), only the newer madwifi-ng codebase is supported.

Tied with problems getting recent version of the old madwifi codebase and wpa_supplicant programs to work together (kernel panic!), it's been a tough time recently for Atheros chipset holders.

However - good news. I've finally managed to get all the new parts working, and hence I'm writing this guide for all those who want to know how.

Changelog

  • 1.0 Inital Version
  • 1.1 Update to the guide (put in more information about the portage overlay and what you need to build into the kernel). Also, general cleanup to the layout and added more structure.
  • 1.2 Further Update for Madwifi Drivers and Tools to 20051208 (1350 trunk) and pointer to new directory strucutre (snapshot site has modified the layout slightly)
  • 1.2.1 Update to madwifi-tools ebuild
  • 1.2.2 Update to fix the last update :)


The Guide

Version

The following list are the versions of the programs I am running. The installation steps are below, however this is a reference to what I have installed and what I have working together.

Code:
* sys-kernel/gentoo-sources
     Installed:           2.6.14-r2

* net-wireless/wireless-tools
     Installed:           28_pre10

* net-wireless/madwifi-driver
     Installed:           0.1_pre20051208

* net-wireless/madwifi-tools
     Installed:           0.1_pre20051208

* net-wireless/wpa_supplicant
     Installed:           0.4.7-r1


The Kernel

If you have not yet already done so, you will need to configure and make a kernel ready with Wireless Extensions enabled. Without this the ebuilds will probably fail and none of the programs will install.

I'm using the latest stable gentoo-sources release - 2.6.14-gentoo-r2. To install just run emerge and then make menuconfig:

Code:
# USE="symlink" emerge =sys-kernel/gentoo-sources-2.6.14-r2
# cd /usr/src/linux
# make menuconfig


You will need to make sure that the 'Device Drivers --> Network device support --> Wireless LAN (non-hamradio) --> Wireless LAN drivers (non-hamradio) & Wireless Extensions' is enabled (you shouldn't need anything else under 'Device Drivers --> Network device support --> Wireless LAN (non-hamradio) --> ' enabled) and disable 'Networking --> Generic IEEE 802.11 Networking Stack' (I don't have it enabled and all works fine).

As another side point. I've not seen it confirmed anywhere, but I have had problems when I have been using 'Preemptible Kernel (Low-Latency Desktop)' enabled under 'Processor type and features'. It seams to be causing a problem in one of the locks (I think) and therefore it must be set to either 'Voluntary Kernel Preemption (Desktop)' or 'No Forced Preemption (Server)' for the driver to work correctly

Now install the kernel (and edit your grub/lilo conf file):

Code:
# make && make modules_install
# mount /boot
# cp arch/i386/boot/bzImage /boot/kernel-<version>
# cp System.map /boot/System.map-<version>
# cp .config /boot/config-<version>


where <version> is the version of the kernel your using (i.e. 2.6.14-gentoo-r2).

Wireless Tools

With a ready kernel, you can go stright ahead and install net-wireless/wireless-tools. We don't actually need to edit or adjust anything with this pacakge, so it can be installed as-is:

Code:
# emerge wireless-tools
.

Edit the ebuilds

The next steps, and the most important, are to edit the ebuilds so that we can install the correct packages or to enable correct options.

To prevent them being over-written by the next sync, we'll install them into the portage overlay directory (i.e. a separate directory where we can install custom-made or test ebuilds without portage deleting them each sync).

Before we create the overlay, we need to tell portage we are going to use one and tell it where it's going to be located. This is done in the make.conf file, using the PORTDIR_OVERLAY variable. Simple edit make.conf and add the following line:

Code:
PORTDIR_OVERLAY="/usr/local/portage"


If you don't set it up, or set it up incorrectly, you'll get the following error when you try and run a digest:

Code:
# ebuild madwifi-tools-0.1_pre20051208.ebuild digest
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051208' not specified:
!!!            None
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051208' not specified:
!!!            None


With the location set, you can create the directories and the files needed to complete the install.

If you haven't created the directories for the various tools yet, run the following command. This will create the net-wireless group directory and a directory for each of programs:

Code:
# mkdir -p /usr/local/portage/net-wireless/{madwifi-tools,madwifi-driver,wpa_supplicant}


Madwifi

Before we can edit the ebuilds, we'll copy them over and rename them. They need to be renameed, both to separate them out of the versions in the normal portage tree, and to pick up the correct file from the snapstop list (the date part of the ebuild, e.g. 20051130, is used to select the correct file from madifi):

Code:
# cd /usr/local/portage/net-wireless
# cp /usr/portage/net-wireless/madwifi-tools/madwifi-tools-0.1_pre20051111.ebuild /
     madwifi-tools/madwifi-tools-0.1_pre20051208.ebuild
# cp /usr/portage/net-wireless/madwifi-driver/madwifi-driver-0.1_pre20051111.ebuild /
     madwifi-driver/madwifi-driver-0.1_pre20051208.ebuild


However, as the files in the snapshot directory are also named based on the trunk number (i.e. the revision number of the subversion tree), we need to update a variable inside each of the two ebuilds. The varible is the same in both of them, and needs to be changed to the same value for each of them as well.

Edit both madwifi-tools/madwifi-tools-0.1_pre20051208.ebuild and madwifi-driver/madwifi-driver-0.1_pre20051208.ebuild and replace the top line with the following value:

Code:
MADWIFI_SVN_REV="1350"


** Update: The madwifi-ng snapstop site (http://snapshots.madwifi.org/) has changes it site structure. The older ebuild will no longer work (you'll probably get 404 errors). In order for them to work again, we need to change the URL used to fetch the file and the Source Directory command. This is done with the SRC_URI and S variables. A few lines under the one you have just editing, you should see lines like:

Code:
SRC_URI="http://snapshots.madwifi.org/madwifi-trunk-r${MADWIFI_SVN_REV}-${PV:7:8}.tar.gz"
S=${WORKDIR}/madwifi-trunk-r${MADWIFI_SVN_REV}-${PV:7:8}


change these to, for the madwifi-driver-0.1_pre20051208.ebuild:

Code:
SRC_URI="http://snapshots.madwifi.org/madwifi-ng/madwifi-ng-r${MADWIFI_SVN_REV}-${PV:7:8}.tar.gz"
S=${WORKDIR}/madwifi-ng-r${MADWIFI_SVN_REV}-${PV:7:8}


change these to, for madwifi-tools-0.1_pre20051208.ebuild:

Code:
SRC_URI="http://snapshots.madwifi.org/madwifi-ng/madwifi-ng-r${MADWIFI_SVN_REV}-${PV:7:8}.tar.gz"
S=${WORKDIR}/madwifi-ng-r${MADWIFI_SVN_REV}-${PV:7:8}/tools


With the files edited we need to build the digest so portage can emerge the programs. Without the digest (extra files which include the MD5 sums of all the files and the manifest) portage will refuse to install them (as it can't verify that the files are correct). To create the digests, run:

Code:
# cd madwifi-tools
# ebuild madwifi-tools-0.1_pre20051208.ebuild digest
# cd ../madwifi-driver
# ebuild madwifi-driver-0.1_pre20051208.ebuild digest
# cd ..


wpa_supplicant

With wpa_supplicant we also need to edit the ebuild. However, the changes are different. With all the recent versions of wpa_supplicant, the ebuild maintainers have completly removed all support for madwifi from them. The madwifi driver isn't build by default and the USE flag to build it has been removed too. To make the corrections, you'll need to copy the file so we can edit it:

Code:
# cp /usr/portage/net-wireless/wpa_supplicant/wpa_supplicant-0.4.7.ebuild /
     wpa_supplicant/wpa_supplicant-0.4.7-r1.ebuild


The change consists of two new lines; first is the actual line that builds the wpa_supplicant driver for madwifi. At around line 70 there are series of statements with CONFIG_DRIVER_XYZ. Here, we need to add the statement:

Code:
echo "CONFIG_DRIVER_MADWIFI=y" >> ${CONFIG}


which will pass the build instruction to the compilation.

Second, we need to modify the CFLAGS variable. The location of the headers from the new madwifi builds are different that the older ones, and although the wpa_supplicant build can compile the new driver in, it's not looking in the new directory. It still assumes the files are in /usr/include when they're now in /usr/include/madwifi. This can be done by adding the following line at the top (i.e. ~line 3) of the ebuild:

Code:
CFLAGS="$CFLAGS -I/usr/include/madwifi"


If you wish, you can use the following patch to complete the change automatically

Code:
--- wpa_supplicant-0.4.7.ebuild 2005-12-02 22:11:18.000000000 +0000
+++ wpa_supplicant-0.4.7-r1.ebuild      2005-12-02 22:12:05.000000000 +0000
@@ -4,6 +4,8 @@

 inherit eutils toolchain-funcs

+CFLAGS="$CFLAGS -I/usr/include/madwifi"
+
 MY_P=${PN}-${PV/_/-}
 S=${WORKDIR}/${MY_P}

@@ -69,6 +71,7 @@
        echo "CONFIG_DRIVER_ATMEL=y"       >> ${CONFIG}
        echo "CONFIG_DRIVER_HOSTAP=y"      >> ${CONFIG}
        echo "CONFIG_DRIVER_IPW=y"         >> ${CONFIG}
+       echo "CONFIG_DRIVER_MADWIFI=y"     >> ${CONFIG}
        echo "CONFIG_DRIVER_NDISWRAPPER=y" >> ${CONFIG}
        echo "CONFIG_DRIVER_PRISM54=y"     >> ${CONFIG}
        echo "CONFIG_DRIVER_WEXT=y"        >> ${CONFIG}


by running:

Code:
# cd wpa_supplicant
# patch -p0 -i /path/to/patch-file
# cd ..


With the file updated, we can run the digest for it as well:

Code:
# ebuild wpa_supplicant-0.4.7-r1.ebuild digest


Install

All the updates are done - we can install the programs (in this order):

Code:
# ACCEPT_KEYWORDS=~x86 emerge madwifi-driver madwifi-tools wpa_supplicant


Configuration

There is a message at the end of both madwifi-driver and madwifi-tools (I think) which informs you that you need to change the way the startup script works. ath0 no longer exists. In fact you can in theory create many more ath? interfaces by using the one, new, base interface - wifi0 (although you can't use wifi0 as a substitue for ath0 - you must create ath0 from it. To get ath0 running (and therefore establish a connection), you need to run wlanconfig to create the device.

So, add (or update to) the following content in your /etc/conf.d/net file:

Code:
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
}


Also, make sure that you have set the ath_pci module to load on each boot. Edit the /etc/modules.autoload.d/kernel-2.6 file and just add ath_pci to the list.

Finished

Touch wood, after you reboot, you should have a working wireless connection using madwifi and wpa_supplicant.

Code:
# dmesg
  <snip>
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.16.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413, DFS)
wlan: 0.8.4.2 (Atheros/multi-bss)
ath_rate_onoe: 1.0
ath_pci: 0.9.4.5 (Atheros/multi-bss)
PCI: Enabling device 0000:07:00.0 (0000 -> 0002)
ACPI: PCI Interrupt 0000:07:00.0[A] -> Link [LNKG] -> GSI 9 (level, low) -> IRQ 9
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 7.9 phy 4.5 radio 5.6
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5212: mem=0x26000000, irq=9

# iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"A*****"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:11:50:26:3E:F1
          Bit Rate:48 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:8BD0-****-****-****-****-****-****-703C   Security mode:restricted
          Power Management:off
          Link Quality=39/94  Signal level=-56 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

# wpa_supplicant
wpa_supplicant v0.4.7
Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.fi> and contributors
  <snip>
drivers:
  hostap = Host AP driver (Intersil Prism2/2.5/3)
  prism54 = Prism54.org driver (Intersil Prism GT/Duette/Indigo)
  madwifi = MADWIFI 802.11 support (Atheros, etc.)
  atmel = ATMEL AT76C5XXx (USB, PCMCIA)
  wext = Linux wireless extensions (generic)
  ndiswrapper = Linux ndiswrapper
  ipw = Intel ipw2100/2200 driver
  wired = wpa_supplicant wired Ethernet driver
example:
  wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
 
# ifconfig
ath0      Link encap:Ethernet  HWaddr 00:0F:CB:B0:29:5C
          inet addr:10.0.1.11  Bcast:10.255.255.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:13953943 (13.3 Mb)  TX bytes:1084050 (1.0 Mb)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

wifi0     Link encap:Ethernet  HWaddr 00:0F:CB:B0:29:5C
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:499992 errors:0 dropped:0 overruns:0 frame:6588
          TX packets:11969 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:199
          RX bytes:66829145 (63.7 Mb)  TX bytes:1637138 (1.5 Mb)
          Interrupt:9 Memory:d0960000-d0970000


Notes

At the moment there is no way for the script to destroy the ath0 interface should the script fail to start propertly. This means that should you try and start net.ath0 again ath0 will exist and wlanconfig will fail, usually with the following message:

Code:
wlanconfig: ioctl: Invalid argument
.

You will therefore need to run the following command to remove the ath0 interface so that the net.ath0 script can re-create it!

Code:
# wlanconfig ath0 destroy

_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions


Last edited by djnauk on Thu Dec 22, 2005 10:38 am; edited 9 times in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Dec 02, 2005 11:37 pm    Post subject: Reply with quote

Don't work on amd64 though
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sat Dec 03, 2005 12:00 am    Post subject: Reply with quote

UberLord wrote:
Don't work on amd64 though


Fair enough - I can only claim for what I have it working on (P4-M with 3Com XJACK), and this is the first time I have had all three parts working together in their 'updated' versions. Just thought it would be useful for anyone in a similar situation.
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sat Dec 03, 2005 12:06 am    Post subject: Reply with quote

Hey - np.

A few devs have it working on x86, but a few like myself only have madwifi + amd64 and we're bitching about it not working :evil:
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sat Dec 03, 2005 12:23 am    Post subject: Reply with quote

UberLord wrote:
Hey - np.

A few devs have it working on x86, but a few like myself only have madwifi + amd64 and we're bitching about it not working :evil:


Out of interest - what's the problem?
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sat Dec 03, 2005 1:33 am    Post subject: Reply with quote

As soon as there's network traffic across the freshly created ath0 interface the kernel goes OOPS - segfault. Apparently upstream are aware of the problem - and have been for some time.

So, I've got an rt2500 card - but that driver is waaaay too new, but it least it works with WEP - heh.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sat Dec 03, 2005 8:27 am    Post subject: Reply with quote

Thanks for your initiative!!

Hmm, I would like to try this and I follow your guide, but I get:


Code:
vaio madwifi-tools # ebuild madwifi-tools-0.1_pre20051130.ebuild digest
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051130' not specified:
!!!            None
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051130' not specified:
!!!            None


[One typo in OP, "loca' should be 'local']
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sat Dec 03, 2005 10:42 am    Post subject: Reply with quote

cajzell wrote:
Thanks for your initiative!!

Hmm, I would like to try this and I follow your guide, but I get:


Code:
vaio madwifi-tools # ebuild madwifi-tools-0.1_pre20051130.ebuild digest
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051130' not specified:
!!!            None
!!! aux_get(): ebuild path for 'net-wireless/madwifi-tools-0.1_pre20051130' not specified:
!!!            None


[One typo in OP, "loca' should be 'local']


Thanks - I'll correct the typo in a minute. From the looks of the ebuild you haven't put it into the correct directory. Under /usr/local/portage it needs to be the same as /usr/portage. First, a directory for the group (here, net-wireless) then a directory for the program (madwifi-tools) and then all the ebuilds and it's associated files. You should have a directory structure that looks something like this when you're done:

Code:
# cd /usr/local/portage
# find | grep ebuild
./net-wireless/madwifi-driver/madwifi-driver-0.1_pre20051130.ebuild
./net-wireless/madwifi-tools/madwifi-tools-0.1_pre20051130.ebuild
./net-wireless/wpa_supplicant/wpa_supplicant-0.4.7-r1.ebuild

_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
b8zs
n00b
n00b


Joined: 26 Oct 2005
Posts: 11

PostPosted: Sat Dec 03, 2005 5:52 pm    Post subject: Reply with quote

Thanks for looking into this!

But, unfortunatly I am having the same ebuild problems as cajzell.

I am new to using ebuilds so its probably someting mundane, although I did follow your guide to the T.

My directory structure looks excaclly like yours. Is there supposed to be other files in:

/usr/local/portage/net-wireless/madwifi-driver/
/usr/local/portage/net-wireless/madwifi-tools/
/usr/local/portage/net-wireless/wpa_supplicant/

besides the 3 ebuilds?

Thanks
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sat Dec 03, 2005 6:11 pm    Post subject: Reply with quote

b8zs wrote:
Thanks for looking into this!

But, unfortunatly I am having the same ebuild problems as cajzell.

I am new to using ebuilds so its probably someting mundane, although I did follow your guide to the T.

My directory structure looks excaclly like yours. Is there supposed to be other files in:

/usr/local/portage/net-wireless/madwifi-driver/
/usr/local/portage/net-wireless/madwifi-tools/
/usr/local/portage/net-wireless/wpa_supplicant/

besides the 3 ebuilds?

Thanks


Yes, there should be more, however all the 'extra' files are those produced by the digest. Looking at all the files I have (at least under the net-wireless section - I do have alot more under the overlay):

Code:
# cd /usr/local/portage
# find
./net-wireless
./net-wireless/madwifi-driver
./net-wireless/madwifi-driver/files
./net-wireless/madwifi-driver/files/digest-madwifi-driver-0.1_pre20051130
./net-wireless/madwifi-driver/Manifest
./net-wireless/madwifi-driver/madwifi-driver-0.1_pre20051130.ebuild
./net-wireless/madwifi-tools
./net-wireless/madwifi-tools/madwifi-tools-0.1_pre20051130.ebuild
./net-wireless/madwifi-tools/files
./net-wireless/madwifi-tools/files/digest-madwifi-tools-0.1_pre20051130
./net-wireless/madwifi-tools/Manifest
./net-wireless/wpa_supplicant
./net-wireless/wpa_supplicant/wpa_supplicant-0.4.7-r1.ebuild
./net-wireless/wpa_supplicant/files
./net-wireless/wpa_supplicant/files/digest-wpa_supplicant-0.4.7-r1
./net-wireless/wpa_supplicant/Manifest


Do you both have the PORTAGE_OVERLAY value set in make.conf? I'm not sure if it's enabled and set to /usr/local/portage by default, but I do have it set:

Code:
PORTDIR_OVERLAY="/usr/local/portage"


I think I'll make some updates to the guide putting in some more detail about the options and requirements.
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
b8zs
n00b
n00b


Joined: 26 Oct 2005
Posts: 11

PostPosted: Sat Dec 03, 2005 6:26 pm    Post subject: Reply with quote

Ooooh, that was it: I didnt have the portage overlay directory set in my make.conf

Thanks :D
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sat Dec 03, 2005 6:45 pm    Post subject: Reply with quote

b8zs wrote:
Ooooh, that was it: I didnt have the portage overlay directory set in my make.conf

Thanks :D


No problem - my bad really for assuming that it is a default setting - I know better now! :)
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sun Dec 04, 2005 10:20 am    Post subject: Reply with quote

So, how did you guys get your "/etc/init.d/net.ath0" 's? I don't have wlanconfig.
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sun Dec 04, 2005 10:51 am    Post subject: Reply with quote

cajzell wrote:
So, how did you guys get your "/etc/init.d/net.ath0" 's? I don't have wlanconfig.


wlanconfig is part of the new madwifi-tools package - if you don't have that then you haven't installed it correctly:

Code:
# equery belongs $(which wlanconfig)
[ Searching for file(s) /sbin/wlanconfig in *... ]
net-wireless/madwifi-tools-0.1_pre20051130 (/sbin/wlanconfig)

_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sun Dec 04, 2005 12:21 pm    Post subject: Reply with quote

Hello again,

the trouble I had with wlanconfig was resolved by doing the

Code:
ebuild /usr/local/portage/net-wireless/madwifi-tools/madwifi-tools-0.1_pre20051130.ebuild unpack [compile/install/qmerge]

procedure. So, now that is all well. But, then I try,
Code:

vaio ~ # modprobe ath_pci
WARNING: Error inserting ath_rate_sample (/lib/modules/2.6.12-gentoo-r4h/net/ath_rate_sample.ko): Invalid module format


checking dmesg I get

Code:
vaio ~ # dmesg
....
....
ath_rate_sample: version magic '2.6.12-gentoo-r4h preempt PENTIUM4 gcc-3.4' should be '2.6.12-gentoo-r4h preempt PENTIUM4 gcc-3.3'


Maybe that's because gcc is upgraded since my last kernel build, is there any way to temporarily get around this without rebuilding the kernel?
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sun Dec 04, 2005 1:20 pm    Post subject: Reply with quote

cajzell wrote:
Maybe that's because gcc is upgraded since my last kernel build, is there any way to temporarily get around this without rebuilding the kernel?


You can run gcc-config as root to manage which gcc you use:

Code:
root on laptop [ ~ ] --> gcc-config -l
[1] i686-pc-linux-gnu-3.3.6
[2] i686-pc-linux-gnu-3.3.6-hardened
[3] i686-pc-linux-gnu-3.3.6-hardenednopie
[4] i686-pc-linux-gnu-3.3.6-hardenednopiessp
[5] i686-pc-linux-gnu-3.3.6-hardenednossp
[6] i686-pc-linux-gnu-3.4.4 *
[7] i686-pc-linux-gnu-3.4.4-hardened
[8] i686-pc-linux-gnu-3.4.4-hardenednopie
[9] i686-pc-linux-gnu-3.4.4-hardenednopiessp
[10] i686-pc-linux-gnu-3.4.4-hardenednossp
root on laptop [ ~ ] --> gcc-config 6
 * Switching to i686-pc-linux-gnu-3.4.4 compiler ...                      [ ok ]
root on laptop [ ~ ] -->

_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sun Dec 04, 2005 5:58 pm    Post subject: Reply with quote

OK, now my earlier problems seem removed, but another one has shown up.

Code:
vaio init.d #  /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta
wlanconfig: ioctl: Invalid argument


I searched for this on the forums, but got no hits. Anyone have a clue?

Or maybe a hint where to look further?
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sun Dec 04, 2005 6:12 pm    Post subject: Reply with quote

cajzell wrote:
OK, now my earlier problems seem removed, but another one has shown up.

Code:
vaio init.d #  /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta
wlanconfig: ioctl: Invalid argument


I searched for this on the forums, but got no hits. Anyone have a clue?

Or maybe a hint where to look further?


More than likly it's already been created. The command assumes that there is no ath0. I need to look into a way of detecting whether ath0 has been created and destroy if it is has. Basically, atm, if ath0 failes to start properley, ath0 isn't destroyed. So, when you come to re-start it, the preup then fails as ath0 has been started.

Just run:

Code:
# wlanconfig ath0 destroy


and you should be able to run net.ath0 start again.
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
cajzell
Apprentice
Apprentice


Joined: 07 Jan 2004
Posts: 176
Location: Falkenberg, Sweden

PostPosted: Sun Dec 04, 2005 8:47 pm    Post subject: Reply with quote

Thanks again,

you're right, I hve to destroy it every time I recheck.

It seems we are getting closer and closer, now the wpa_supplicant times out. I got it to connect when disabling the WEP authentication, but when I enable it on the AP, the wpa_supplicant times out. So, my question is, unsing another machine, I have the configuration:

Code:

key_bongofury="12345678901234567890240123456 enc restricted"
config_bongofury=( "dhcp" )
preferred_aps=( "bongofury" "ESSID 2" )


And I have my wpa_supplicant.conf

Code:
network={
        ssid="bongofury"
        key_mgmt=NONE
#        psk=""
        wep_key1=12345678901234567890240123456
        priority=5
        auth_alg=SHARED
        }


I've tried with/without auth_alg=SHARED. How should I get the corresponding authentication with wpa_supplicant?
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sun Dec 04, 2005 9:08 pm    Post subject: Reply with quote

I did notice that it takes alot longer to create the WPA tunnel with this new system compared to the old one (~5s verses ~25s now). I had to up the timeout from 10 to 60 seconds to get it to work.

This is my wpa_supplicant.conf

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1
fast_reauth=1


network={
        ssid="Avalon"
        scan_ssid=1
        proto=WPA
        key_mgmt=WPA-PSK
        psk="thisisnottherealkey!"
        priority=1
        pairwise=CCMP TKIP
        group=CCMP TKIP
}

_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
Pandor
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2005
Posts: 128
Location: Belgium

PostPosted: Sun Dec 04, 2005 10:17 pm    Post subject: Reply with quote

Great work m8.

I'm pretty new to gentoo and after reading some horror stories about wpa_supplicant/madwifi from portage i decided to compile them from source myself and figure out later how to add them to my local portage (got it up and running in under 30 min BTW.).
So you saved my quite some time figuring it out on my own, thx!
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Sun Dec 04, 2005 10:36 pm    Post subject: Reply with quote

Good news - thanks.
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
djnauk
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 183
Location: Caerphilly, Wales, UK

PostPosted: Mon Dec 05, 2005 12:14 am    Post subject: Reply with quote

I've updated the guide to 1.1 now.
_________________
Jonathan Wright (Technical Director, JAB Web Solutions)

UK Hosting & Reseller Hosting from JAB Web Solutions
Back to top
View user's profile Send private message
Pandor
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2005
Posts: 128
Location: Belgium

PostPosted: Mon Dec 05, 2005 12:33 am    Post subject: Re: wpa_supplicant 0.4.7, kernel 2.6.14 & madwifi-ng all Reply with quote

djnauk wrote:
...

If you haven't created the directories for the various tools yet, run the following command. This will create the net-wireless group directory and a directory for each of programs:

Code:
# mkdir -p /usr/local/portage/{madwifi-tools,madwifi-driver,wpa_supplicant}


I believe you're missing the 'net-wireless' in your path here... :wink:

Also noticed this:
djnauk wrote:

Second, we need to modify the CFLAGS variable. The location of the headers from the new madwifi builds are different that the older ones, and although the wpa_supplicant build can compile the new driver in, it's not looking in the new directory. It still assumes the files are in /usr/include when they're now in /usr/include/madwifi. This can be done by adding the following line at the top (i.e. ~line 3) of the ebuild:

Code:
CFLAGS="$CFLAGS -I/usr/local/madwifi"

You say the headers are now located in /usr/include/madwifi but you seem to pass "$CFLAGS -I/usr/local/madwifi".
typo? or am i missing something...

And something else i found:
I remember setting the path to opensll when i compiled wpa_supplicant by hand, but this seems to be missing from the ebuild.

from the wpa_supplicant defconfig file:
Quote:
# Uncomment following two lines and fix the paths if you have installed openssl
# in non-default location
#CFLAGS += -I/usr/local/openssl/include
#LIBS += -L/usr/local/openssl/lib


this is what it should be (afaik):
Code:
# Uncomment following two lines and fix the paths if you have installed openssl
# in non-default location
CFLAGS += -I/usr/include/openssl
LIBS += -L/usr/lib




from the wpa_supplicant README:
Quote:
Optional libraries for EAP-TLS, EAP-PEAP, and EAP-TTLS:
- openssl (tested with 0.9.7c and 0.9.7d, assumed to work with most
relatively recent versions; this is likely to be available with most
distributions, http://www.openssl.org/)

This library is only needed when EAP-TLS, EAP-PEAP, or EAP-TTLS
support is enabled. WPA-PSK mode does not require this or EAPOL/EAP
implementation. A configuration file, .config, for compilation is
needed to enable IEEE 802.1X/EAPOL and EAP methods. Note that EAP-MD5,
EAP-GTC, EAP-OTP, and EAP-MSCHAPV2 cannot be used alone with WPA, so
they should only be enabled if testing the EAPOL/EAP state
machines. However, there can be used as inner authentication
algorithms with EAP-PEAP and EAP-TTLS.


from the ebuild:
Code:
        if use ssl; then
                # SSL authentication methods
                echo "CONFIG_EAP_LEAP=y"     >> ${CONFIG}
                echo "CONFIG_EAP_MSCHAPV2=y" >> ${CONFIG}
                echo "CONFIG_EAP_PEAP=y"     >> ${CONFIG}
                echo "CONFIG_EAP_TLS=y"      >> ${CONFIG}
                echo "CONFIG_EAP_TTLS=y"     >> ${CONFIG}
                echo "CONFIG_SMARTCARD=y"    >> ${CONFIG}

Maybe we should file a bugreport?
afaik when the ssl flag is used, it should set the openssl paths, because the defaults (see defconfig above) is not correct.
Back to top
View user's profile Send private message
ianwilder
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2004
Posts: 121
Location: georgia.usa.earth

PostPosted: Mon Dec 05, 2005 1:35 am    Post subject: Reply with quote

wonderful guide. thanks!

i'm completely new to this wireless thing, and i've found everything in your guide to work wonderfully, except when i try and run this part:

Code:
/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta


i get this:

Code:
wlanconfig: ioctl: No such device


any ideas?

iwconfig gives me the right thing, and ath_pci is loaded....

i'm using the madwifi-driver-cvs ebuild, since the pre20051130 one doesn't compile for gcc 4.1. i then thought, well since my iwconfig says ath0, maybe they changed things and now they _do_ use ath0. so i removed all the conf.d/net stuff and tried starting init.d/net.ath0. this time my card started blinking on the network icon but i got this after a little bit:

Code:
 *   Couldn't associate with any access points on ath0
 *   Failed to configure wireless for ath0                                [ !! ]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum