# eth0 is not detected (Solved)

## podollb

Hi,

When I installed Gentoo from the livecd everything was fine (as far as my network connections goes) and then I had to compile the kernel manually to throw in some support for Compaq Smart Array 5xxx conrollers (since genkernel didn't add that). I can access all the websites needed for installation etc etc 

BUT

Now I reboot and start the system and it doesn't find an eth0 device. So I must be missing the driver for the eth card? Why did the livecd find it? (was it because it had every network drivier compiled into it?)Last edited by podollb on Thu May 05, 2005 10:46 pm; edited 1 time in total

----------

## Gherald

 *podollb wrote:*   

> Now I reboot and start the system and it doesn't find an eth0 device. So I must be missing the driver for the eth card? Why did the livecd find it? (was it because it had every network drivier compiled into it?)

 

Yes to your last question.  Run lsmod from the livecd to see what it loads.  The output of lspci might also be helpful...

----------

## podollb

Ok now I am confused. I just recompiled my kernel with every single network driver set to "M" and I updated my lilo.conf and rebooted, it still doesn't recognize eth0.

I did boot to the livecd and took a look at the lspci and saw:

Ethernet Controller Intel Corporation 82557/8/9 Ethernet Pro 100 (rev 0 :Cool: 

I didn't see that driver (exactly) in the kernel stuff, so I just selected them all.

What other things can I try? I know this problem has to be a simple one since the livecd works fine (automagically)

----------

## podollb

Here is the exact problem:

  * Bringing eth0 up (192.168.0.2)...

SIOCSIFADDR: No such device

eth0: unknown interface: No such device

SIOCSIFBRDADDR: No such device

eth0: unknown interface: No such device

SIOCSIFNETMASK: No such device                            [!!]

  * ERROR: Problem starting needed services.

  *              "netmount" was not started.

  * Starting local...                                                   [ok]

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

And then when I look at ifconfig it just shows the lo (no ethx stuff)

----------

## DaveArb

 *podollb wrote:*   

> Ethernet Controller Intel Corporation 82557/8/9 Ethernet Pro 100 (rev 0
> 
> I didn't see that driver (exactly) in the kernel stuff,

 

Device Drivers->Networking support->Ethernet (10 or 100Mbit)->Intel(R) PRO/100+ Support

Least on the machine I just looked on.

Dave

----------

## podollb

Yeah I saw that one, and have it checked as "M" (as I do everything else in the networking part of the kernel config)

Still isn't detected... Do I need to do something different to get it recognized by the OS?

Is there a way I can see how the livecd is detecting it?

Or am I just recompiling the kernel wrong? This is what I have been doing:

cd /usr/src/linux

make menuconfig

(make my selections)

make && make modules_install

cp arch/i386/boot/bzImage /boot/kernel-2.6.11-gentoo-r6.mykern

cp System.map /boot/System.map-2.6.11-gentoo-r6.mykern

cp .config /boot/config-2.6.11-gentoo-r6.mykern

(where mykern is just a way to make that kernel image unique, I change it everytime I recompile the kernel to something else)

Then I update my lilo.conf to point to the correct kernel.

What am I missing?

----------

## podollb

The genkernel would have worked fine for me if it would have had the Smart Array 5xxx support (in the Block Devices), but it didn't, so I had to compile my own -- which brings me to another question (but please don't forget about my eth0 question). I have 4GB of RAM in the the sys, does it matter if my kernel is huge? If it all resides in memory then it doesn't matter right?

Is there a way to compile a complete kernel with everything? I know genkernel says it is large because it 'almost' contains everything, but it obviously doesnt' contain everything since my smart array raid support wasn't included...

Thoughts?

The other thing I am wondering about (while I am sitting here waiting for a miraculous response to fix my eth0 problem) is what difference does it make to compile the kernel with "M" or "*"? I know the latter compiles things directly into the kernel where the former just allows the modules to be included somwhere?

----------

## fvant

if you select M for the driver, be sure you also run  make modules_install after your make  to move the modules to the right place.

and add it (module name)  to /etc/modules.autoload.d/kernel-2.6  (

----------

## podollb

 *fvant wrote:*   

> if you select M for the driver, be sure you also run  make modules_install after your make  to move the modules to the right place.

 

Well I do that if you look back to my description of how I compile and install my custom kernel (right?)

 *and fvant wrote:*   

> and add it (module name)  to /etc/modules.autoload.d/kernel-2.6 

 

And as far as the last part,  check and I don't have anything in that directory. How would I know the name of the module?

----------

## Percius

Checking somthing as M means that it will be compiled as a module. Unless you have a program automagically loading modules based on what hardware is connected then you will have to load the modules via either /etc/modules.autoload.d/kernel-2.6 or modprobe module name.

Until you load the module the hardware is effectively not installed.

Compiling with [*] means that the support is compiled into the kernel and you dont have to load a module, but there are disadvantages to this too.

The Gentoo Handbook has really good documentation on what you need to do to compile your own kernel.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap7

The latter part of this chapter is for Identifying all installed modules and loading the needed ones at boot.

----------

## podollb

 *Percius wrote:*   

> Checking somthing as M means that it will be compiled as a module. Unless you have a program automagically loading modules based on what hardware is connected then you will have to load the modules via either /etc/modules.autoload.d/kernel-2.6 or modprobe module name.
> 
> Until you load the module the hardware is effectively not installed.
> 
> Compiling with [*] means that the support is compiled into the kernel and you dont have to load a module, but there are disadvantages to this too.
> ...

 

Thanks for the insight, I think I will try "*" on everything and see if that gets me anywhere... I can revisit it later if I need to. I just want my eth0 up and running...

 *Percius wrote:*   

> The Gentoo Handbook has really good documentation on what you need to do to compile your own kernel.
> 
> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap7
> 
> The latter part of this chapter is for Identifying all installed modules and loading the needed ones at boot.

 

Yeah that is what I have been working off of to build it and it has worked great. The only problem is the module black magic, since I don't konw the names of modules it make it difficult.

----------

## podollb

Well I just tried to change all the network device drivers to "*" and then rebooted, it still says it doesn't recognize the eth0.

I must be doing something wrong because there is no way it should not have the driver for it now (unless it is using the wrong kernel -- but I don't think that is the case since it boots from the lilo.conf file where I point to the kernel).

----------

## podollb

ok I think I may be on the wrong track. After I reboot and eth0 fails I took a look at "lspci" at the prompt.

And it shows the correct ethernet controller. So what other things could be the problem?

----------

## podollb

Would the order that my scripts are run on startup cause a problem? I know I used rc-update to update things to be run at boot but I have never rearranged what order they are in.

----------

## krinn

try

```

modprobe e100

ifconfig eth0 192.168.0.2

```

if it work just do

```
echo e100 >> /etc/modules.autoload.d/kernel-2.6
```

----------

## podollb

It didn't seem to find that module...

# modprobe e100

FATAL: Module e100 not found.

# ifconfig eth0 192.168.0.2

SIOCSIFADDR: No such device

eth0: unknown interface: No such device

#

----------

## podollb

 *podollb wrote:*   

>  *fvant wrote:*   if you select M for the driver, be sure you also run  make modules_install after your make  to move the modules to the right place. 
> 
> Well I do that if you look back to my description of how I compile and install my custom kernel (right?)
> 
>  *and fvant wrote:*   and add it (module name)  to /etc/modules.autoload.d/kernel-2.6  
> ...

 

Where are the modules supposed to be moved if modules_install works correctly?

----------

## Percius

 *podollb wrote:*   

> Well I just tried to change all the network device drivers to "*" and then rebooted, it still says it doesn't recognize the eth0.
> 
> I must be doing something wrong because there is no way it should not have the driver for it now (unless it is using the wrong kernel -- but I don't think that is the case since it boots from the lilo.conf file where I point to the kernel).

 

Do not change all of the Network devices to [*] that is like buying a mountain because you want to go skiing for a day. 

The module would not load with what krinn said if you didnt have it listed as a module. Change back to the modules do a 

```

make && make modules_install

cp arch/i386/boot/bzImage /boot/kernel-2.6.11-gentoo-r3

cp System.map /boot/System.map-2.6.11-gentoo-r3

cp .config /boot/config-2.6.11-gentoo-r3

```

Those commands were taken straight out of the Gentoo handbook.

After that is all done reboot with the new kernel and then do 

```
find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko' | grep net

```

make sure to chage <kernel version> to somthing like 2.6.11-gentoo-r6.

Please post what the last command prints on the screen. And if e100 is listed try krinn's suggestions again.

ALSO Please Boot with the Gentoo Live CD and run lsmod. Post those results too

 *Gherald wrote:*   

>  Run lsmod from the livecd to see what it loads.  The output of lspci might also be helpful...

 

----------

## podollb

ok I am attempting that now, but I do have a question while that is compiling...

If I went into the menuconfig and selected my ethernet driver to be compiled as a module "M" when I make the new kernel and then I do the "make modules_install" shouldn't it already be in the correct location?

I don't understand why I need to physically move it like 'krinn' said. Wouldn't modules_install do that for me?

----------

## Percius

krinn Never told you to move a module 

Lets disect his command

```

echo e100 >> /etc/modules.autoload.d/kernel-2.6

```

echo e100  # prints e100 to the screen

>> adds output of previous command to the last line of the file that comes after it

/etc/modules.autoload.d/kernel-2.6 the file that gets e100 added to it. This is the file gentoo uses to Identify which modules to load automatically on boot.

----------

## podollb

ok I have a better picture of what is going on now, but I still don't understanad why it has to be manually appended to the auto load file? If I compile the kernel with my ethernet adapter driver as a module "M" and then I run the 'make modules_install' I would think it would do that for me. But I guess not. What does that do then? (or is that the part that moves the modules around and then it is left up to the user to add the ones he/she wants loaded in the file we have been discussing?)

----------

## pale october

I was having some problems with a second eth in my box for awhile, and what fixed it for me was emerging coldplug and adding it to my boot sequence.  Not sure if this is the same situation but it doesn't hurt to try right?  

--Pale October

----------

## podollb

 *pale october wrote:*   

> I was having some problems with a second eth in my box for awhile, and what fixed it for me was emerging coldplug and adding it to my boot sequence.  Not sure if this is the same situation but it doesn't hurt to try right?  
> 
> --Pale October

 

Yeah actually I was looking around for solutions that was one thing I did run accross. I did it and rebooted and it ended up picking up a bunch of PCI cards and stuff but it didn't resolve my issue. But the nice part about this problem is that it isn't a horrible one since I have network access via the livecd and not when I reboot it is just a matter of figuring out what part of the kernel I am missing (or module).

----------

## krinn

As you seems to complain to short answer, here comes the full one:

when you do make modules_install the install will copy all drivers that you state as M to /lib/modules/kernelversion/...

This way when you will ask the kernel to load your driver it will know where to find them.

How you load the driver ?

- modprobe drivername

- gentoo will autoload it if you query it in modules.autoload.d/kernel2.6 file

- the system can autoload also some drivers under some conditions (for exemple coldplug can load a module when it detect a new hardware...)

Why e100 name ?

You said you have an intel 100mb card, this card is handle by the driver named as "e100" you can get the name in the make menuconfig -> ... -> Intel Pro/100 support -> click HELP instead of <select>

 *Quote:*   

> To compile this driver as a module, choose M here and read
> 
> <file:Documentation/networking/net-modules.txt>. The module
> 
> will be called e100.

 

Why using module instead of hard compile it in kernel ?

When you compile a driver as module, you have choice to load it to use it OR unload it to free memory (why loading something you don't need ?), it's pretty useful 

1st: if you have for example an usb device, when plug, you load the driver, when unplug, you just unload the driver...

2nd: it's also useful if you add a lot of devices to your computer to test them (got friends?)

3rd: also if you don't know what model/card you have, you can just compile all models as module then try load them until you found one that works with it

4rd: nearly all modules can have "specials" options that are needed by some specific hardware, or gives some extras options.

But unless you LOAD the module, the card will not work.

the /etc/modules.autoload.d/kernel2.6 file is where you put the module you know you need to be load in order to work, so gentoo will autoload these modules for you so you will not have to always type "modprobe e100" after gentoo has boot.

But lspci show that my card is working ?

No lspci show that your hardware is present, but does not show that a driver is load to handle it... So if you don't have a driver for your ethernet card, it's still normal that lspci show you have one in your computer even you don't use it.

----------

## podollb

ok I got it working...

I started over with the initial config for the kernel (and then ran the make menuconfig). I then added support for the SCSI RAID Smart Array 5xxx controllers into the kernel with "*" I then found the Intel Pro 10/100 ethernet device and added it to the kernel as a module "M" and then selected a few other things in the kernel config like support network device and stuff like that and then updated my lilo.conf to point to the new kernel and rebooted -- and it works -- I have internet. 

So I don't know if somewhere along the way I messed something up or if I just checked the one thing I needed to in the menuconfig that was giving me all this headache. Either way I want to thank everyone that helped me out, belive it or not I learned a lot from you guys in this little session. And it goes to show the Gentoo community is quite smart and helpful.

----------

