# Gentoo newbie - Need help setting up USB wireless...

## arthurdent

I have been using Fedora Core for a couple of years now and, having treated myself to a whopping 200Gb hard-drive, have decided to continue my Linux exploration by installing Gentoo. I think I am really going to enjoy Gentoo - but I've still got a long way to go...

I have managed to do a complete Stage1 install from a live CD and can now boot into my newly compiled 2.6 kernel. I now need to get the internet working. 

I have a Belkin F5d6050u USB network adapter which uses the Atmel chipset. Under Fedora I have this working using the at76c503-rfmd driver which I have also installed in my Gentoo partition. I did not have "wireless-tools" in my portage so I downloaded it (using my Fedora distro) and emerged it.

If I try to do any iwconfig wlan0 stuff I get a "no such device - wlan0" error.

I have looked at the configuration guide on this site and the handbook but  am not sure that I have understood them correctly.

Here is my /etc/conf.d/net file:

```
# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

dhcpcd_eth0="-N"

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"
```

I did not have a /etc/conf.d/wireless file so I created one using the same settings as I have in my (Fedora) /etc/sysconfig/network-scripts/ifcfg-wla0 file as you can see here:

```
DEVICE=wlan0

BOOTPROTO=dhcp

ONBOOT=yes

TYPE=Wireless

MODE=Managed

ESSID=any

CHANNEL=6

KEY='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

GATEWAY=192.168.1.1

NETMASK=255.255.255.0

BROADCAST=192.168.1.255
```

I'm sure I'm not far off but what do I need to change to get this up and running?

Thanks in advance...

Mark

----------

## j-m

No, this won´t work. Emerge the latest unstable baselayout and have a look at /etc/conf.d/wireless.example.

----------

## arthurdent

Errrmmmm.....

How can I emerge the latest unstable baselayout without an internet connection?

Can I do it somehow from within Fedora and copy it to my Gentoo partition?

----------

## j-m

Yes, you could chroot to Gentoo from Fedora. Basically follow the instructions on chrooting in installation handbook.

----------

## arthurdent

j-m Thanks for your help so far...

OK - I may need some hand-holding here.

This is what I've done...

In Fedora I did 

mount /dev/hdb8 /mnt/gentoo

chroot /mnt/gentoo (WOW ! I never knew you could do that! Thanks!)

then

```
mkdir -p /etc/portage

echo "=sys-apps/baselayout-1.11.9-r1 ~x86" >> /etc/portage/package.keywords

echo "=sys-apps/sysvinit-2.86 ~x86" >> /etc/portage/package.keywords

echo "=app-shells/bash-3.0-r8 ~x86" >> /etc/portage/package.keywords

echo "=sys-libs/readline-5.0-r1 ~x86" >> /etc/portage/package.keywords

emerge -uav sys-apps/baselayout net-wireless/wireless-tools sys-libs/readline bash
```

as per the instuctions in the gentoo-wiki HowTo

but the emerge command gives me a "Nothing to merge; do you want me to auto-clean packages? [y/n]" error message

Sorry if I'm missing something glaringly obvious but I'm still finding my feet in Gentoo...

Thanks again.

Mark

----------

## nobspangle

When you chrooted across to the gentoo partition did you do

```
source /etc/profile

env-update
```

Apart from that the only thing I can think of that might be causing you problems is an old version of portage that doesn't support the /etc/portage layout. If you have access to gentoolkit (emerge it if you don't) you can use the 

```
etcat -v package-name
```

command to find out which versions are available/installed.

----------

## j-m

OK, try this:

```

env-update && source /etc/profile

emerge -uav baselayout

```

If it does not help, replace the package.keywords entries with just:

```

sys-apps/baselayout ~x86

sys-apps/sysvinit ~x86

app-shells/bash ~x86

sys-libs/readline ~x86

```

and try again.

----------

## arthurdent

Well chaps - I had forgotten to do env-update && source /etc/profile  so thanks for reminding me about that- but even when I did it I got the same error (even when doing just "emerge -uav baselayout")

The only thing that got me any closer was editing the package.keywords entries to strip off the version numbers. Then I got this:

```
These are the packages that I would merge, in order:

Calculating dependencies done!

[Ebuild N]  sys-apps/sysvininit-2.85-r1 -(selinux)

[Ebuild U]  sys-apps/baselayout-1.10.1-r2 [1.9.4-r3] -bootstrap -build -livecd -static -(uclibc)

[Ebuild U]  app-shells/bash-2.05b-r10 [2.05-r9] -build +nls -(uclibc)

[Ebuild U]  sys-libs/readline-4.3-r5 [4.3-r4]
```

but when I allow it to start it tries (apparently) about four different sites before bailing out with the message:

"Failed: host not found!"

Where does portage look for its downloads? Do I need to update some configuration file somewhere? When i put some of the URLs into a browser (in Fedora) they are indeed non-existent...

Thanks for sticking with me...

----------

## j-m

 *arthurdent wrote:*   

> 
> 
> but when I allow it to start it tries (apparently) about four different sites before bailing out with the message:
> 
> "Failed: host not found!"
> ...

 

Is your DNS working  :Question:  E.g., ping www.gentoo.org works in chroot? 

If not, put your DNS servers into /etc/resolv.conf  :Idea: 

If it does not work either, comment GENTOO_MIRRORS line in /etc/make.conf

----------

## arthurdent

Well we're getting somewhere (I'm not quite sure where we'er heading yet but at least we are moving...)

The resolv.conf was the problem. Those packages have now "emerged" but - back to the original problem - I still don't have a /etc/conf.d/wireless.example file.

I am very new to Gentoo. Now that I know I can chroot from Fedora, should I have first run some sort of update (rsync???) before I tried that emerge? From my last post it seems that I am not getting the most up-to-date versions of those four apps.

Thanks again

Mark

----------

## j-m

Yes, you should definitely 

```

emerge sync

```

first.

----------

## arthurdent

OK - I am going to try this later. I just want to point out however that I installed from a Live CD where (I thought anyway) that I did not have Internet connectivity (Now I realise that I could have "chroot-ed" from Fedora or Mandrake - but hey...).

Anyway the live CD was in fact a cover disk from a popular Linux magazine here in the UK (Linux format) and they provided some additional installation instuctions which included several dire warnings about NOT doing emerge-sync at the points where the manual suggested it because "the source code files you have copied accross match the portage snapshop. Running emerge sync will update your portage tree and it may then want later versions of some packages."

Will emerge sync update literally everything - including the kernel? I do want to do that at some stage -and I certainly want to make sure I have the latest versions of KDE/Gnome before I install a windows manager - but I just want to get this up and running first. Will it take forever?

Thanks again...

Mark

----------

## j-m

Actually, emerge sync won´t update anything except for the portage tree. Then you can have a look at things that can be apdated by using

```

emerge -uDpv world

```

----------

## arthurdent

Ahhh!

Then if I run "emerge world" it would update everything yes? 

And that would take forever...

Well I need to go out today so I might try starting it running before I go...

I take it that, if done from my FC2 environment, I am still protected by my FC2 firewall?

Thanks again

Mark

----------

## j-m

 *arthurdent wrote:*   

> 
> 
> Then if I run "emerge world" it would update everything yes? 
> 
> And that would take forever...
> ...

 

Well, it depends on your hardware.  :Laughing: 

Otherwise yes, if you have a working firewall in FC2 then it´s OK.

----------

## arthurdent

Just a quick question while I am waiting for 

emerge -uav sys-apps/baselayout net-wireless/wireless-tools sys-libs/readline bash

to finish (for some reason it wants to update perl GCC and a whole bunch of other stuff)...

is "emerge system" a sub-set of "emerge world" or are they two different things?

Before I go to work tomorrow I intend to start a complete update so that it is at least partially completed by the time I get home.

Which should I do first "emerge system" or "emerge world"?

Having done both would I then have a bang-up-to-date system?

Thanks

Mark

----------

## j-m

 *arthurdent wrote:*   

> 
> 
> is "emerge system" a sub-set of "emerge world" or are they two different things?
> 
> k

 

You don´t need emerge system at all. Please do read the documentation... 

```

emerge -uDav world

```

is what you need to update the system.

----------

## arthurdent

j-m,

Thanks very much for your help so far. I have only now found the time to complete updating the system (putting off rebuilding the kernel 'till the weekend) and it has "emerged" a wireless.example file. I have read and re-read the wirless HOWTO but I'm not sure I understand everything...

When I start the system I get this error:

```

* Bring up lo...            [0k]

* Starting syslog-ng...

* You should stop using /etc/dnsdomainname and use /etc/conf.d/domainname

* Setting DNS domainname to homenetwork...

* Starting eth0

eth0 : error fetching interface information : Device not found

eth0 : error fetching interface information : Device not found

*    Bringing up eth0

*       Configuration not set for eth0 - assigning dhcp

*       dhcp

*          eth0 does not exist

* ERROR : Problem starting needed services   [!!]

*       "netmount" was not started
```

I should point out that the diver for the Atmel is compiled as a module but it does not seem to load at startup (I'm not sure how to do this). If I do a "dmesg | grep at76c" immediately after boot I get nothing.

"modprobe at76c503-rfmd" gets it up and running but "iwcofig" or "ifconfig wlan0 up" all produce errors saying "no such device - wllan0"

My /etc/init.d/net.eth0 is symliked to /etc/init.d/net.lo as described in the HOWTO.

This is the (abridged) contents of my /etc/conf.d/wireless file (my ESSID is called "Wireless")

```

essid_wlan0="any"

mode_wlan0="managed"

channel_wlan0="6"

key_Wireless="1234-ABCD-5678-DEFA-9012-BCDE-23 enc open"
```

my /etc/conf.d/net file just has this in it

```
# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_Wireless=( "dhcp" )
```

I know that something (several things) is not right with this set-up, but can you point me in the right direction towards fixit it (them)?

Many thanks

Mark

----------

## arthurdent

Gentle pleading....

Can anyone help me out here?

TIA

Mark

----------

## arthurdent

OK Guys,

Perhaps I can break my problem down into two distinct areas so I can work from there..

1) How do I ensure that the at76c503-rfmd module loads at startup? Do I have to put an entry in rc.conf? If so what format should it be - would it be as simple as putting "modprobe at76c503-rfmd" into rc.conf? (I know this is a bit lame but the docs are not clear on this).

2) What do I need to fix so that Gentoo sees a wlan0 device? Does it have anything to do with the symlink to /etc/init.d/net.eth0? What tells it to read the /etc/conf.d/wireless file?

Please give me some pointers. My reading has only confused me so far...

Thanks

Mark

----------

## steevdave

The first part is fairly easy - to ensure that a module is always loaded on boot, simply add it to your

/etc/modules.autoload.d/kernel-2.x 

file - where .x is the kernel version (2.4 or 2.6 typically)

for example, this is what mine looks like.. (laptop)

```
# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.

# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/modules.autoload.d/kernel-2.6,v 1.1 2003/07/16 18:13:45 azarah Exp $

#

# Note that this file is for 2.6 kernels.

#

# Add the names of modules that you'd like to load when the system

# starts into this file, one per line.  Comments begin with # and

# are ignored.  Read man modules.autoload for additional details.

# For example:

# 3c59x

ac

battery

button

fan

thermal

video

via-rhine

uhci-hcd

```

alot of these are for acpi, and the via-rhine is for my network card (wired) - and uhci-hcd is for my USB.

you would probably want to add the module name into the file, it *should* be as simple as just adding the name into this file.

as to the second one, I am not too sure as I don't have a wireless card that uses the atmel chipset - although I am looking for a USB wireless card as my pcmcia slot has recently decided to die.

----------

## thesnowman

Once you have the module loaded you should run iwconfig with no parameters.  This will tell you the interface name of the device.  You can then create your symlink to /etc/init.d/net.lo using the correct interface name and edit /etc/init.d/wireless accordingly.  You are currently symlinking /etc/init.d/net.eth0 to net.lo but in your config you are using wlan0 as the interface name.  You need to ensure wlan0 is the real interface name and then use /etc/init.d/net.wlan0

If you want to force a certain interface name for that NIC (and you are using udev) then that can be done as discussed in this thread:

https://forums.gentoo.org/viewtopic-t-295595-highlight-.html

I have my laptop set-up so that the builtin wireless adapter is called wlan0.  I then have /etc/init.d/net.wlan0 symlinked to /etc/init.d/net.lo and my config for wlan0 in /etc/conf.d/wireless.

----------

## arthurdent

Thanks guys! Step by step we're making (slow) progress, but at least it's progress (It must be because it's my birthday today!)

The /etc/modules.autoload.d/kernel-2.6 thing worked. Now when I do "dmesg | grep at76" after startup I do get the usual at76c503-rfmd stuff - so thanks for that - one problem down.

As to iwconfig this is all I get:

```
lo        no wireless extensions.
```

On the same PC with the same module running from my Fedora installlation I get this:

```
[root@localhost mark]# /sbin/iwconfig

lo        no wireless extensions.

 

sit0      no wireless extensions.

 

Warning: Driver for device wlan0 has been compiled with version 17

of Wireless Extension, while this program is using version 16.

Some things may be broken...

 

wlan0     IEEE 802.11-DS  ESSID:"Wireless"  Nickname:"localhost.localdomain"

          Mode:Managed  Channel:6  Access Point: 00:03:2F:17:D7:8B

          Bit Rate:11Mb/s   Tx-Power=15 dBm

          Retry limit:8   RTS thr=1536 B   Fragment thr=1536 B

          Encryption key:XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX   Security mode:open

          Power Management:off

          Link Quality:0/0  Signal level:17/255  Noise level:0/0

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

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
```

Now - I have no idea what "sit0" is - I have never seen that before, nor do I have any idea where that warning message has come from - I have never seen that before either - but I have done several kernel upgrades (via Fedora's RPM system) and several updates of the at76c503-rfmd module by using CVS without ever needing to run "iwconfig" again - it has always just worked. Anyhow - all that is irrelevant I guess because that's in Fedora and it works.

How do I get it working in Gentoo?

Huge thanks for your help so far...

Mark

----------

## arthurdent

Hold on chaps - I've just noticed something...

In Fedora:

```
# dmesg | grep at76

/wireless/at76c503a/at76_usbdfu.c: USB Device Firmware Upgrade (DFU) handler v0.12beta22-static loading

/wireless/at76c503a/at76c503.c: Generic Atmel at76c503/at76c505 routines v0.12beta22-static

/wireless/at76c503a/at76c503-fw_skel.c: Atmel at76c503 (RFMD/Accton) Wireless LAN Driver v0.12beta22-static loading

/wireless/at76c503a/at76c503-fw_skel.c: using compiled-in firmware

/wireless/at76c503a/at76c503.c: $Id: at76c503.c,v 1.72 2004/10/19 20:45:25 jal2 Exp $ compiled Feb 14 2005 20:22:11

/wireless/at76c503a/at76c503.c: firmware version 8.101.5 #84 (fcs_len 4)

/wireless/at76c503a/at76c503.c: device's MAC 00:30:f1:24:15:d7, regulatory domain ETSI (Europe - (Spain+France) (id 48)

/wireless/at76c503a/at76c503.c: registered wlan0

usbcore: registered new driver at76c503-rfmd-acc
```

in Gentoo:

```
# dmesg | grep at76

/wireless/at76c503a/at76_usbdfu.c: USB Device Firmware Upgrade (DFU) handler v0.12beta22-static loading

/wireless/at76c503a/at76c503.c: Generic Atmel at76c503/at76c505 routines v0.12beta22-static

/wireless/at76c503a/at76c503-fw_skel.c: Atmel at76c503 (RFMD) Wireless LAN Driver v0.12beta22-static loading

usbcore: registered new driver at76c503-rfmd
```

Notice that in Fedora a) there's more stuff; and b) it registers the driver to wlan0; but NOT in Gentoo.

What gives?

Any suggestions gratefully received.

Thanks again

Mark

----------

## thesnowman

Have you compiled your kernel with wireless extensions support?

Device Drivers  ---> Networking support  ---> Wireless LAN (non-hamradio)  ---> Wireless LAN drivers (non-hamradio) & Wireless Extensions

----------

## arthurdent

I am at work at the moment so I can't double-check but I am absolutely certain that I did.

I don't know if it's relevant, but I think I might have some kernel problems - I was going to post another message in the "Kernel" forum - There are two problems that I know of so far. One (not relevant) is the fact that the command "shutdown -h now" does shut down the system but does not "power off" the PC (as it does in Fedora). The other (more relevant) is that it does not seem to recognise my USB memory stick. I am also certain that I compiled USB support into the kernel - but maybe I have some options wrong.

----------

## kermitthefrog917

I was having the same problem as described here... found this post from a google search.

Gentoo would recognize my device and load hte drivers, but nothing would appear under iwconfig

I found that if i ran dmesg after i plugged it in it showed that it couldnt find the firmware file (atmel_at76c503a-rfmd.bin)

I checked out the atmel-firmware package  (v 1.1) on portage and it was missing the file.  so i grabbed the tarball (btw.... this is all done chrooted through slackware 9.1) for v 1.3 and sitting inside a folder "images.usb" was the file i needed.  I added it to /lib/firmware/ and plugged my USB wireless back in.  dmesg said wlan0 registered... and then all i needed was to run 

```

iwconfig wlan0 essid (my essid) key (my key) mode managed

ifconfig wlan0 up

dhcpcd wlan0

```

----------

