# gentoo-sources-2.6.24 and madwifi-ng problems..

## Simba7

Well, maybe upgrading early was a dumb idea..

I've been updating everything and MadWiFi threw a massive fit.. Here's the error I have:

```
>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/work/madwifi-0.9.3.3 ...

 * Preparing ath_hal module

../scripts/get_arch.mk:44: *** ARCH mismatch: supplied "x86", determined "i386".  Stop.

 *

 * ERROR: net-wireless/madwifi-ng-0.9.3.3 failed.

 * Call stack:

 *               ebuild.sh, line   46:  Called src_compile

 *             environment, line 3115:  Called linux-mod_src_compile

 *             environment, line 2370:  Called die

 * The specific snippet of code:

 *               emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} || diefunc "$FUNCNAME" "$LINENO" "$?" "Unable to make ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}.";

 *  The die message:

 *   Unable to make  KERNELPATH=/usr/src/linux all.

 *

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/environment'.

 *
```

I hope someone can help me out with this, it basically killed the Wireless AP in my router/firewall until I can fix it.

----------

## jrtayloriv

did you change the 'march=' setting in your CFLAGS in /etc/make.conf ?

----------

## Simba7

Nope.. Didn't change anything.. Here's my CFLAGS line:

CFLAGS="-O2 -march=pentium2 -pipe"

Worked fine in .23-r6

----------

## Monkeh

2.6.24 had some significant changes for x86/x86_64 (it's all now x86 instead of i386 and x86_64), so you'll need to grab the latest madwifi out of their SVN repo.

----------

## DtZ

You can also try this patch:

```

diff -ur madwifi-0.9.3.3.orig/ath_hal/ah_target.inc madwifi-0.9.3.3/ath_hal/ah_target.inc

--- madwifi-0.9.3.3.orig/ath_hal/ah_target.inc  2006-11-18 00:34:30.000000000 +0100

+++ madwifi-0.9.3.3/ath_hal/ah_target.inc       2008-01-25 20:34:35.000000000 +0100

@@ -37,5 +37,7 @@

 TARGET-$(CONFIG_CPU_SA110) = xscale-$(ENDIAN)-elf

 TARGET-$(CONFIG_CPU_SA1100) = xscale-$(ENDIAN)-elf

 TARGET-$(CONFIG_CPU_XSCALE) = xscale-$(ENDIAN)-elf

+TARGET-$(CONFIG_X86_64) = x86_64-elf

+TARGET-$(CONFIG_X86_32) = i386-elf

 TARGET = $(if $(TARGET-y),$(TARGET-y),$(ARCH)-elf)

diff -ur madwifi-0.9.3.3.orig/scripts/get_arch.mk madwifi-0.9.3.3/scripts/get_arch.mk

--- madwifi-0.9.3.3.orig/scripts/get_arch.mk    2006-11-15 08:24:13.000000000 +0100

+++ madwifi-0.9.3.3/scripts/get_arch.mk 2008-01-25 20:32:23.000000000 +0100

@@ -9,7 +9,7 @@

 ARCH-$(CONFIG_CRIS) = cris

 ARCH-$(CONFIG_FRV) = frv

 ARCH-$(CONFIG_H8300) = h8300

-ARCH-$(CONFIG_X86) = i386

+ARCH-$(CONFIG_X86) = x86

 ARCH-$(CONFIG_IA64) = ia64

 ARCH-$(CONFIG_M32R) = m32r

 ARCH-$(CONFIG_M68K) = m68k

@@ -29,7 +29,7 @@

 ARCH-$(CONFIG_SPARC64) = sparc64

 ARCH-$(CONFIG_UML) = um

 ARCH-$(CONFIG_V850) = v850

-ARCH-$(CONFIG_X86_64) = x86_64

+ARCH-$(CONFIG_X86_64) = x86

 ARCH-$(CONFIG_XTENSA) = xtensa

 ifeq (,$(ARCH-y))

```

It works on my amd64 laptop. Shoul also work for i386.

----------

## max-232

Thanks a lot!

it worked for me!!

----------

## genmich

it seems that 0.9.4 is coming out soon. RC 1 just released (http://article.gmane.org/gmane.linux.drivers.madwifi.devel/5861)

----------

## thagame

I have the same issue but dont really want to use svn if i can help it. ill wait for the 0.9.4 ebuild.

----------

## sundialsvc4

Do we have a timeframe for this?  I'd really like to put on the current kernel-version to cover for some of the recent vulnerabilities.

----------

## Magistrat

Thank you for the patch DtZ !

----------

## sOuLjA

version 0.9.4 also did that trick

----------

## hujuice

The patch written by Dtz completely solve the problem.

Folks don't wanting to upgrade to unstable should follow this HOW-TO to apply the patch.

Thanks Dtz

----------

## Lonsas

I can't get the patch to work, probably am I just bad but here is the content of .out file from the patch:

```

***** madwifi-2.6.24-k.patch *****

==================================

PATCH COMMAND:   patch -p0 -g0 -E --no-backup-if-mismatch < /usr/local/portage/net-wireless/madwifi-ng/files/madwifi-2.6.24-k.patch

==================================

can't find file to patch at input line 4

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/ath_hal/ah_target.inc madwifi-0.9.3.3/ath_hal/ah_target.inc

|--- madwifi-0.9.3.3.orig/ath_hal/ah_target.inc  2006-11-18 00:34:30.000000000 +0100

|+++ madwifi-0.9.3.3/ath_hal/ah_target.inc       2008-01-25 20:34:35.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

1 out of 1 hunk ignored

can't find file to patch at input line 15

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/scripts/get_arch.mk madwifi-0.9.3.3/scripts/get_arch.mk

|--- madwifi-0.9.3.3.orig/scripts/get_arch.mk    2006-11-15 08:24:13.000000000 +0100

|+++ madwifi-0.9.3.3/scripts/get_arch.mk 2008-01-25 20:32:23.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

==================================

PATCH COMMAND:   patch -p1 -g0 -E --no-backup-if-mismatch < /usr/local/portage/net-wireless/madwifi-ng/files/madwifi-2.6.24-k.patch

==================================

patching file ath_hal/ah_target.inc

Hunk #1 FAILED at 37.

1 out of 1 hunk FAILED -- saving rejects to file ath_hal/ah_target.inc.rej

patching file scripts/get_arch.mk

Hunk #1 FAILED at 9.

Hunk #2 FAILED at 29.

2 out of 2 hunks FAILED -- saving rejects to file scripts/get_arch.mk.rej

==================================

PATCH COMMAND:   patch -p2 -g0 -E --no-backup-if-mismatch < /usr/local/portage/net-wireless/madwifi-ng/files/madwifi-2.6.24-k.patch

==================================

can't find file to patch at input line 4

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/ath_hal/ah_target.inc madwifi-0.9.3.3/ath_hal/ah_target.inc

|--- madwifi-0.9.3.3.orig/ath_hal/ah_target.inc  2006-11-18 00:34:30.000000000 +0100

|+++ madwifi-0.9.3.3/ath_hal/ah_target.inc       2008-01-25 20:34:35.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

1 out of 1 hunk ignored

can't find file to patch at input line 15

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/scripts/get_arch.mk madwifi-0.9.3.3/scripts/get_arch.mk

|--- madwifi-0.9.3.3.orig/scripts/get_arch.mk    2006-11-15 08:24:13.000000000 +0100

|+++ madwifi-0.9.3.3/scripts/get_arch.mk 2008-01-25 20:32:23.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

==================================

PATCH COMMAND:   patch -p3 -g0 -E --no-backup-if-mismatch < /usr/local/portage/net-wireless/madwifi-ng/files/madwifi-2.6.24-k.patch

==================================

missing header for unified diff at line 4 of patch

can't find file to patch at input line 4

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/ath_hal/ah_target.inc madwifi-0.9.3.3/ath_hal/ah_target.inc

|--- madwifi-0.9.3.3.orig/ath_hal/ah_target.inc  2006-11-18 00:34:30.000000000 +0100

|+++ madwifi-0.9.3.3/ath_hal/ah_target.inc       2008-01-25 20:34:35.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

1 out of 1 hunk ignored

missing header for unified diff at line 15 of patch

can't find file to patch at input line 15

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/scripts/get_arch.mk madwifi-0.9.3.3/scripts/get_arch.mk

|--- madwifi-0.9.3.3.orig/scripts/get_arch.mk    2006-11-15 08:24:13.000000000 +0100

|+++ madwifi-0.9.3.3/scripts/get_arch.mk 2008-01-25 20:32:23.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

==================================

PATCH COMMAND:   patch -p4 -g0 -E --no-backup-if-mismatch < /usr/local/portage/net-wireless/madwifi-ng/files/madwifi-2.6.24-k.patch

==================================

missing header for unified diff at line 4 of patch

can't find file to patch at input line 4

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/ath_hal/ah_target.inc madwifi-0.9.3.3/ath_hal/ah_target.inc

|--- madwifi-0.9.3.3.orig/ath_hal/ah_target.inc  2006-11-18 00:34:30.000000000 +0100

|+++ madwifi-0.9.3.3/ath_hal/ah_target.inc       2008-01-25 20:34:35.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

1 out of 1 hunk ignored

missing header for unified diff at line 15 of patch

can't find file to patch at input line 15

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -ur madwifi-0.9.3.3.orig/scripts/get_arch.mk madwifi-0.9.3.3/scripts/get_arch.mk

|--- madwifi-0.9.3.3.orig/scripts/get_arch.mk    2006-11-15 08:24:13.000000000 +0100

|+++ madwifi-0.9.3.3/scripts/get_arch.mk 2008-01-25 20:32:23.000000000 +0100

--------------------------

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

```

Hope someone can make me understand what I'm doing wrong.

Edit: Nevermind, used the 0.9.4 instead

----------

## Pieeeee

Yeah, I had the same problem, just unmask 0.9.4 and use that  :Smile: 

----------

## cwc

 *Pieeeee wrote:*   

> Yeah, I had the same problem, just unmask 0.9.4 and use that 

 

How do you unmask 0.9.4 ? 

What did you emerge to get 0.9.4  to work?

----------

## regomodo

Hmm. Just tried to install the same thing and get all these errors. Very disappointing. Haven't the time to try the patch at the moment

----------

## DtZ

This patch is no longer necessary. Just use madwifi-ng-0.9.4 from portage. It compiles and works fine with 2.6.24 kernels.

----------

## regomodo

ok, everything is up to date and i am following this guide and when i try emerge madwifi-ng i get this

```
gentoo-pc jon # emerge madwifi-ng

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-wireless/madwifi-ng-0.9.3.3 to /

 * madwifi-0.9.3.3.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                                                                                        [ ok ]

 * checking ebuild checksums ;-) ...                                                                                                                                                              [ ok ]

 * checking auxfile checksums ;-) ...                                                                                                                                                             [ ok ]

 * checking miscfile checksums ;-) ...                                                                                                                                                            [ ok ]

 * checking madwifi-0.9.3.3.tar.bz2 ;-) ...                                                                                                                                                       [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.24-gentoo-r4/build

 * Found sources for kernel version:

 *     2.6.24-gentoo-r4

 * Checking for suitable kernel configuration options...                                                                                                                                          [ ok ]

>>> Unpacking source...

>>> Unpacking madwifi-0.9.3.3.tar.bz2 to /var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/work

 * Applying madwifi-ng-0.9.3-uudecode-gcda-fix.patch ...                                                                                                                                          [ ok ]

 * Converting madwifi-0.9.3.3/ath/Makefile to use M= instead of SUBDIRS= ...                                                                                                                      [ ok ]

 * Converting madwifi-0.9.3.3/ath_hal/Makefile to use M= instead of SUBDIRS= ...                                                                                                                  [ ok ]

 * Converting madwifi-0.9.3.3/net80211/Makefile to use M= instead of SUBDIRS= ...                                                                                                                 [ ok ]

 * Converting madwifi-0.9.3.3/ath_rate/Makefile to use M= instead of SUBDIRS= ...                                                                                                                 [ ok ]

 * Converting madwifi-0.9.3.3/ath_rate/amrr/Makefile to use M= instead of SUBDIRS= ...                                                                                                            [ ok ]

 * Converting madwifi-0.9.3.3/ath_rate/onoe/Makefile to use M= instead of SUBDIRS= ...                                                                                                            [ ok ]

 * Converting madwifi-0.9.3.3/ath_rate/sample/Makefile to use M= instead of SUBDIRS= ...                                                                                                          [ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/work/madwifi-0.9.3.3 ...

 * Preparing ath_hal module

.[b]./scripts/get_arch.mk:44: *** ARCH mismatch: supplied "x86", determined "x86_64".  Stop.[/b]

 *

 * ERROR: net-wireless/madwifi-ng-0.9.3.3 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3234:  Called linux-mod_src_compile

 *             environment, line 2474:  Called die

 * The specific snippet of code:

 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\"                                               CC=\"$(get-KERNEL_CC)\"                                                 LDFLAGS=\"$(get_abi_LDFLAGS)\"                                          ${BUILD_FIXES}                                          ${BUILD_PARAMS}                                                 ${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 *  The die message:

 *   Unable to emake HOSTCC=x86_64-pc-linux-gnu-gcc CC=x86_64-pc-linux-gnu-gcc LDFLAGS=  KERNELPATH=/lib/modules/2.6.24-gentoo-r4/build all

 *

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/environment'.

 *

 * Messages for package net-wireless/madwifi-ng-0.9.3.3:

 *

 * ERROR: net-wireless/madwifi-ng-0.9.3.3 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3234:  Called linux-mod_src_compile

 *             environment, line 2474:  Called die

 * The specific snippet of code:

 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\"                                               CC=\"$(get-KERNEL_CC)\"                                                 LDFLAGS=\"$(get_abi_LDFLAGS)\"                                          ${BUILD_FIXES}                                          ${BUILD_PARAMS}                                                 ${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CC="$(get-KERNEL_CC)" LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 *  The die message:

 *   Unable to emake HOSTCC=x86_64-pc-linux-gnu-gcc CC=x86_64-pc-linux-gnu-gcc LDFLAGS=  KERNELPATH=/lib/modules/2.6.24-gentoo-r4/build all

 *

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3/temp/environment'.

```

Last edited by regomodo on Mon Apr 14, 2008 11:42 am; edited 1 time in total

----------

## cwc

I was able to get the dhcpcd experimental make files from UberLord.

It works likes a charm with eth0 and ath0.

I got my madwifi to work with the available ebuilds.

I also built a kernel 3 or 4 times until I got things to work.

Here is a list of my ebuilds in /usr/partage/distfiles/

tma distfiles # ll sha*

-rw-rw-r-- 1 root portage 306022 Apr  3 18:27 sharutils-4.2.1.tar.gz

-rw-r--r-- 1 root portage 661062 Apr  5 18:55 sharutils-4.6.3-doc.tar.gz

-rw-r--r-- 1 root portage 629732 Apr  5 06:43 sharutils-4.6.3.tar.bz2

tma distfiles # ll mad*

-rw-r--r-- 1 root portage 3488269 Apr  6 15:38 madwifi-0.9.3.1.tar.bz2

-rw-r--r-- 1 root portage 3489208 Apr  6 15:38 madwifi-0.9.3.2.tar.bz2

-rw-rw-r-- 1 root portage 3489995 Apr  5 06:50 madwifi-0.9.3.3.tar.bz2

-rw-rw-r-- 1 root portage 3488332 Apr  5 06:50 madwifi-0.9.3.tar.bz2

-rw-r--r-- 1 root portage 3485142 Apr  6 15:38 madwifi-0.9.4.tar.bz2

-rw-r--r-- 1 root portage 2102954 Apr  6 15:38 madwifi-old-r1417-20060128.tar.gz

I can' recall where I got 

-rw-r--r-- 1 root portage 2102954 Apr  6 15:38 madwifi-old-r1417-20060128.tar.gz

If you want them I can put dhcpcd-exp.tar on a server rather than email.

----------

## ciberfred

someone could look at madwifi-ng and madwifi-ng-tools bug to have it in x86 and amd64 stable branche ?

as 0.9.4 seems working with kernel-2.6.24

----------

