# RT61 RALINK-RT61 and RT2500 emerge FAILS

## Xtender

Hello!

Wanted to setup my wireless card 

```
05:00.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
```

 but can not emerge any of it's drivers:

```
ASUS-GENTOO log # emerge rt61

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-wireless/rt61-1.1.0_beta2 to /

 * rt61-1.1.0-b2.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                 [ ok ]

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

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

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

 * checking rt61-1.1.0-b2.tar.gz ;-) ...                                                                                [ 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 rt61-1.1.0-b2.tar.gz to /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2 ...

 * Preparing rt61 module

make[1]: Entering directory `/usr/src/linux-2.6.24-gentoo-r4'

  CC [M]  /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.o

  CC [M]  /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/mlme.o

  CC [M]  /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/connect.o

  CC [M]  /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/assoc.o

  CC [M]  /var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/sync.o

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/mlme.c: In function 'MlmeEnqueueForRecv':

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/mlme.c:3297: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c: In function 'RT61_probe':

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:222: error: implicit declaration of function 'SET_MODULE_OWNER'

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c: In function 'RT61_open':

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:405: error: 'SA_SHIRQ' undeclared (first use in this function)

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:405: error: (Each undeclared identifier is reported only once

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:405: error: for each function it appears in.)

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c: In function 'rt61_resume':

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:1000: warning: ignoring return value of 'pci_enable_device', declared with attribute warn_unused_result

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c: In function 'rt61_init_module':

/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.c:1044: error: implicit declaration of function 'pci_module_init'

make[3]: *** [/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module/rtmp_main.o] Error 1

make[3]: *** Waiting for unfinished jobs....

make[2]: *** [_module_/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/work/rt61-1.1.0-b2/Module] Error 2

make[1]: *** [sub-make] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.24-gentoo-r4'

rt61.ko failed to build!

make: *** [module] Error 1

 *

 * ERROR: net-wireless/rt61-1.1.0_beta2 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3133:  Called linux-mod_src_compile

 *             environment, line 2402:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=  KERNDIR=/usr/src/linux KERNOUT=/lib/modules/2.6.24-gentoo-r4/build clean module

 *

 * 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/rt61-1.1.0_beta2/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/temp/environment'.

 *

 * Messages for package net-wireless/rt61-1.1.0_beta2:

 *

 * ERROR: net-wireless/rt61-1.1.0_beta2 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3133:  Called linux-mod_src_compile

 *             environment, line 2402:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=  KERNDIR=/usr/src/linux KERNOUT=/lib/modules/2.6.24-gentoo-r4/build clean module

 *

 * 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/rt61-1.1.0_beta2/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/rt61-1.1.0_beta2/temp/environment'.
```

 *

```
ASUS-GENTOO log # emerge ralink-rt61

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-wireless/ralink-rt61-1.1.1.0 to /

 * IS_Linux_STA_6x_D_1.1.1.0.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                     [ ok ]

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

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

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

 * checking IS_Linux_STA_6x_D_1.1.1.0.tar.gz ;-) ...                                                                    [ 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 IS_Linux_STA_6x_D_1.1.1.0.tar.gz to /var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/work/IS_Linux_STA_6x_D_1.1.1.0 ...

 * Applying rtmp_main.diff ...                                                                                          [ ok ]

 * Preparing rt61 module

make -C /lib/modules/2.6.24-gentoo-r4/build SUBDIRS=/var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/work/IS_Linux_STA_6x_D_1.1.1.0/Module modules

make[1]: Entering directory `/usr/src/linux-2.6.24-gentoo-r4'

make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.

scripts/Makefile.build:46: *** CFLAGS was changed in "/var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/work/IS_Linux_STA_6x_D_1.1.1.0/Module/Makefile". Fix it to use EXTRA_CFLAGS.  Stop.

make[1]: *** [_module_/var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/work/IS_Linux_STA_6x_D_1.1.1.0/Module] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.24-gentoo-r4'

make: *** [all] Error 2

 *

 * ERROR: net-wireless/ralink-rt61-1.1.1.0 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3138:  Called linux-mod_src_compile

 *             environment, line 2402:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=

 *

 * 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/ralink-rt61-1.1.1.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/temp/environment'.

 *

 * Messages for package net-wireless/ralink-rt61-1.1.1.0:

 *

 * ERROR: net-wireless/ralink-rt61-1.1.1.0 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3138:  Called linux-mod_src_compile

 *             environment, line 2402:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=

 *

 * 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/ralink-rt61-1.1.1.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/ralink-rt61-1.1.1.0/temp/environment'.

 * 
```

```
ASUS-GENTOO log # emerge rt2500

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-wireless/rt2500-1.1.0_pre2007071515 to /

 * rt2500-1.1.0_pre2007071515.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                    [ ok ]

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

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

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

 * checking rt2500-1.1.0_pre2007071515.tar.gz ;-) ...                                                                   [ 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 rt2500-1.1.0_pre2007071515.tar.gz to /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515 ...

 * Preparing rt2500 module

make: Entering directory `/usr/src/linux-2.6.24-gentoo-r4'

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/mlme.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/connect.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/sync.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/assoc.o

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c: In function 'RT2500_probe':

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c:254: error: implicit declaration of function 'SET_MODULE_OWNER'

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c: In function 'RT2500_open':

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c:395: error: 'SA_SHIRQ' undeclared (first use in this function)

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c:395: error: (Each undeclared identifier is reported only once

/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.c:395: error: for each function it appears in.)

make[1]: *** [/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module/rtmp_main.o] Error 1

make[1]: *** Waiting for unfinished jobs....

make: *** [_module_/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module] Error 2

make: Leaving directory `/usr/src/linux-2.6.24-gentoo-r4'

 *

 * ERROR: net-wireless/rt2500-1.1.0_pre2007071515 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3140:  Called linux-mod_src_compile

 *             environment, line 2403:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=  -C /usr/src/linux M=/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module modules

 *

 * 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/rt2500-1.1.0_pre2007071515/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/temp/environment'.

 *

 * Messages for package net-wireless/rt2500-1.1.0_pre2007071515:

 *

 * ERROR: net-wireless/rt2500-1.1.0_pre2007071515 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3140:  Called linux-mod_src_compile

 *             environment, line 2403:  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=i686-pc-linux-gnu-gcc CC=i686-pc-linux-gnu-gcc LDFLAGS=  -C /usr/src/linux M=/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/work/rt2500-cvs-2007071515/Module modules

 *

 * 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/rt2500-1.1.0_pre2007071515/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/rt2500-1.1.0_pre2007071515/temp/environment'.

 *
```

I got it working in FreeBSD, but I'm new to gentoo and don't know what to do, as I believe all HOWTOs include emerging one of the mentioned drivers.

----------

## Angryguy

I had the same issue when upgrading kernels last week.  The rt61 package no longer works with the current kernels.

The rt61 driver is now included in the kernel, although there aren't any concise install directions around yet.

https://forums.gentoo.org/viewtopic-t-652112-highlight-.html has some useful information (and an example of how searching these boards can be useful).

http://gentoo-wiki.com/HARDWARE_rt2x00 has good directions on which options to enable in the kernel.

After compiling the kernel with support for the card, you will need to download the Firmware RT2501(RT2561/RT2661) from http://www.ralinktech.com/ralink/Home/Support/Linux.html and extract the files to /lib/firmware.

I'm still working on trying to configure the card reliably with DHCP and WEP, as of now I have to manually configure the card after the system has booted to get things working.

----------

