# Problems with ralink-rt61 build scripts

## Dr. Frankenbox

I'm trying to get a Rosewill-built wireless card with (I think) an rt61 chipset working for a homemade wireless access point (yes, probably a poor choice of card, I know).  When I try to install the ralink-rt61 package to install firmware for the card (drivers are already compiled into my kernel), I get the following errors:

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.27-gentoo-r7'

make: *** [all] Error 2

This occurs after "Compiling source," so it looks like the problem is in the build scripts, not the ebuild.  I get the same errors with version 1.1.0.0.  Can anybody shed some light on this problem?

----------

## jettjunker

I don't recall if I had the same problem as you, but I had some problem with the kernel version.  Also, the portage version doesn't (or at least didn't) support newer kernels, >=2.6.24.  But, there's a good bugbuild that I used, here:

https://bugs.gentoo.org/show_bug.cgi?id=222375

If no one else responds with an idea of how to get rt61pci (kernel version) working, I'd give it a try.

----------

## Dr. Frankenbox

Wow, that's so far above my level I barely know where to start.  My best guess was to copy the ebuild into the appropriate directory under /usr/portage and use the ebuild utility to run it.  Of course, ebuild complained that there was no digest for that file, and I have no idea how to generate that.

Just in case anybody is interested in my problems with the in-kernel driver (which I did try first), this is what happens when I try to enable the card using the in-kernel driver:

 * Starting wlan0

SIOCSIFFLAGS: No such file or directory

SIOCSIFFLAGS: No such file or directory

SIOCSIFFLAGS: No such file or directory

 *   Configuring wireless network for wlan0

 *   Failed to configure wireless for wlan0                               [ !! ]

accompanied by the kernel messages:

firmware: requesting rt2561s.bin

phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware.

phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware.

phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware.

My search for this apparently missing firmware is what brought me to the ralink-rt61 package.

----------

## jettjunker

Ah, I'll walk you through it.  If you need more details, you can get more info here: http://www.gentoo-wiki.info/HOWTO_Installing_3rd_Party_Ebuilds, but notice that I use a slightly different folder setup (subfolder "bugzilla") for better organization.

First, modify your /etc/make.conf to recognize the ebuilds that aren't in the portage tree.  This can be done by adding the following line:

```
PORTDIR_OVERLAY="/usr/local/portage/bugzilla"
```

(Note: If you use layman, you already have a line "source /usr/local/portage/layman/make.conf" in your /etc/make.conf, in which case you should modify that make.conf to add the directory /usr/local/portage/bugzilla to the list).

Second, create that folder (/usr/local/portage/bugzilla), and the subdirectories you need: /usr/local/portage/bugzilla/net-wireless/ralink-rt61/files/

Third, save the most recent ebuild.  In this case, save ralink-rt61-1.1.2.2-r2.ebuild from my link above to /usr/local/portage/bugzilla/net-wireless/ralink-rt61/

Fourth, save the files/patches needed.  In this case, save Makefile.diff, extra_cflags.patch (not sure if needed though), and rtmp_info.diff (for 2.6.27) into /usr/local/portage/bugzilla/net-wireless/ralink-rt61/files/

Fifth, digest the ebuild: 

```
ebuild /usr/local/portage/bugzilla/net-wireless/ralink-rt61/ralink-rt61-1.1.2.2-r2.ebuild digest
```

Sixth, if needed update your /etc/portage/package.keywords to allow the new build.  In this case, net-wireless/ralink-rt61 ~amd64 #or whatever architecture

And finally, emerge -av ralink-rt61 #(and portage should alert you that it's coming from the overlay).

----------

## waldauf

i have ralink-rt61 too and works fine. i want to build access point but i haven't time now. but imporant is that it works.

i have kernel sys-kernel/gentoo-sources-2.6.25-r6 (i can't use newer). kernel is configured:

```

Device Drivers  --->

  [*] Network device support  --->

  Wireless LAN  --->

     [*] Wireless LAN (IEEE 802.11)

     <M>   Ralink driver support

         < > Ralink rt2400 pci/pcmcia support

         < > Ralink rt2500 pci/pcmcia support

         <M> Ralink rt61 pci/pcmcia support

```

IMPORTANT is that in kernel is not driver for this card. you have to download driver here , unpacked and copy in /lib/firmware. After setting kernel restart and try it load manualy:

```

  # modprobe rt61pci

```

----------

## Dr. Frankenbox

jettjunker: Thanks for the detailed walkthrough, but I've gotten "Failed Patch: Makefile.diff!" on two different versions of Makefile.diff, and I think I'm going to go try a different wireless card.  

waldauf:  That's exactly what I tried before posting here, and it didn't work for me.  I wonder if there's something different about Rosewill-built cards with this chipset.

Edit: I just discovered this thread.  I suppose I should direct my inquiries there.

----------

## waldauf

It is strange that it doesn't work. Onetime i tried set Ralink-rt61 in master mode but without access. Now i haven't time to solve it but next time i will buy better wirelesscard.

----------

