# Reboot killed wlan0, net-setup

## Dodec

After finalizing my Gentoo installation, I rebooted my system and was trying to install the Xorg server software package in order to use a graphical desktop environment when I began getting "unable to resolve host address" errors that aborted the operation. After sending a few test pings and running ifconfig, I determined that the wlan0 connection I had established during the setup process was no longer in existence. Trying to run net-setup to get it back only resulted in the error "-bash: net-setup: command not found", and running iwconfig did the same thing. I attempted to emerge wpa_supplicant in order to reconfigure the network, but could not because I received the same "unable to resolve host address" errors that had plagued my Xorg emerge attempt. If anyone knows a way to get my network back, please let me know...thanks!

----------

## khayyam

ashlyw42 ...

firstly, changes made while booting the CD are not contiguious with your install, everything required for networking after reboot needs to be installed/configured within the 'chroot'. Secondly, 'net-setup' is part of the CD, its not included in your install.

So, if you need wpa_supplicant, dhcpcd, or what-have-you, to configure the network these should be installed prior to rebooting. You can resolve this by booting again from the CD, run net-setup, mounting the HD, chrooting, and emerging whatever packages are needed.

best ... khay

----------

## Dodec

Khayyam: Thank you for clarifying. Now I must ask what are probably two extremely stupid questions: how do I chroot? And will I have to do the rest of the installation process all over again, or does the chroot make it so I don't?

----------

## Dodec

I chrooted into the installation CD with the command "chroot /mnt/gentoo /bin/bash" after mounting my root and boot partitions, ran ifconfig, and the only thing that showed up was lo along with the message "Warning: cannot open /proc/net/dev (No such file or directory). Limited output." When I tried net-setup, it told me the command wasn't found, same thing with iwconfig. When I tried ifconfig with eth0 or wlan0, I got the warning from the first time I tried it with no parameters. Did I chroot wrong or skip a step or something? What's going on here?  :Confused: 

----------

## khayyam

 *ashlyw42 wrote:*   

> I chrooted into the installation CD with the command "chroot /mnt/gentoo /bin/bash" after mounting my root and boot partitions, ran ifconfig, and the only thing that showed up was lo along with the message "Warning: cannot open /proc/net/dev (No such file or directory). Limited output." When I tried net-setup, it told me the command wasn't found, same thing with iwconfig. When I tried ifconfig with eth0 or wlan0, I got the warning from the first time I tried it with no parameters. Did I chroot wrong or skip a step or something? What's going on here?

 

ashlyw42 ... nothing unusual. What your failing to understand is the chroot is the install and the CD is the means of installation. So, if your booted from the CD then it is the tools provided on the CD that is used to configure the network, not the tools within the chroot. This is why the install instructions have you setup networking prior to chrooting. 

To answer specific questions. No, you don't need to reinstall, just boot the CD, setup your networking, mount /mnt/gentoo ... mount (bind) /proc, /dev, etc (as per the install instructions), cp /etc/resolv.conf to /mnt/gentoo/etc/ and 'chroot /mnt/gentoo /bin/bash' .. 'env-update' .. 'source /etc/profile'. From this point you should be able to emerge whatever is needed.

HTH & best ... khay

----------

## NeddySeagoon

ashlyw42,

You skipped some steps and did others in the wrong order.  Understand that chroot does what its full name means.  It changes the root filesystem for everything 'inside' the changed root.

Outside, the root filessytem is provided by the CD inside its your budding Gentoo install.  Things inside the chroot cannot reach outside.  You may hear of  spplications being run ina chroot 'jail'.

During your instll some things are needed both inside and outside the chroot.  The things that re needed in both places you must make available inside the chroot every time you boot the CD. There is no persistance.

Refer to the Gentoo Handbook

Boot the CD and run net-setup if you need to.  net-setup is not in the chroot.

Do the Copy DNS Info in Code Listing 1.3, this provides net

Continue with Mounting the necessary Filesystems Code Listing 1.4,  this makes /proc available inside the chroot. Notice its mounted at /mnt/gentoo/proc, which becomes /proc inside the chroot. 

Finally follow Code Listing 1.5 to chroot and set the environament.  These commands should be in your back buffer as you are in the chroot now.  Type a few letters of each line and press PageUp.

If the wrong command is found, press page up repeatedly.

You are now back in the chroot as if you has never left and your network should work too.

Oh, there are no stupid questions - except the one you don't ask.  Be on your guard for stupid answers though.

----------

## Dodec

Thank you both for your help, but I mounted the filesystems, ran net-setup, copied the DNS info, chrooted into the system, emerged wpa_supplicant, and rebooted twice, and got the same result. Is there anything else I might be doing wrong that could be causing this? (On the plus side, I finally got my system to boot without typing a multitude of commands I could never remember--turns out my computer is one of the ones that doesn't work with GRUB.)

----------

## khayyam

 *ashlyw42 wrote:*   

> [...] chrooted into the system, emerged wpa_supplicant, and rebooted twice, and got the same result. Is there anything else I might be doing wrong that could be causing this?

 

ashlyw42 ... the question now is: how are you configuring wpa_supplicant and networking in general. As you haven't mentioned doing so, I'll assume you haven't added anything to /etc/wpa_supplicant/wpa_supplicant.conf or /etc/conf.d/net nor added /etc/init.d/net.wlan0 to the default runlevel.

I'm not sure what authentication mechanism your AP uses, I'll assume WPA2, /etc/wpa_supplicant/wpa_supplicant.conf should look something like the following (obviously the 'ssid' and 'psk' would need to match those of your AP)

```
network={

        ssid="your_accesspoint_name"

        scan_ssid=1

        proto=RSN

        key_mgmt=WPA-PSK

        group=CCMP TKIP

        pairwise=CCMP TKIP

        psk=your_password

}
```

/etc/conf.d/net can be left empty (in which case it will default to using dhcp to configure the IP, etc), however, here is an example configuration which does pretty much the same, but obviously exactly how it should be configured depends on your particular requirements ... (this particular configuration stipulates that net-misc/dhcpcd should be used as the dhcp client).

```
modules_wlan0="!plug wpa_supplicant dhcpcd"

wpa_supplicant_wlan0="-Dwext"

wpa_timeout_wlan0="15"

config_wlan0="dhcp"
```

You would then make a link to the init script ...

```
ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
```

The interface can then be activated with the following ...

```
/etc/init.d/net.wlan0 start
```

... at this point dhcp should be negociated, and IP, route, and DNS, asigned ... and you should be able to ping. If not then you will need to provide some idea of what goes wrong.

If the interface needs to be started on each boot then you can add the init script to the default runlevel, like so ...

```
rc-update add net.wlan0 default
```

HTH & best ... khay

----------

## Dodec

khayyam: I followed your instructions to modify the config file and create the link, and everything went smoothly until I tried to start net.wlan0, which gave me this: 

```
 

# ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

# /etc/init.d/net.wlan0 start

*Caching service dependencies...

*Bringing up interface wlan0

*Starting wpa_supplicant on wlan0...

*Starting wpa_cli on wlan0...

*Backgrounding...

*WARNING: net.wlan0 has started, but is inactive

```

After getting this, I attempted to run a test ping, and got an unknown host error, even though running ifconfig showed that wlan0 existed and was working just fine. What else can I do to try and fix this?

----------

## khayyam

ashlyw42 ...

the 'WARNING' is not fatal ... its just saying that the initscript is not waiting for dhcp, or what-have-you, to return success. Normally the dhcp negociation will take some seconds, so you should normally give it a little time before attempting to ping.

Now, when you say that "ifconfig showed that wlan0 existed and was working just fine" did you mean that interface had an IP asigned? For example:

```
% awk '/inet addr:/{print (substr($2,6,15))}' <(/sbin/ifconfig wlan0)

192.168.2.206
```

... shows my current IP. If this is not the case then you should post the output of the following:

```
awk '/wlan0/' <(dmesg)
```

best ... khay

----------

## Dodec

khayyam: the ping still doesn't work, and when I ran awk '/wlan0/' <(dmesg) I got a screen full of nothing but this over and over again: 

```
 

wlan0: authenticate with 08:86:3b:15:3a:a0 (try 1)

wlan0: authenticate with 08:86:3b:15:3a:a0 (try 2)

wlan0: authenticate with 08:86:3b:15:3a:a0 (try 3)

wlan0: authentication with 08:86:3b:15:3a:a0 timed out 

```

What does it mean???   :Sad: 

----------

## khayyam

 *ashlyw42 wrote:*   

> khayyam: the ping still doesn't work

 

ashlyw42 ... this means that the process of either authenticating or dhcp is failing ... most probably the former.

 *ashlyw42 wrote:*   

> and when I ran awk '/wlan0/' <(dmesg) I got a screen full of nothing but this over and over again: wlan0: authentication with 08:86:3b:15:3a:a0 timed out. What does it mean?

 

It means the connection to the AP can't be established for one reason or other. So, can you tell me what authentication mechanisms does you Belkin AP support (WEP, WPA, WPA2), it may be that the above wpa_supplicant.conf is not correct (I did say this was for WPA2).

When you run net-setup what details do you provide in order for the connection to be established when booting from the CD (of course please don't provide your passphrase here).

best ... khay

----------

## Dodec

The router supports WPA, WPA2, and WEP. My network is WEP, and when I run net-setup it gives me a screen saying "Interface name: wlan0 MAC address: 00:19:d2:b9:5f:79 Driver: iwl3945 Is this the interface you want to configure? " To which I reply yes, then when it prompts for the network settings I choose "My network is wireless" , then I enter the ssid. When asked whether the network uses encryption, I say yes, then indicate thay the key is in HEX. I enter my passphrase, then select "Use DCHP to auto-detect my network settings", after which it goes back to the command line with the  prompt "Type "ifconfig" to make sure the interface was configured correctly." 

Here's my /etc/wpa_supplicant/wpa_supplicant.conf, if it's any help:

```

# The below line must not be changed otherwise it refuses to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# Shared WEP connection (no WPA, no IEEE 802.1X) using Shared Key IEEE 802.11 authentication

network={

     ssid="network_name"

     key_mgmt=NONE

     # Keys in quotes are ASCII keys

     # Keys specified without quotes are hex keys

     wep_key1=passphrase

     wep_tx_keyidx=0

     priority=5

     auth_alg=SHARED

}

```

Are there any problems here?

----------

## Ant P.

Should be wep_key0, not wep_key1.

----------

## khayyam

ashlyw42 ...

Ant P. is correct it should be wep_key0= ... incidently, if your AP supports WPA and WPA2, why use WEP?

best ... khay

----------

## Dodec

I changed wep_key1 to wep_key0, saved the config file, and while everything was loading after rebooting, I noticed that there was an error saying that wpa_supplicant had failed to start. The system brought up the eth0 connection and that timed out, and sure enough, when I logged in again and sent a test ping, it failed and I ran ifconfig, which told me that my wlan0 had disappeared once more. Should I chroot again and add wpa_supplicant to the default runlevel, or would that do anything since it appears that it alread tried to start and failed?

----------

## khayyam

ashlyw42 ...

no, infact remove wpa_supplicant from the default runlevel. If you followed the instructions above then net.wlan0 is responcible for starting wpa_supplicant.

Now, disapearing interfaces ... I can't even begin to debug that.

best ... khay

----------

## Odward

```
ifconfig -a
```

If that doesn't list your wlan0 at all, my first thoughts would be did you configure the kernel with support for your wireless card?

Wireless drivers should be built as modules.

If that is ok you probably need the firmware.

You may need to boot from the CD again and chroot according to the previous methods.  Once inside the chroot environment

```
emerge iwl3945-ucode
```

That will install the firmware so your wireless adapter can work.

**Edit:  I mean so the wireless adapter can work from your install, obviously the CD has it covered  :D   Assuming I'm not way

off base.

----------

## khayyam

 *Odward wrote:*   

> If that doesn't list your wlan0 at all, my first thoughts would be did you configure the kernel with support for your wireless card?

 

Odward ... read above:

 *ashlyw42 wrote:*   

> wlan0: authentication with 08:86:3b:15:3a:a0 timed out

 

So, the interface is active ... why is would then disapear, thats another question ...

best ... khay

----------

## Odward

Sorry about that, I got the environments confused.  Thought that set of configuration steps was occuring in the chroot, and using

the kernel from the CD.  Wasn't sure if a wlan0 ever existed in the real boot.

----------

## Dodec

This time, when I tried to run awk '/wlan0' <(dmesg) from inside the chroot it gave me this:

```

awk: cmd. line:1:/wlan0

awk: cmd. line:1: ^ unterminated regexp

```

Could this have something to do with it?

----------

## khayyam

ashlyw42 ...

no, its becuase you haven't terminated the regular expression '/wlan0/' not '/wlan0' ... but why are we back in the chroot?

best ... khay

----------

## Dodec

khayyam: Oh. Whoops....anyway, I'm in the chroot because that's the only way I can get the network to do anything at this point. When I run awk '/wlan0/' <(dmesg) in the chroot it gives me an IP address now that I'm using the right command, but outside the CD environment it doesn't even do anything, and ifconfig only shows eth0 and lo, neither of which work because I don't use a wired connection. When I tried to run /etc/init.d/net.wlan0 start outside the CD, it told me the service didn't exist, and that I should check that I had the right kernel module enabled for my hardware, which I'm almost positive I do. I went back into the chroot and enabled whatever else looked like it might work, and noticed in the help section on one that firmware would needed...maybe Odward was on to something with the firmware suggestion? Although that doesn't really explain how the interface would be acting like it is, or at least it's not clicking in my tiny technologically incompetent brain...  :Confused:  Any other ideas, anyone?

----------

## khayyam

ashlyw42 ...

this is news to me ... what am I supposed to think when you post "wlan0: authentication with 08:86:3b:15:3a:a0 timed out", obviously, that you have a wlan0 and the issue is authentication ... to double the confusion when booted from the CD we know that networking is available, so if you write "ifconfig showed that wlan0 existed and was working just fine" but that you were unable to ping, then the obvious conclusion is that your booted from the install as, again, we know that networking is available when booted from the CD ... what a merry dance. Now, should I need to ask "is the computer plugged in to the power socket?" ... because it seems I've been working on false assumptions from the beginning.

So, to start over "[w]hat your failing to understand is the chroot is the install and the CD is the means of installation", so all the information you provide should focus on information related to networking when booted from the install. As I understand it now, you have no wlan0 device ... so, this is either due to your missing the driver, and/or firmware, for your network card. So, as Odward suggested ... please check your kernel configuration for the iwl3945 driver and emerge the iwl3945-ucode firmware.

best ... khay

----------

## Dodec

khayyam: actually, I can go for about 10 minutes with the computer unplugged, but after that I need to plug it in or else the battery dies.  :Smile: 

In all seriousness, though, I believe we may have a new problem...I have just attempted to boot the CD in order to chroot three times, and each time my computer has lingered at the BIOS screen where I choose the boot options, thought about doing what I told it to, and then decided to completely ignore the CD and go straight to the LILO boot screen. And, needless to say, when it makes it into my install, wlan0 is still missing, and the ping still doesn't work. I don't suppose there's any way I can coerce the computer into accepting the existence of my wireless card without booting from the CD and chrooting...?

----------

## khayyam

ashlyw42 ...

If you were once able to boot the CD but nolonger can then its probably an issue with the CD (a scratch or what-have-you).

When booting the CD and chrooting its only to install ... the OS/tools/etc on the CD are providing the driver, networking, etc. The reason there is no wlan0/networking when booting the install is that something required for this to work has been omited (most likely the driver and/or firmware). So, its not an issue of "accepting the existence of [the] wireless card" ...  but the presence of the driver/firmware for that wireless card. Its that simple.

best ... khay

----------

## NeddySeagoon

ashlyw42,

If you have another operating system or another PC you can use Sneakernet to fetch the files you need and to post information aso we can help.  I know its a six year old post but its still valid.

----------

## Odward

ashlyw,

Sorry for long post, and if I'm oversimplifying, but hoping to make 1 post that ensures you can rule out the kernel driver / firmware.

If you're still having trouble, and if it is driver / firmware related.  I don't know your level of experience, but one way to check if your kernel supports your wireless adapter would be

```
cd /usr/src/linux

make menuconfig
```

In this menu, you can press '/' and a search bar opens.  Type iwl3945 and press return.  At the top of the new page you should see Symbol: IWL3945 [=m]

If it already shows [=m] you can skip over this section about recompiling your kernel and jump down to FIRMWARE in my post.

If that '=m' is actually =y or =n then you need to change it to =m.  To do that, press return again to go back to the main menu screen and navigate to

--> Device Drivers

---->Network device support

------>Wireless LAN

This page will have lots of wireless adapters that are supported by the linux kernel.  The only one you should need is

Intel PRO/Wireless 3945ABG/BG Network Connection

Highlight that choice and press the spacebar until it shows 'm' on the left.

If you had to modify that setting, i.e. it wasn't already configured as a module (=m), then exit the menuconfig screens one by one and when prompted say Yes to save your new config.

Back at the console type

```
make && make modules_install
```

Just a heads up about the previous command, if your laptop is old enough that process might take several minutes so you may want to be plugged in for power.

When that completes you need to

```
mount /boot

cp arch/x86/boot/bzimage /boot/kernel-3.3.8-gentoo

lilo
```

In the above example, if your kernel is not 3.3.8 please use the appropriate name.  You can 'ls /boot' to see what kernel name you used during install.

If you had to recompile your kernel, you'll want to reboot to use the new kernel.

FIRMWARE

As for the firmware, I'm not sure how you are getting online if the cd is no longer booting.  If you're using the gentoo computer via Ethernet (I know you mentioned only having a few minutes

before the battery dies) then you can simply

```
emerge iwl3945-ucode
```

When that completes try

```
modprobe -r iwl3945

modprobe iwl3945

ifconfig wlan0 up
```

**Edit: Added the modprobe -r in case the module is loaded without firmware already - not sure if that matters

Let us know if either of the second two commands return an error.  If there are no errors with those two you should now be able to

```
/etc/init.d/net.wlan0 start 
```

Assuming you have that configured properly from khayyam's help.

If you're using an alternate computer to follow the help from these forums, there are several mirrors but here's a link you could use

ftp://ftp.gtlib.gatech.edu/pub/gentoo/distfiles/iwlwifi-3945-ucode-15.32.2.9.tgz

That will prompt you to save a file.  Remember where you save the file, because you need to transfer it to a flash drive, or possibly cd, so that you can put it on the Gentoo system.

You will want to copy that file to /usr/portage/distfiles on the Gentoo system.  If you have the sources, like the download in this example, putting them in that folder allows you to emerge without

being online.

I'm going to stop here, if you have to use an alternate computer and transfer the file you may need help with mounting the CD or Flash drive.  I'm going to hope you're using Ethernet from

the Gentoo system, as that way you can emerge the firmware directly.  That definitely should be doable in under the 10 minute timeframe.

Hope this helps, I've only been using Linux since approx Feb so hopefully I didn't foul up the details.

----------

## Dodec

Odward: the computer is being strange and doing the thing where even though ifconfig says my wlan0 exists, has an IP address, etc. it still won't let me get a test ping through, let alone download anything, so yes, I will probably need help figuring out how to get the file from the USB drive to the Gentoo computer (I would use Ethernet if I could, but I can't find the cable).  Is this another thing where I have to put the file on the drive in a particular way, or can I just save it there normally?

----------

## Odward

To be clear, are you saying that wlan0 exists in the real install?  Boot from lilo, not the CD - no chroot?

Did you have to change the kernel to make that happen or did it just suddenly appear?  Because maybe something else is wrong entirely.

If this is a normal boot, without the CD, may as well also rule out a DNS issue.  Have you tried to ping by IP?  If you know your gateway try to ping that IP, otherwise you might at least try

```
ping -c4 8.8.8.8
```

If you get replies, then you have a DNS concern.  If that still times out, or gives a different error you can share.

I think two other data points that might help would be the output of both

```
route

iwconfig wlan0
```

To answer your question, no you can just save the file normally.  I just wasn't sure if you knew how to access the flash drive from linux, or if you already have a desktop like KDE installed to manage the process for you.

*Edit:  Going to add a howto of sorts just in case

Once you have the file on the flash drive, after you plug the drive into the Gentoo computer - and assuming you even need this help - you will need to do something like

```
mkdir /mnt/flash

mount -t auto /dev/sdb1 /mnt/flash
```

This assumes you only have 1 hard drive in the computer, so the flash drive will very likely be /dev/sdb.

Ultimately if this method works, you can now see the contents of the flash drive with 'ls /mnt/flash'

Then you will be able to do something like

```
cp /mnt/flash/iwlwifi-3945-ucode-15.32.2.9.tgz /usr/portage/distfiles
```

Then emerge iwl3945-ucode

End Edit*

If you know how to read the contents of the flash drive you should just be able to copy that file to /usr/portage/distfiles and then run 'emerge iwl3945-ucode' it should see the source and not try to download it again.  If that is successful it might just be easiest to reboot one more time and see if you're online, if not then try to get back to us with the output from the commands above.

----------

## NeddySeagoon

ashlyw42,

What IP address is assigned to your wlan0?

If it begins 169.254. thats called a link local address and is only useful for ad-hoc mode, where you have no router and no dhcp server.

dhcpcd can be set up to assign a link local address when it fails to contact a dhcp server.

For file transfer via USB there are three or four steps.

Find out what the device is called, 

mount its filesystem somewhere

do the copy

unmount the filesystem (this is very important)

Plug the device into your PC , wait a fews seconda then do 

```
dmesg
```

At the end you will have something like

```
[ 1519.005337] sr 10:0:0:1: Attached scsi CD-ROM sr2

[ 1519.005392] sr 10:0:0:1: Attached scsi generic sg15 type 5

[ 1519.014101] sd 10:0:0:0: [sdm] Attached SCSI removable disk

[ 1519.733315] sd 10:0:0:0: [sdm] 31306239 512-byte logical blocks: (16.0 GB/14.9 GiB)

[ 1519.735055] sd 10:0:0:0: [sdm] No Caching mode page present

[ 1519.735058] sd 10:0:0:0: [sdm] Assuming drive cache: write through

[ 1519.739173] sd 10:0:0:0: [sdm] No Caching mode page present

[ 1519.739175] sd 10:0:0:0: [sdm] Assuming drive cache: write through

[ 1519.740916]  sdm: sdm1 sdm2 sdm3
```

The last line there is important, it shows my USB stick is called /dev/sdm and has three partitions.  Unless you partition your USB stick it will either have no partitions or one.

USB sticks use the FAT or FAT32 filesystem. Do

```
modprobe vfat
```

to load the driver into the kernel.

With the kernel module loaded, mount should work.  I would do 

```
mount -t vfat /dev/sdm1 /mnt/cdrom
```

to attach the USB stick to /mnt/cdrom. You use whatever dmesg tells you your device is called.

As a test,

```
ls /mnt/cdrom
```

will list the content of your USB stick.

Now you can do

```
 cp /mnt/cdrom/<somefile> /usr/portage/distfiles
```

if you have been fetching files for portage to use.  Or 

```
cp /usr/src/linux/.config /mnt/cdrom
```

to copy files the other way. That copies yuor kernel config file.

```
dmesg > /mnt/cdrom/dmesg.txt 
```

 sends dmesg to a file called dmesg.txt on your USB stick

```
ifconfig -a > /mnt/cdrom/ifconfig.txt
```

When you are done copying and making files,

```
cd 

umount /mnt/cdrom
```

flushes the cache back to the USB stick and prepares for you to remove it.

Do not actually unplug it until the flush is complete and the prompt returns.

All of those files will help us to help you

----------

## Dodec

Still no luck.  :Sad:  No, wlan0 doesn't exist in the non-CD install. Pinging an IP address told me the network was unreachable,  route gave me this: 

```
 

Destination: loopback

Gateway: Socrates.homenetwork

Genmask: 255.0.0.0

Flags: UG

Metric: 0

Ref: 0

Use: 0

Iface: lo 
```

and ifconfig wlan0 told me the device wasn't found. The IP address I wrote down last time I ran ifconfig with wlan0 working isn't a link local address, and running modprobe iwl3945 gave me this: 

```

FATAL: Could not load /lib/modules/3.2.12-gentoo/modules.dep: No such file or directory 
```

How do I attach the ifconfig, dmesg, and .config files to a post?

----------

## Odward

 *ashlyw42 wrote:*   

> How do I attach the ifconfig, dmesg, and .config files to a post?

 

I think the best way would be to use a site like http://pastebin.com

Those are all text files, so if you're getting online through a windows computer you should be able to open them with Notepad *Edit: Notepad apparently will not 

be pretty, try Wordpad* and copy / paste the contents to pastebin.  When you submit the info you will be given a URL, you can post that URL in your response 

and people will be able to click to see all that info without filling up pages of forum space.  You should probably paste them all separately, and thus give us 3 

separate URLs, if it's not too much trouble.Last edited by Odward on Fri Jul 27, 2012 9:08 pm; edited 1 time in total

----------

## NeddySeagoon

ashlyw42,

Small files can be copy and pasted into a post.

Larger files go to a pastebin site. You put something there and the site will give you a URL.  Post the URL here.

However,

```
FATAL: Could not load /lib/modules/3.2.12-gentoo/modules.dep: No such file or directory
```

tells a lot.

The file modules.dep is made when you run 

```
make modules_install
```

 in the course of your kernel build and install. Its used by modprobe to know what order modules must be loaded in when you run

```
modprobe <random_module>
```

As the file is missing, it suggests that

```
make modules_install
```

was s not run. Note that 

```
make modules install
```

without the underscore, does somethng quite different and will not return an error.

Do 

```
readlink /usr/src/linux 
```

and check that it shows a 3.2.12 kernel.  If all is well, do 

```
cd /usr/src/linux

make modules_install
```

 if the readlink shows a different kernel, you are building one kernel but running another.  Thats not an error as long as you are aware of it.

Now your modprobe should work, or if it fails, you will get a different error message.

----------

## NeddySeagoon

Odward,

Notepad will render Linuc text files as a single line.  It expects the CRLF line terminator.  Linux only provides LF

Wordpad will work.

----------

## Odward

 *NeddySeagoon wrote:*   

> Odward,
> 
> Notepad will render Linuc text files as a single line.  It expects the CRLF line terminator.  Linux only provides LF
> 
> Wordpad will work.

 

Thanks for the heads up, and the much better how-to =)

----------

## Dodec

Running readlink told me I was running a 3.0.17 kernel. Maybe this is part of the problem...?

Oh, and here are the files:

Kernel config: [url] http://pastebin.com/c4mw8bfw [/url]

Ifconfig: [url] http://pastebin.com/pqBnwDDQ [/url]

Dmesg: [url] http://pastebin.com/Q3KxLKE0 [/url]

----------

## NeddySeagoon

ashlyw42,

Your error 

```
FATAL: Could not load /lib/modules/3.2.12-gentoo/modules.dep: No such file or directory
```

clearly shows that kernel 3.2.12 is actually running.

The readlink command shows what your /usr/src/linux symlink is actually pointed to and you have just said its 3.0.17.

Now, grub loads and rund 3.2.12 but you are making modules for 3.0.17.  The kernel goes to great lenoghts to keep modules for different kernel apart. So that is a part of your problem.

You can see the kernels you have modules installed for if you look in /lib/modules/ 

Looking in your kernel .config file, we see at the top 

```
# Automatically generated make config: don't edit

# Linux/i386 3.0.17-tuxonice-r1 Kernel Configuration
```

Which tells that you posted the config file for the kernel pointed to by /usr/src/linux

Further down (line 1286) we see # CONFIG_IWL3945 is not set.  Thats game over for you as that is the symbol to build your wireless driver.

Your ifconfig shows 

```
wlan0     Link encap:Ethernet  HWaddr 00:19:d2:b9:5f:79  

          inet addr:192.168.2.7  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::219:d2ff:feb9:5f79/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:372 errors:0 dropped:0 overruns:0 frame:0

          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:32784 (32.0 KiB)  TX bytes:5180 (5.0 KiB)
```

so its been talking to something, sometime, and it can't do that with the kernel configuration your posted.

Your dmesg confirms the story. At the top it says

```
 Linux version 3.2.12-gentoo (root@poseidon) (gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #1 SMP Tue Jul 3 15:33:27 UTC 2012
```

so you are indeed runnnig 3.2.12. Further, it was compiled on Tue Jul 3 15:33:27 UTC 2012.

At line 896 

```
wlan0: authenticate with 08:86:3b:15:3a:a0 (try 1)

wlan0: authenticated

wlan0: associate with 08:86:3b:15:3a:a0 (try 1)

wlan0: RX AssocResp from 08:86:3b:15:3a:a0 (capab=0x11 status=0 aid=5)

wlan0: associated

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
```

shows that it all worked.

It follows that you wlan0 is up and working but you cannot pass data.

What do you have in /etc/resolv.conf ?  

If its nothing but comments, your dhcp server is not set up right. As a test, ass at the top, a line that says

```
nameserver 4.2.2.1
```

and save the file.  Does it work now?

If so, it will only work until yur dhcp lease is renewed, then /etc/resolv.conf will be wiped out again.

What does 

```
route
```

 show ?

wlan0 should appear but eth0 should not. 

To sort out your kernel symbolic link, run 

```
eselect kernel list
```

, followed by 

```
eselect kernel set X
```

where X is the number of  the 3.2.12 kernel.

It looks like you have done the hard bit and got it right.  Its a few lines of configuration.

One question, I suppose that the wireless dis associate with your own access point and not some random wireless access point that is also in range?

If its still not working, please post the output of route, the content of /etc/resolv and the content of /etc/conf.d/net

----------

## Dodec

The ping works now with the nameserver 4.2.2.1 line (the rest of it was just comments generated by dhcpcd), route gives me wlan0 and lo (no eth0) now, and the connection I'm trying to set up is to my own network. When I tried to fix the kernel issue, the only thing that showed up when I ran eselect kernel list was the 3.0.17 one. How can I find the other one and get the symbolic link figured out so the wireless driver module works?

----------

## NeddySeagoon

ashlyw42,

Either your dhcp server in your router is not configured properly, since it should provide a nameserver entry with the dhcp info, or the content of /etc/conf.d/net tells it not to populate /etc/resolv.

There are a lot of broken routers out there. Please post your 

```
/etc/conf.d/net
```

 file.

While networking works,

```
 emerge wgetpaste
```

 and use

```
 wgetpaste /etc/conf.d/net
```

to put the file onto a pastebin.

Since you are running kernel 3.2.12 and it works, where did you get it from?

Does it appear in /usr/src?

Assuming the worst and you need to set up a static /etc/resolv file, what are the IP addresses of the nameservers provided by your ISP?

There should be two, sometimes three.

Ping other hosts on your local network by IP address should work, provided you don't have a firewall that prevents wireless from initiating connections to wired hosts.

Ping by hostname will only work if the hosts on your network register their hostnames with your router, so it can perform name lookups.

Ahahing, there are a lot of broken routers out there ...

----------

## The Doctor

Will your network is working you might want to fetch the packages to get a graphical user interface working, if that is your ultimate goal.

If I were doing this I would use the following command: emerge -a --fetchonly xorg-server twm xterm wicd <foo> where <foo> is  an optional window manager or desktop environment packages, like kdebase-meta or gnome-light. I included wicd because it is an easy to use graphical (and/or command line. the "gtk" use flag compiles the graphical front end) internet connection tool and you might want to use it in your final install. twm and xterm are nice packages to test X. If you choose to emerge them, it is safe to remove them after you get your main system running.

After you spend the day debugging you can actually emerge the packages overnight when you are asleep so you don't loose any time, even if you have not finished debugging yet. I would only include xorg-serve, twm xterm and wicd in the overnight emerge since they would probably finish overnight but a meta package might not finish.

Good luck!

----------

## Odward

I just want to add one more thing just in case.  

Ashlyw42 if you are still using chroot as a means to get online, you might need to say so.  Some of the troubleshooting is probably the same, assuming you use chroot correctly.  But just a couple posts back

you've never had wlan0 without the CD and now you have a kernel config that can't support your wireless, and a different kernel running but you're online with a wlan0 interface.

I know some of my suggestions I meant for you to be booting your install, I know you were offline but to reconfigure the kernel for support you didn't need to be online.

I can try to go over the kernel instructions again, although Neddy or khay from before both know more than I do in this respect.

I would want to know, if you boot with no CD.  Does LILO handle the boot or Grub?  You mentioned LILO earlier so I'd want to know the contents of /etc/lilo.conf

If you're using grub, then 'mount /boot' and post the contents of /boot/grub/grub.conf

Otherwise I'll stop for now, just don't want a detail like chroot to go unmentioned as it changes some expected outputs I'm sure.

*Edit Also if you've been chrooting, I think there was a post about having an ip address and wlan0 etc. but no internet,  the full instructions from the handbook include copying /etc/resolv.conf to the chroot before you actually chroot.  As that contains your DNS info and it was probably blanked by the dhcpcd info when you booted with no CD at some point.  Or as Neddy suggested you can just manually be sure to add at least 

1 DNS server - such as 4.2.2.1 for the time being.  But do be clear about the boot environment.

Also if you aren't told to chroot, most of the people helping - especially if they don't read from page 1 - are going to expect you to be booting normally when you execute instructions or obtain output to be posted.

----------

## Dodec

Everything I've been doing so far has been from the chroot, because it's the only environment connected to my install where I can actually get the Internet connection to work. Oddly enough, even though I configured /etc/conf.d/net manually before, it seems to have been wiped out by rebooting from the CD, running net-setup again, and going back into the chroot, which perhaps might be part of the problem with why my wlan0 disappears when I don't boot from the CD. Now that I've gone back and fixed it, it's a verbatim copy of khayyam's suggested configuration on page 1 of this thread. I use LILO to boot because for whatever reason GRUB does not work with my computer, but now my /etc/lilo.conf file seems to have been eaten by my system or one of my numerous reboots or something, because all I'm getting is a blank file. I don't know whether that would have something to do with any of this or not. I have no idea where the 3.2.12 kernel is coming from, and if I run ls /usr/src (both with and without another / at the end...I've learned that lesson already), nothing comes up. make menuconfig lets me configure the 3.0.17 kernel, but I'm not sure where the other one would even be found. I'm not sure if emerging the graphical client before getting the kernel issues figured out would be the best idea, because with the way things have gone up to this point I'll almost certainly end up emerging the wrong version for the wrong kernel or something of the sort. If my concerns are unfounded and it'll work regardless of what kernel it emerges for or any of that and it won't be killed by repeated reboots into both environments (although I doubt it'll work in the chroot), then I'll go for it, because hopefully it'll make all this a little easier. I'm assuming I would want to do that in the install itself, though, not the chroot, which would require a working Internet connection in the install...which brings us back here.

----------

## NeddySeagoon

ashlyw42

Using the chroot explains a lot.  Lets go into some background so you have some understanding of whats happening.

When you boot with the CD, regardless of wether you enter the chroot or not, the CD provides the kernel, kernel modules and all the system services.

When you boot normally, your own install does this.  We have establisjed that the CD works with your wifi but your own kernel does not.

You need to boot with your own kernel to do the diagnostics because thats the one that doesn't work and its information about it not working that we need to help fix it.

The CD/Own boot explains the differeing kernel versions.  The CD provides 3.2.12, your own kernel is  3.0.17-tuxonice-r1.  Its the  3.0.17-tuxonice-r1 kernel we need to get wifi working for and you must boot into it to test it.

You can configure and install your own kernel from inside the chroot if you wish but you must boot into it to test, get error messages  and collect information to help us help you.

Your /etc/lilo.conf is only needed when you install a new kernel. It tells lilo what to include in its block list.

If its missing, you will need to make a new one.

The kernel itself is left in /usr/src/linux/arch/x86/boot/bzImage after its build and you must copy it to /boot to actually use it.

You may have to edit /etc/lilo.conf and you must run /sbin/lilo so lilo knows ablut the new kernel.

You can do the following steps either by booting your own kernel, or in the chroot.  You need to change # CONFIG_IWL3945 is not set in your own kernel. Proceed as follows.

```
cd /usr/src/linux

make menuconfig
```

This opens the kernel config tool. Press / and enter iwl3945

```

  ┌──────────────────────────── Search Results ─────────────────────────────┐

  │ Symbol: IWL3945 [=n]                                                    │  

  │ Type  : tristate                                                        │  

  │ Prompt: Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)      │  

  │   Defined at drivers/net/wireless/iwlegacy/Kconfig:37                   │  

  │   Depends on: NETDEVICES [=y] && WLAN [=y] && PCI [=y] && MAC80211 [=y] │  

  │   Location:                                                             │  

  │     -> Device Drivers                                                   │  

  │       -> Network device support (NETDEVICES [=y])                       │  

  │         -> Wireless LAN (WLAN [=y])                                     │  

  │   Selects: IWLEGACY [=n]       
```

will appear.

Your kernel.config pastebin shows you have all of the Depends on set correctly, so you were very close.

Navigate the menu system to

```
Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945) 
```

 the search result shows you where, then set the option from < > to <M>.

Read the help while you are there - it says you need microcode

The next steps will fail if you choose <*>.  Do not choose any debugging options for the driver.

Press ESC to move up the menu tree, at the top level, save the change.

As you used <M> and not <*> as the selection, your kernel binary in /boot will not change. So we need not rebuild it and mess about with lilo.

Do 

```
make modules

make modules_install
```

This will make just your new module, than install it into /lib/modules/... where modproble can find it.

The next step depends on the kernel you are running.  If you are in the chroot, reboot into your own kernel. modprobe can tell the difference.

In your own 3.0.17 kernel, do 

```
modprobe iwl3945
```

This will load the module for your wifi and should get you a wlan0 in 

```
ifconfig -a
```

If wlan0 is still missing when you boot your own kernel, look in /lib/firmware for files with names beginning iwl and look it dmesg to see if the firmware failed to load.

If wlan0 is there, 

```
/etc/init.d/net.wlan0 start
```

might make it work.  It might not too, it depends on your crypto setup among other things.

looking in dmesg and seeing 

```
iwl3945 0000:02:00.0: loaded firmware version 15.32.2.9

ADDRCONF(NETDEV_UP): wlan0: link is not ready

wlan0: authenticate with 08:86:3b:15:3a:a0 (try 1)

wlan0: authenticated

wlan0: associate with 08:86:3b:15:3a:a0 (try 1)

wlan0: RX AssocResp from 08:86:3b:15:3a:a0 (capab=0x11 status=0 aid=5)

wlan0: associated
```

will be a huge step in the right direction.

Save and post any errors verbatium - and we are only interested in errors when you do not use the CD.

----------

## Dodec

So close...

Activating the module and installing it went perfectly. When I rebooted into my own kernel, I noticed that now when the endless lines of code scroll by, one says wpa_supplicant daemon started, which I'm hoping is good. modprobe iwl3945 went fine, and ifconfig -a finally gave me my wlan0 interface. However, when I ran /etc/init.d/net.wlan0 start, it gave me this: 

```

* Bringing up interface wlan0

* Starting wpa_supplicant on wlan0...

ctrl_iface exists and seems to be in use - cannot override it

Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore

Failed to initialize control interface '/var/run/wpa_supplicant'.

You may have another wpa_supplicant process already running or the file was 

left by an unclean termination of wpa_supplicant in which case you will need 

to manually remove this file before starting wpa_supplicant again.

* start-stop-daemon: failed to start '/usr/sbin/wpa_supplicant'

* ERROR: net.wlan0 failed to start

```

And sure enough, the ping didn't work. What should I delete from where, and how?

----------

## khayyam

 *ashlyw42 wrote:*   

> [...] You may have another wpa_supplicant process already running [...]

 

ashlyw42 ... and sure enough you do ...

 *khayyam wrote:*   

> [...] remove wpa_supplicant from the default runlevel. If you followed the instructions above then net.wlan0 is responcible for starting wpa_supplicant.

 

 *ashlyw42 wrote:*   

> And sure enough, the ping didn't work. What should I delete from where, and how?

 

```
% rc-update del wpa_supplicant default

% /etc/init.d/wpa_supplicant stop

% /etc/init.d/net.wlan0 start

% sleep 10 && ping -c 1 204.187.15.12

% ping -c 1 forums.gentoo.org
```

best ... khay

----------

## Dodec

Huzzah! Success!!   :Very Happy:  I am eternally grateful to everyone on here for dealing with my painful incompetence, and   being able to find a solution through all of our collective wisdom (except mine, which has been shown by all of this to be nonexistent at this point.) Thank you so much, everyone!!!

----------

## NeddySeagoon

ashlyw42,

Well done!

Welcome to Gentoo. On to your next Gentoo learning opportunity.

----------

