# Getting wifi USB card working in Gentoo

## minimal

I have a D-Link USB card, wua1340, and I'm trying to get it to work under Gentoo.  I stumbled across this on the ubuntu forums, would anyone be able to tell me if this would work on Gentoo?

 *Quote:*   

> enfact
> 
> March 18th, 2006, 12:31 AM
> 
> I just bought this card, D-Link WUA-1340, i am guessing it is a rt2500 card but i cant find a bit on it on the ndiswrapper wiki pages or anything. Its a newer card, i really hope im not SOL. The driver that comes with it on CD dosent have any infs on it, all exe's that extract the drivers and windows says the only driver files it uses are Dr71WU.sys... The file is signed "Ralink 801.11 USB Wireless Adapter Driver" version 1.0.1.0. I installed the sys file with ndiswrapper and it was "invalid"
> ...

 

and the response is...

 *Quote:*   

> 
> 
> saveryquinn
> 
> September 14th, 2006, 11:33 PM
> ...

 

----------

## NeddySeagoon

minimal,

ndiswrapper may work but if it is a ralink chipset, ralink and others provide drivers native linux drivers.

As far as I know there are ebilds availabale athough not in in the Gentoo Portage tree.

Please post the Vendor and Device IDs you get from lsusb for the device, of by looking in /proc/bus/usb/devices.

You need to connect the device. Then we can point you at the right ebuild.

----------

## minimal

 *NeddySeagoon wrote:*   

> minimal,
> 
> ndiswrapper may work but if it is a ralink chipset, ralink and others provide drivers native linux drivers.
> 
> As far as I know there are ebilds availabale athough not in in the Gentoo Portage tree.
> ...

 

I wish I could, but I'm on a computer at school and it's a 40 minute walk for me to get back home where the device is. Could you point me to a whole slew of possible drivers in the hopes that I can just download them all & one of them will work?

It is ralink I'm pretty sure of that.

----------

## minimal

ok, I found the drivers and downloaded them.  Now my question is what do I do with them? There's some .bins for the firmware, and there's some tarballed .c files and such.  Where do I put them to make it recognize the device?

----------

## NeddySeagoon

minimal,

They can mostly be emerged

There Ralink chipsets are covered by net-wireless/rt61, net-wireless/rt2500, net-wireless/rt2570 net-wireless/rt2x00

which are all in portage and net-wireless/rt73 which is in the Surrise overlay. One of them should work.

If not try ndiswrapper. Its man page tells you how to install the Windows XP drivers so it can use them.

There is a debian mailing list thread that says  Dr71WU.sys belongs to the Ralink rt73 chip, so start there.

I'm still interested in the Vendor and Device IDs. I had to add mine to the list to make my rt73 work.

Emerge layman and set it up, get the sunrise overlay, when everything is right, emerge rt73 will run.

============ edit ===========

I found the post you quoted in your original post.  It also says

```
lsusb:

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 002: ID 07d1:3c04 D-Link System

Bus 001 Device 001: ID 0000:0000
```

That device is not currently in the rt73 drivers list of known devices but I can add it if you would like to test.

Confirm the numbers first please.

----------

## minimal

 *NeddySeagoon wrote:*   

> minimal,
> 
> They can mostly be emerged
> 
> There Ralink chipsets are covered by net-wireless/rt61, net-wireless/rt2500, net-wireless/rt2570 net-wireless/rt2x00
> ...

 

ok I can't emerge because I don't have an internet connection to do it with.  For that I just get the tarballs into the /usr/portage/distfiles then unpack them?  Do I have to do anything else after that? What would be the code for that? (I'm a complete n00b)

Ok, how can I confirm those numbers for you? I'm absolutely positive the guy is talking about my same model of USB device though - and those are the numbers he got on ubuntu.  I don't know if that makes a difference or not.

Thanks for the help.

----------

## JAwuku

I'm having similar problems with the Sunrise e-build (net-wireless/rt73). I've got a Sitecom WL-113 002 (revision 002 uses the rt73 chipset), but the e-build does not have my USB wireless card listed.

When I type lsusb, the numbers 0df6:9712 come up:

```
Bus 001 Device 003: ID 0df6:9712 Sitecom Europe B.V.
```

I've tried to manually enter them into the patched file, but portage throws up errors.

How do you update the patch files to include new devices?

Or how would one compile the Ralink drivers?

Thanks in advance

----------

## NeddySeagoon

JAwuku,

I'll fix that if you want to test and tell me how it went, so I can put it back into Sunrise.

If it works, I'll give you a credit in the changelog to ... if you want.

minimal,

This post describes 'sneakernet' or how to emerge things without a direct internet connection.

----------

## NeddySeagoon

JAwuku,

You can get the new rt73 ebuild at http://dev.gentoo.org/~neddyseagoon/

It now includes your

```
 Device 003: ID 0df6:9712
```

as you can see from modinfo rt73 after you have built it, the output includes 

```
alias:          usb:v0DF6p9712d*dc*dsc*dp*ic*isc*ip*
```

Replace the net-wireless/rt73 directory you have in your overlay with the rt73 directory from the above location then emerge as normal.

Let me know how you get on.

----------

## NeddySeagoon

minimal,

The same manufactuers device can contain several different chipsets and manufactuers should change these numbers when they do that.

The Linux drivers will only try to work with devices that are in their Vendor and Device ID list.

Plug the device in and run the command  

```
grep -A3 endor /proc/bus/usb/devices
```

for each device in /proc/bus/usb/devices you will get four lines like this 

```
P:  Vendor=050d ProdID=705a Rev= 0.01

S:  Manufacturer=Belkin

S:  Product=Belkin 54g USB Network Adapter

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=300mA
```

 The fragment 'endor' will match Vendor or vendor.  Hopefully you can identify your USB network adaption for the list. I need the first line in the output which describes your device.

----------

## JAwuku

Thanks for your trouble NeddySeagoon!   :Smile: 

I made a local directory /usr/local/portage with the appropriate subdirectories as per the advice in the Gentoo Wiki:

http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds

and put your files in the /usr/local/portage tree.

then I tried to make the ebuild:

ebuild /usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild digest

ebuild /usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild unpack

ebuild /usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild compile

the compiling failed, with this result:

```
ebuild /usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild unpack

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz MD5 ;-) ...                           [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz RMD160 ;-) ...                        [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz SHA1 ;-) ...                          [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz SHA256 ;-) ...                        [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz size ;-) ...                          [ ok ]

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

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

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

 * checking RT73_Linux_STA_Drv1.0.3.6.tar.gz ;-) ...                      [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.18-gentoo

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

>>> Unpacking source...

>>> Unpacking RT73_Linux_STA_Drv1.0.3.6.tar.gz to /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work

tar: RT73_Linux_STA_Drv1.0.3.6: implausibly old time stamp 1970-01-01 01:00:00

 * Applying make6.patch ...                                               [ ok ]

 * Applying deviceID.patch ...                                            [ ok ]

>>> Source unpacked.

localhost bookiboo # ebuild /usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild compile

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz MD5 ;-) ...                           [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz RMD160 ;-) ...                        [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz SHA1 ;-) ...                          [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz SHA256 ;-) ...                        [ ok ]

 * RT73_Linux_STA_Drv1.0.3.6.tar.gz size ;-) ...                          [ ok ]

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

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

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

 * checking RT73_Linux_STA_Drv1.0.3.6.tar.gz ;-) ...                      [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.18-gentoo

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

>>> Checking RT73_Linux_STA_Drv1.0.3.6.tar.gz's mtime...

>>> WORKDIR is up-to-date, keeping...

>>> Compiling source in /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6 ...

 * Preparing rt73 module

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

  WARNING: Symbol version dump /usr/src/linux-2.6.18-gentoo/Module.symvers

           is missing; modules will have no dependencies and modversions.

In file included from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rt_config.h:99,

                 from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.c:40:

include/asm-i386/atomic.h:17: error: conflicting types for atomic_t

include/asm/atomic.h:24: error: previous declaration of atomic_t was here

include/asm-i386/atomic.h:46: error: conflicting types for atomic_add

include/asm/atomic.h:53: error: previous definition of atomic_add was here

include/asm-i386/atomic.h:61: error: conflicting types for atomic_sub

include/asm/atomic.h:68: error: previous definition of atomic_sub was here

include/asm-i386/atomic.h:78: error: conflicting types for atomic_sub_and_test

include/asm/atomic.h:85: error: previous definition of atomic_sub_and_test was here

include/asm-i386/atomic.h:95: error: conflicting types for atomic_inc

include/asm/atomic.h:102: error: previous definition of atomic_inc was here

include/asm-i386/atomic.h:108: error: conflicting types for atomic_dec

include/asm/atomic.h:116: error: previous definition of atomic_dec was here

include/asm-i386/atomic.h:123: error: conflicting types for atomic_dec_and_test

include/asm/atomic.h:132: error: previous definition of atomic_dec_and_test was here

include/asm-i386/atomic.h:142: error: conflicting types for atomic_inc_and_test

include/asm/atomic.h:151: error: previous definition of atomic_inc_and_test was here

include/asm-i386/atomic.h:162: error: conflicting types for atomic_add_negative

include/asm/atomic.h:171: error: previous definition of atomic_add_negative was here

include/asm-i386/atomic.h:180: error: conflicting types for atomic_add_return

include/asm/atomic.h:189: error: previous definition of atomic_add_return was here

include/asm-i386/atomic.h:206: error: conflicting types for atomic_sub_return

include/asm/atomic.h:199: error: previous definition of atomic_sub_return was here

In file included from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rt_config.h:99,

                 from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.c:40:

include/asm-i386/atomic.h:246:1: warning: "atomic_set_mask" redefined

In file included from include/asm/spinlock.h:4,

                 from include/linux/spinlock.h:86,

                 from include/linux/capability.h:45,

                 from include/linux/sched.h:44,

                 from include/linux/module.h:9,

                 from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rt_config.h:63,

                 from /var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.c:40:

include/asm/atomic.h:424:1: warning: this is the location of the previous definition

/var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.c: In function usb_rtusb_probe:

/var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.c:2085: warning: unused variable device

make[2]: *** [/var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module/rtmp_main.o] Error 1

make[1]: *** [_module_/var/tmp/portage/portage/net-wireless/rt73-1.0.3.6/work/RT73_Linux_STA_Drv1.0.3.6/Module] Error 2

make: *** [module] Error 2

!!! ERROR: net-wireless/rt73-1.0.3.6 failed.

Call stack:

  ebuild.sh, line 1568:   Called dyn_compile

  ebuild.sh, line 937:   Called src_compile

  rt73-1.0.3.6.ebuild, line 63:   Called linux-mod_src_compile

  linux-mod.eclass, line 482:   Called die

!!! Unable to make  KERNDIR=/usr/src/linux KERNOUT=/usr/src/linux clean module.

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

!!! This ebuild is from an overlay: '/usr/local/portage'
```

I'm going to compile the daily cvs driver to see if that loads ok.

Thanks again for your time and effort.

----------

## NeddySeagoon

JAwuku,

Post your 

```
emerge --info
```

please. I can on test it on IA32, its known broken on PPC and is untested on amd64.

It looks like your 2.6.18 kernel may have problems or its never been compiled.

What does 

```
uname -a
```

 show

----------

## JAwuku

Neddy,

Here is the output of emerge --info:

```
Portage 2.1.2_pre3-r9 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.18-gentoo x86_64)

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

System uname: 2.6.18-gentoo x86_64 AMD Athlon(tm) 64 Processor 3200+

Gentoo Base System version 1.12.4

Last Sync: Thu, 26 Oct 2006 18:00:01 +0000

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.4.3-r3

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r3

ACCEPT_KEYWORDS="amd64 ~amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=x86-64 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/NX/etc /usr/NX/home /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/share/config/kdm /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"

CXXFLAGS="-O2 -march=x86-64 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LANG="en_US.UTF-8"

LC_ALL="en_US.UTF-8"

LINGUAS="en it es de gr fr jp ga hu lt nb fi el pt ro ru sk sl sr sv zh_CN da ja en_GB nl pl zh_TW"

MAKEOPTS="-s -j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp/portage"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/sabayon /usr/portage/local/layman/portage-xgl /usr/portage/local/layman/gentopia"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 7zip X a52 aac aalib accessibility acpi ada alsa apache2 arts artswrappersuid asterisk audiofile avahi berkdb bitmap-fonts bluetooth browserplugin bzip2 cairo canvas cdda cdr cjk cli commercial cracklib crypt css cups dbus dga divx4linux djvu dlloader dri dts dvb dvd dvdr dvdread dvi eds elibc_glibc emboss encode evo exif exscalibar fat ffmpeg firefox flac foomatic-db foomaticdb fortran freetype fuse gcj gdbm gif gimpprint glitz glut gnokii gnome gnutls gphoto2 gpm gstreamer gtk gtk2 hal hfs ieee1394 imlib input_devices_acecad input_devices_aiptek input_devices_calcomp input_devices_citron input_devices_digitaledge input_devices_dmc input_devices_dynapro input_devices_elo2300 input_devices_elographics input_devices_evdev input_devices_fpit input_devices_hyperpen input_devices_jamstudio input_devices_joystick input_devices_keyboard input_devices_magellan input_devices_microtouch input_devices_mouse input_devices_mutouch input_devices_palmax input_devices_penmount input_devices_spaceorb input_devices_summa input_devices_synaptics input_devices_tek4957 input_devices_ur98 input_devices_vmmouse input_devices_void ipod ipv6 irda isdnlog jack java jfs joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kdgraphics kerberos kernel_linux kig-scripting ladspa lcd ldap libcaca linguas_da linguas_de linguas_el linguas_en linguas_en_GB linguas_es linguas_fi linguas_fr linguas_ga linguas_gr linguas_hu linguas_it linguas_ja linguas_jp linguas_lt linguas_nb linguas_nl linguas_pl linguas_pt linguas_ro linguas_ru linguas_sk linguas_sl linguas_sr linguas_sv linguas_zh_CN linguas_zh_TW lirc live livecd lm_sensors logitech-mouse lzw lzw-tiff mad mbrola mikmod mono mozcalendar moznocompose moznoirc moznomail mozsvg mp3 mpeg musepack musicbrainz nautilus ncurses nls nntp nptl nptlonly nsplugin ntfs nvidia ogg oggvorbis ole on-the-fly-crypt openexr opengl pam pam_chroot pam_timestamp pcmcia pcre pda pdf perforce perl php png portaudio postgres povray ppds pppd pwdb python qt qt3 qt4 quicktime rdesktop readline reflection reiser4 reiserfs remote rtsp ruby samba scanner sdl session shout skins smartcard sms sndfile soundtouch speedo speex spell spl sql sqlite ssl stats stream subversion svg symlink tcpd theora tiff timidity truetype truetype-fonts type1-fonts udev unichrome unicode usb userland_GNU v4l v4l2 vcd video_cards_apm video_cards_ark video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_fglrx video_cards_glint video_cards_i128 video_cards_i810 video_cards_mach64 video_cards_mga video_cards_neomagic video_cards_nv video_cards_nvidia video_cards_r128 video_cards_radeon video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo visualization vlm vorbis wifi wxwindows xfs xine xinerama xml xml2 xorg xpm xprint xscreensaver xv xvid xvmc zeroconf zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

my uname -a shows 

```
Linux localhost 2.6.18-gentoo #1 SMP Sun Oct 8 20:15:59 UTC 2006 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux
```

----------

## NeddySeagoon

JAwuku,

Can you try the rt73 driver without the ebuild to rule out the ebuild itself.

You need to get the file /usr/portage/distfiles/RT73_Linux_STA_Drv1.0.3.6.tar.gz and unpack it in your normal users home.

It will create a ./RT73_Linux_STA_Drv1.0.3.6 directory. There is a file thee with instructions.

If that builds, I've messed up the ebuild, if you get the same errors, its the Ralink provided sources.

You can apply the deviceID.patch by hand. It adds two lines close to the end of the file name in the header.

Its a simple copy and paste.

----------

## minimal

 *NeddySeagoon wrote:*   

> minimal,
> 
> The same manufactuers device can contain several different chipsets and manufactuers should change these numbers when they do that.
> 
> The Linux drivers will only try to work with devices that are in their Vendor and Device ID list.
> ...

 

Hey man, thanks for all the help btw.  Also, if it's a lot of work for the driver don't worry about it.  That being said, if you're still up for it I'd be much obliged, and here's the info...

```
P:  Vendor=07d1 ProdID=3c04 Rev= 0.01

S:  Manufacturer=Ralink

S:  Product=802.11 bg WLAN

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=300mA

```

----------

## NeddySeagoon

minimal,

It takes about 15 min to add a new device ID and upload the ebuild. All I can do by way of testing is comppile on an Athlon-XP and look at

```
modinfo rt73
```

to ensure the new Vendor and Device IDs are there. Please let me know if it works.

You can get the new rt73 ebuild at http://dev.gentoo.org/~neddyseagoon/

It now includes your 

```
alias:          usb:v07D1p3C04d*dc*dsc*dp*ic*isc*ip*
```

entry.

This is how the Gentoo community works - you are supposed to ask for things like this. If it works for you, it works for everyone else using that device too.

If you don't want to set up an overlay properly, while you test fetch the rt73 directory and put it in /usr/portage/net-wireless then do 

```
emerge rt73
```

However, it will be erased you your next 

```
emerge --sync
```

 if you do that.

----------

## minimal

 *NeddySeagoon wrote:*   

> minimal,
> 
> It takes about 15 min to add a new device ID and upload the ebuild. All I can do by way of testing is comppile on an Athlon-XP and look at
> 
> ```
> ...

 

what's an overlay?

I just got the info if it works I"ll be online later to let you know if it doesn't I might not get back to the school in time today to let you know but I will tomorrow.

----------

## NeddySeagoon

minimal,

Good luck.  

An overlay reproduces the structure of the offical portage tree, (empty directories not required) so that when portage is searching for ebuilds, it can search the offical tree and one or more overlays. The overlay(s) are not updated by 

```
emerge --sync
```

 so your only private ebuilds are safe there.

If you add 

```
PORTDIR_OVERLAY=/usr/local/portage
```

to /etc/make.conf and make the directory 

```
/usr/local/portage/net-wireless
```

you can put the rt73 directory there for portage to find when you do 

```
emerge rt73
```

notice the structure ... the offical tree has a net-wireless too. In the case the two net-wireless directories ovrlay one another.

----------

## minimal

 *NeddySeagoon wrote:*   

> minimal,
> 
> Good luck.  
> 
> An overlay reproduces the structure of the offical portage tree, (empty directories not required) so that when portage is searching for ebuilds, it can search the offical tree and one or more overlays. The overlay(s) are not updated by 
> ...

 

ok, now there's a whole slew of more problems. It started off and I moved the ebuild and such to the /usr/portage/net-wireless/rt73.  When I tried doing the emerge rt73 it told me it was a masked package.  So then I did emerge rt73.ebuild (or whatever the name of the file was).  Then, it would go for a while, then I got an error where it said something about 'make' and 'stop'.  Then it gave me this error saying unable to make directory or open directory or write to directory KERNILIN=/usr/src/linux KERNOUT=/usr/src/linux or something like that.  This is all off the top of my head so if there's a spelling mistake in there it's from memory.  So then I'm like hmm, maybe it's something to do with that directory.  So I go to /usr/src/linux and then I /.configure and make and make install or just make and make install don't remember.  So I did that, still didn't work, then I thought maybe it was because it was masked and I tried editing the ebuild and removing the ~ before x86 (which I'm on) and then tried to change the manifest to reflect the difference in size but then it failed the checksum.  Then I tried doing export KEYWORD=" " or whatever the keyword variable is that sets when something is masked or not.  Then, after all these things (and I don't remember the exact point when this error message started happening), when I try and emerge it now I get this...

```
emerge (1 of 1) net-wireless/rt73-1.0.3.6 to /

Traceback (most recent call last)

File "/usr/bin/emerge", line 3200 in ?

      mydepgraph.merge(mydepgraph.())

File "/usr/bin/emerge", line 1912, in merge

      retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug)

File "/usr/lib/portage/pym/portage.py", line 2682, in doebuild

       if not digestcheck(checkme, mysettings, ("strict" in features)):

File "/usr/lib/portage/pym/portage.py", line 2250, in digestcheck

       mymdigests=digestParseFIle(manifestfn)

File "/usr/lib/portage/pym/portage.py", line 2171, in digestParseFile

      mysize = long(myline.pop())

ValueError: invalid literal for long(): 206$

```

This one I at least had the presence of mind to write down.  So...how messed up is my system? Did the rt73 driver not work because of something I did or is it just not going to work on the x86 architecture?

----------

## NeddySeagoon

minimal,

Get a new copy of the rt73 folder and replace your old copy in your overlay.

Its keyworded ~x86 because tahts what I can test on, ~amd64 is included too because Ralink claims it works there.

To unmask it properly, add

```
net-wireless/rt73 ~x86
```

 to your /etc/portage/package.keywords file.

If you have never used it, it won't exist, so you may need to create it.

This file tells portage what testing packages are allowed on your system, so you are permitting a ~x86 keyworded rt73.

rt73 needs to find a properly configured kernel to build against. To do this it follows the /usr/src/linux symbolic link.

Your error message suggests that something in the ebuild or associated files has got in a mess. Following the stops above will sort that out and allow you to build this one testing package in your ~x86 environment.

You can ping me in #gentoo-uk on irc.freenode.org if you like. I'm usually there few a few hours after 19:00 UTC, sometimes earlier

----------

## minimal

ok, I did everything you said, and now I'm getting the older error message like I did before.  Though this time I copied it down, and here it is...

```
emerge rt73

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/rt73-1.0.3.6 to /

>>> md5 files   ;-) rt73-1.0.3.6.ebuild

>>> md5 files   ;-) files/digest-rt73-1.0.3.6

>>> md5 files   ;-) files/make4.patch

>>> md5 files   ;-) files/make6.patch

>>> md5 files   ;-) files/deviceID.patch

>>> md5 src_uri ;-) RT73_Linux_STA_Drv1.0.3.6.tar.gz

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.12-gentoo-r10

 * Checking for suitable kernel configuration options

>>> Unpacking source...

>>> Unpacking RT73_Linux_STA_Drv1.0.3.6.tar.gz to /var/tmp/portage/rt73-1.0.3.6/work

tar: RT73_Linux_STA_Drv1.0.3.6: implausibly old time stamp 1970-01-01 00:00:00

/usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild: line 47: epatch: command not found

/usr/local/portage/net-wireless/rt73/rt73-1.0.3.6.ebuild: line 57: epatch: command not found

>>> Source unpacked.

 * Preparing rt73 module

rm -rf *.o *~ .*.cmd *.ko *.mod.c .tmp_versions built-in.o

make: *** No rule to make target `module'.  Stop.

!!! ERROR: net-wireless/rt73-1.0.3.6 failed.

!!! Function linux-mod_src_compile, Line 491, Exitcode 2

!!! Unable to make                                  KERNDIR=/usr/src/linux KERNOUT=/usr/src/linux clean module.

```

----------

## NeddySeagoon

minimal,

You have a very old install 

```
2.6.12-gentoo-r10 
```

The kernel is now at version 2.6.18

```
epatch: command not found
```

suggests that you have an old version of portage that lacks the epatch commad.

I think the way ahead is for you to do a manual unpack, patch and build. Then you can use the wireless network to update the system. Its late here - I will describe the process tomorrow, since I will need to test too.

----------

## NeddySeagoon

minimal,

Do the following as an ordinary user.

Copy the /usr/portage/distfiles/RT73_Linux_STA_Drv1.0.3.6.tar.gz to ~/ and unpack it there

```
cp usr/portage/distfiles/RT73_Linux_STA_Drv1.0.3.6.tar.gz ~/

cd

tar xvzf RT73_Linux_STA_Drv1.0.3.6.tar.gz
```

It will create a directory called RT73_Linux_STA_Drv1.0.3.6 containing two further directories. Move into the Module directory

```
cd RT73_Linux_STA_Drv1.0.3.6/Module
```

There you will find Makefile.4 and Makefile.6 One for 2.4 kernels, one for 2.6 kernels. As you have 2.6.12

do 

```
cp Makefile.6  Makefile
```

so that make finds the correct makefile.

open rtmp_def.h. in nano and move almost to the end of the file

```
nano -w rtmp_def.h
```

find these lines

```
  {USB_DEVICE(0x0db0,0x6877)}, /* MSI */         \

  {USB_DEVICE(0x0db0,0xa874)}, /* MSI */         \

  {USB_DEVICE(0x0db0,0xa861)}, /* MSI */         \
```

After the last line listed above add 

```
  {USB_DEVICE(0x050d,0x705a)}, /* Belkin Wireless G Ver 3000uk  */ \

  {USB_DEVICE(0x0df6,0x9712)}, /* Sitecom Europe B.V. */ \

  {USB_DEVICE(0x07d1,0x3c04)}, /* D-Link USB card, WUA 1340 */ \
```

That code change adds in 3 new DeviceIDs, including yours. Save the changes.

Still as your normal user, issue the make command 

```
make
```

This will build the module but not install it. Close to the end you should see   

```
LD [M]  /home/<username>/RT73_Linux_STA_Drv1.0.3.6/Module/rt73.ko
```

rt73.ko is the kernel module.

The install step must be carried out as the root user. Become root and do 

```
make install
```

Still as root, create a new file called ralink in /etc/modules.d

/etc/modules.d/ralink needs a single line 

```
alias rausb0 rt73
```

save the new file.

Run the command 

```
modules-update
```

 Now you are ready to test.

```
modprobe rt73

ifconfig -a
```

should show a new interface called 

```
rausb0
```

If that works you can configure the wireless parameters with

```
iwconfig
```

and the normal network parameters with

```
ifconfig
```

.

----------

## minimal

wow, despite all your help I think I may have managed to make yet another mistake   :Embarassed:   :Mad: 

When you gave me the post "i'll do it tomorrow" or some such I figured well hey, I'll just go download a new version and reinstall, no big deal I did it before I can do it again.  So I download the new livecd version and ugh, it has no kernel source code. I'm download the 2006.0 version instead of the 2006.1 version tonight and going to install and try again.  Truly sorry.

----------

## NeddySeagoon

minimal,

Not to worry - you are learning a lot. Thats how it goes.

----------

## lowtexx

hi NeddySeagoon,

can you add 

 {USB_DEVICE(0x07d1,0x3c03)}, /* D-Link DWL-G122 C1 */ \

in deviceID.patch?

cu

lowtexx

----------

## NeddySeagoon

lowtexx,

Added. 

The update is at http://www.gentoo.org/~neddyseagoon You need the the whole rt73 directory as several files change.

Please post back with problems or your success story. I know emerge rt73 builds againsg 2.6.18-r2 on Athlon-XP but I don't have your device to do a functional test. If it works for you, I'll update the sunrise version to include your device ID.

----------

## lowtexx

thanks NeddySeagoon.

I had to run "ebuild rt73-1.0.3.6.ebuild digest" again, but it works now.

The module is loaded, when I plug in the stick - so the patch is ok.

It's an Athlon-XP 1700+ and 2.6.17-gentoo-r4 here.

I can join the network and run  dhcp manually without problems.

There seems to be another problem. The pc crashes when I run /etc/init.d/net.rausb0.

So I need to do more testing here.

I let you know...

cu

lowtexx

----------

## NeddySeagoon

lowtexx,

Thanks for the feedback. I've updated the changelog to credit you with the request and testing of USB_DEVICE(0x07d1,0x3c03) in the ebuild.

I'll bump the version in Sunrise soon, even if I don't get feedback on the other device IDs on test just now.

----------

## nicosaturno

this is the ID for my usb adapter (ASUS WL-167G) which works perfectly with the r73 drivers

ID 0b05:1723 ASUSTek Computer, Inc.

bye and thanks for your ebuild  :Very Happy: 

----------

## ihtruelsen

Does anyone know where I can get the rt73 drivers from? They seem to have been removed from the Ralink site.

----------

## ihtruelsen

Scratch that, it looks as though they have bumped the version. I am going to try to modify the ebuild by hand and see if the new version will work with the old ebuild.

----------

## ihtruelsen

Well, it kind of worked.

I got the most recent build from http://dev.gentoo.org/~neddyseagoon/rt73/, it being 1.0.3.6-r2. I copied that over to 1.0.4.0-r2 and tried an emerge. The rt73.patch failed. Here is the output:

```

***** rt73.patch *****

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

PATCH COMMAND:   patch -p0 -g0 -E --no-backup-if-mismatch < /usr/portage/local/l

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

patching file rtmp_main.c

Hunk #1 FAILED at 1718.

Hunk #2 FAILED at 2064.

2 out of 2 hunks FAILED -- saving rejects to file rtmp_main.c.rej

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

PATCH COMMAND:   patch -p1 -g0 -E --no-backup-if-mismatch < /usr/portage/local/l

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

missing header for unified diff at line 3 of patch

can't find file to patch at input line 3

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

The text leading up to this was:

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

|--- rtmp_main.c.org    2007-03-18 17:04:30.000000000 +0000

|+++ rtmp_main.c        2007-03-18 17:04:48.000000000 +0000

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

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

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

PATCH COMMAND:   patch -p2 -g0 -E --no-backup-if-mismatch < /usr/portage/local/l

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

missing header for unified diff at line 3 of patch

can't find file to patch at input line 3

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

The text leading up to this was:

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

|--- rtmp_main.c.org    2007-03-18 17:04:30.000000000 +0000

|+++ rtmp_main.c        2007-03-18 17:04:48.000000000 +0000

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

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

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

PATCH COMMAND:   patch -p3 -g0 -E --no-backup-if-mismatch < /usr/portage/local/l

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

missing header for unified diff at line 3 of patch

can't find file to patch at input line 3

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

The text leading up to this was:

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

|--- rtmp_main.c.org    2007-03-18 17:04:30.000000000 +0000

|+++ rtmp_main.c        2007-03-18 17:04:48.000000000 +0000

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

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

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

PATCH COMMAND:   patch -p4 -g0 -E --no-backup-if-mismatch < /usr/portage/local/l

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

missing header for unified diff at line 3 of patch

can't find file to patch at input line 3

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

The text leading up to this was:

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

|--- rtmp_main.c.org    2007-03-18 17:04:30.000000000 +0000

|+++ rtmp_main.c        2007-03-18 17:04:48.000000000 +0000

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

No file to patch.  Skipping patch.

2 out of 2 hunks ignored

```

Perhaps as a result, perhaps not, I am not getting much in the way of functionality from the D-Link WUA-1340

```

  idVendor           0x07d1 D-Link System

  idProduct          0x3c04 

  bcdDevice            0.01

  iManufacturer           1 Ralink

  iProduct                2 802.11 bg WLAN

Bus 004 Device 002: ID 07d1:3c04 D-Link System

```

The module will activate the card, but it claims to have no wireless extensions and will not associate with any aps.

```

eth0      IEEE 802.11g  ESSID:"Brentwood"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:18:F8:3E:C8:09   

          Bit Rate:24 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0  

          Retry limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=77/100  Signal level=-44 dBm  Noise level=-90 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:15  Invalid misc:1   Missed beacon:5

rausb0    RT73 WLAN  ESSID:off/any  

          Mode:Auto  Channel=11  Bit Rate=54 Mb/s   

          RTS thr:off   Fragment thr:off

          Encryption key:off

iwlist scanning

eth0      Scan completed :

          Cell 01 - Address: 00:18:F8:3E:C8:09

                    ESSID:"Brentwood"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Channel:11

                    Encryption key:off

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=79/100  Signal level=-47 dBm  

                    Extra: Last beacon: 4725ms ago

rausb0    Interface doesn't support scanning.

```

So, that is where I am for the moment. If you need any more info, please let me know.

----------

