# Initrd does not recognize my Ethernet Card

## Deimos9999

Hello,

I've updated my kernel's sources. First of all I manually compiled them, and it worked fine. Then I tried to compile them with genkernel, and I got no error. But when I rebooted with the new kernel (kernel image + initramfs) it could not recognize my Ethernet card. The first error is something like:

```
error fetching interface information
```

The very strange thing (in my experience, of course) is that if I boot the same kernel image WITHOUT the initramfs all goes fine.

I don't think it's a kernel configuration problem, both because the kernel image alone recognize my card, and because even if I use the configuration file used by the LiveCD, which worked when I installed Gentoo, I get the same error.

Thanks for your help,

Deimos9999

----------

## erik258

please post lspci so we can gunzip /proc/config.gz | grep  for the driver.

----------

## Deimos9999

Here's lspci output  :Razz: 

```

00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 04)

00:01.0 PCI bridge: Intel Corporation 82815 815 Chipset AGP Bridge (rev 04)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 03)

00:1f.0 ISA bridge: Intel Corporation 82801BAM ISA Bridge (LPC) (rev 03)

00:1f.1 IDE interface: Intel Corporation 82801BAM IDE U100 (rev 03)

00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #1) (rev 03)

01:00.0 VGA compatible controller: nVidia Corporation NV11 [GeForce2 Go] (rev b2)

02:03.0 Multimedia audio controller: ESS Technology ES1983S Maestro-3i PCI Audio Accelerator (rev 10)

02:06.0 Ethernet controller: 3Com Corporation 3c556 Hurricane CardBus [Cyclone] (rev 10)

02:06.1 Communication controller: 3Com Corporation Mini PCI 56k Winmodem (rev 10)

02:0f.0 CardBus bridge: Texas Instruments PCI4451 PC card Cardbus Controller

02:0f.1 CardBus bridge: Texas Instruments PCI4451 PC card Cardbus Controller

02:0f.2 FireWire (IEEE 1394): Texas Instruments PCI4451 IEEE-1394 Controller

```

----------

## erik258

Thank you. now we can hopefully identify the driver you need in the kernel.  

02:0f.0 CardBus bridge: Texas Instruments PCI4451 PC card Cardbus Controller 

02:06.0 Ethernet controller: 3Com Corporation 3c556 Hurricane CardBus [Cyclone] (rev 10)

There it is... Looks like a cardbus card.  You may have to filldle with PCMCIA a bit too, or read a howto.  But to dive in... (from make menuconfig)

Bus options (PCI etc.)  --->   PCCARD (PCMCIA/CardBus) support  --->

    <M> PCCard (PCMCIA/CardBus) support

    <M>   16-bit PCMCIA support (NEW)

    [*]   32-bit CardBus support (NEW) 

    <M>   CardBus yenta-compatible bridge support

Device Drivers  ---> Network device support  ---> Ethernet (10 or 100Mbit)  --->

  [*] 3COM cards

    <M>   3c590/3c900 series (592/595/597) "Vortex/Boomerang" support (NEW)

I think 3c590/3c900 is what you'll need.  I could be wrong; it listed the model name (Cyclone) but not the model number in the description of that item, but fits better there than anywhere else.

----------

## Deimos9999

Thanks for your help, but I have already selected what you tell me. I also tried to compile some of them in the kernel instead of as module, but I get the same error. Is there anything in the kernel .config file that influence the creation of the initramfs file? I really think the problem is there, because the Kernel alone is able to find and use the card.

Thaks again,

Deimos9999

----------

## erik258

Could the problem be related to PCMCIA utilities that load after the initramfs is being used?  Could it be that you are using the old pcmcia-cs stuff but don't have legacy support enabled in the kernel, in the Bus -> PCMCIA section?  And why, if I may ask, do you need ethernet support before you mount the root filesystem?  

I would think that you wouldn't need to do anything special if you had compiled support into the kernel.  I am not sure why this didn't work for you; most kernel drivers don't need anything special, but some do.  PCMCIA is one that needs external packages, so maybe those packages are the problem.

----------

## Deimos9999

I think I did not explain very well my situation. I DON'T have a PCMCIA ethernet card, I have just a Notebook with integrated ethernet card. And I DON'T need ethernet support before the mounting of the root FS, but I'd like to eventually have it  :Razz: .

I'm sorry if I made you waste your time because I didn't explain the background. I hope this new information would be helpful to solve my problem.

----------

## erik258

a waste of a few moments of typing is worth very little; i could save a lot more of my own time being less logorrheic in my posts, and more thoughtful at the command line.  

 *Quote:*   

> 
> 
> I DON'T have a PCMCIA ethernet card

 

I'm afraid you probably do:

 *Quote:*   

> 02:06.0 Ethernet controller: 3Com Corporation 3c556 Hurricane CardBus [Cyclone] (rev 10)

 

And it's probably integrated into your computer, on the pcmcia bus.  It isn't removable, but can still be (and probably is) on that bus.  Maybe not.  I don't really think it matters that much, the driver appears to be the same.  But if it is on the pcmcia bus you'll need those drivers to be accessible along with the network drivers.  I do recommend getting them both compiled into your kernel the next time, if you want them to be there on boot.  

 *Quote:*   

> 
> 
> And I DON'T need ethernet support before the mounting of the root FS, but I'd like to eventually have it [..] . 

 

usually the network is configured towards the end of the booting process.  If that were an acceptable configuration, i could certainly help you with it, and it would avoid having to deal with initramfs at all, wich is only applicable to the very first part of the boot process.

 *Quote:*   

> I hope this new information would be helpful to solve my problem.

 

Me too.  You can use your network adapter once you boot, right?

----------

## wynn

The initramfs will load some Ethernet controller drivers but may not load the 3c59x. Since the same thing happens whether 3c59x is a module or compiled in, the reason for the errant behaviour is probably not to do with initramfs loading it.

[Edit] erik258 has shown me that I overlooked the CardBus connection of your Ethernet controller: initramfs may not load this module, I don't think it knows about PCMCIA/CardBus. Sorry, wrong, it does should have checked first[/Edit]

[Aside]The only reason the initramfs has for doing anything with a network driver is if it needs to mount the root fs over NFS.

Have you got CONFIG_ROOT_NFS set in your .config by accident?[/Aside]

Another thing that might cause strange behaviour is using "root=/dev/ram0" and "init=/linuxrc" on the kernel command line when booting using the initramfs.

Probably the best place to look for an explanation is round the time that the error message you quoted appears. Did this come from /var/log/messages or appear on the console during boot?

Could you provide a bit more context for the error message?

----------

## Deimos9999

The error appears during the boot.

```

INIT: Entering runlevel: 3

...

 * Starting eth0

eth0: error fetching interface information: Device not found

eth0: error fetching interface information: Device not found

eth0: unknown interface: No such device

eth0: error fetching interface information: Device not found

eth0: unknown interface: No such device

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...

Error, dhcpStart: ioctl SIOCGIFHWADDR: No such device

eth0: unknown interface: No such device

...

 * ERROR: cannot start netmount as net.eth0 could not start

...

```

Sometimes I saw error also before this point, but I don't remember what I did since then.

Moreover if I run lsmod:

```
lsmod | grep 3c

3c59x        31400    0

mii           3040    1 3c59x

```

So the module is loaded, isn't it?

The only entries NFS related I find activated in the kernel configuration are:

NFS_COMMON [=y]

NFSD [=m]

NFSD_TCP [=y]

NFS_V3 [=y]

NFS_FS [=m]

ROOT_NFS is instead set to [=n]

I would happy to provide more useful information. Thanks to all.

----------

## erik258

after it boots, what happens when you type ifconfig -a ?

----------

## wynn

The first set of error messages appear to come from dhcpcd which can't get in contact with the NIC.

Your lsmod shows the 3c59x â are the appropriate PCMCIA support and CardBus drivers (pcmcia_core, pcmcia (16-bit PCMCIA support), yenta_socket (CardBus yenta-compatible bridge support)) also loaded? This may be the problem (if this is the solution, it's due to erik258's careful explanation (!=loghorrea)).

The kernel, without initramfs, with CONFIG_KMOD to get automatic kernel module loading, will load everything needed but initramfs may not, as its primary purpose is mounting the root fs.

To get a better idea of what initramfs is doing it would be necessary to look at its contents â which you might see as a step too far   :Smile: 

----------

## Deimos9999

Thanks to erik258 I found what caused all: booting the kernel image alone my card is named eth0, the initramfs recognize it as eth1. Questions now are:

Why the initramfs changes the device name?

How can I restore the correct name?

I have still doubts on why should the system load PCMCIA module for a PCI card, but it's not relevant for the problem, so it's ok  :Wink: .

Thanks for all your help,

Deimos9999

----------

## wynn

A common problem is enabling FireWire in the kernel which brings in the Ethernet over FireWire module, eth1394. This will often take over (or the kernel will give it) eth0 pushing your real Ethernet controller to eth1.

The presence of eth1394 in your lsmod listing is a strong hint and you can tell which driver eth0 is using by

```
# ethtool --driver eth0

driver: r8169

version: 2.2LK

firmware-version:

bus-info: 0000:02:01.0
```

or

```
# udevinfo -a -p /sys/class/net/eth0|grep DRIVERS

    DRIVERS=="r8169"

    DRIVERS==""

    DRIVERS==""
```

ethtool is in sys-apps/ethtool and udevinfo you will have anyway as you have udev.

The simplest thing, if you don't use FireWire, is to disable it in the kernel â in your case the genkernel kernel .config.

If you do use FireWire then you can set

```
RC_PLUG_SERVICES="!eth1394"
```

 in /etc/conf.d/rc instead.

 *Deimos9999 wrote:*   

> I have still doubts on why should the system load PCMCIA module for a PCI card

 If the Ethernet controller is attached to the CardBus bus rather than the PCI bus, then the CardBus module may be needed to run the CardBus. The PCI bus will also have a driver for it â you have to enable CONFIG_NET_PCI "EISA, VLB, PCI and on board controllers" for NICs using the PCI bus.

----------

## Deimos9999

I solved all my problems!

Thanks to 

 *erik258 wrote:*   

> after it boots, what happens when you type ifconfig -a ?

 

I found out that the problem was in the incorrect naming of the cards. In fact, as I ran 

```
dhcpcd eth1
```

 I could ping successfully.

Unfortunally setting 

```
RC_PLUG_SERVICES="!eth1394"
```

 did not work. But removing 

```
Device Drivers -> IEEE1394 (Firewire) support -> Ethernet 1394
```

 made all working well at startup.

Thanks for your help to all,

Deimos9999

----------

## wynn

 *Deimos9999 wrote:*   

> Unfortunally setting 
> 
> ```
> RC_PLUG_SERVICES="!eth1394"
> ```
> ...

 My mistake, I wasn't thinking. It should have been 

```
RC_PLUG_SERVICES="!net.eth0"
```

but then you would have had your NIC on eth1 and you wanted it to be on eth0 so it wouldn't have helped anyway.

----------

