LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2014, 04:36 PM   #1
istalev
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Rep: Reputation: Disabled
Compiling Linux with Ethernet drivers


Hi,

I am cross-compiling Linux 3.16 for arm64 from source using the source code from here.

I am able to compile/run the kernel without a problem. When I run it, however, it appears that the Ethernet driver is missing. When I run:

ifconfig -a

I only get:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:784 (784.0 B) TX bytes:784 (784.0 B)

But there is no eth0 or eth1. I am attempting to recompile the kernel with ethernet enabled. First, I do:

make ARCH=arm64 defconfig

Inside the newly generated .config, CONFIG_ETHERNET=y is already present. I then add CONFIG_E1000=y and CONFIG_E1000E=y.

However, when I start compiling, my .config file automatically gets moved to .config.old and the new .config no longer contains CONFIG_E1000 and CONFIG_E1000E.

My overall goal is to be able to run this command:

ifconfig eth0 $SERVER txqueuelen 1000

without getting this error:

ifconfig: SIOCSIFADDR: No such device

Any help would be greatly appreciated!
 
Old 08-05-2014, 04:56 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Have you tried "make menuconfig"?
 
Old 08-06-2014, 02:16 PM   #3
istalev
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you, that helped. menuconfig does give a nice interface to pick exactly the configuration one wants. However, there seem to be many drivers related to ethernet so I am unsure exactly which I need to choose in order to have eth0/eth1 show up when I run ifconfig on the compiled kernel...I do not explicitly see the E1000 configuration. Therefore I enabled all the drivers related to ethernet. Now, ifconfig -a results in:

bond0 Link encap:Ethernet HWaddr CA:FB:D0:02:D0:7E
BROADCAST MASTER MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

dummy0 Link encap:Ethernet HWaddr 02:58:3E:AF:F3:41
BROADCAST NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:784 (784.0 B) TX bytes:784 (784.0 B)

I believe this should suffice for what I am trying to setup.
 
Old 08-06-2014, 03:08 PM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Have you tried lspci to fnd out what card you have? Also if you can connect usb you can download & install the driver.
 
Old 08-06-2014, 03:25 PM   #5
istalev
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using a full-system simulator, so it's not actually a real machine. I am running a client-server setup and trying to communicate over ethernet. It appears that the simulator expects the eth0 interface to be there. Neither dummy0 or bond0 seem to work for simple ping tests. I think I must have missed the necessary kernel configuration, though I believe I have them all enabled via the menuconfig...

Edit: Running lspci results in this:

lspci: /sys/bus/pci/devices: No such file or directory
 
Old 08-06-2014, 03:29 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
You shouldn't have a bonded connection. Something is wrong there.

Although this is for fog it should work.
Assumes no KMS.

" Build Process

Install the required packages to build the kernel with:
RHEL/Fedora/CentOS/.rpm other: (need confirmation that this is all the packages required?!?, may also need qt-devel and a few others)

yum groupinstall "Development Tools"

Ubuntu/Debian/.deb other:

sudo apt-get install qt3-dev-tools libqt3-mt-dev

Download the latest kernel source (which in this case is version 2.6.35.3):

cd /usr/src
wget http://www.kernel.org/pub/linux/kern....6.35.3.tar.gz

Extract the tar file:

tar -zxvf linux-2.6.35.3.tar.gz

Copy the .config file from the fog release package which is located in the Fog Setup ./kernel directory:

cp /opt/fog-setup/fog_0.29/kernel/kitchensink.config /usr/src/linux-2.6.35.3/.config

Start configuring the kernel:
RedHat forks:

make menuconfig

Ubuntu/Debian, etc:

make xconfig

This will run the kernel configuration tool, you will need to navigate around it a little to get a feel for it as there are many options. Placing a check mark in a box will include it in the kernel, and unchecking an item will remove it from the kernel.
To add or remove drivers from the kernel you will need to go to Device Drivers, and network drivers are in Network Device Support.
Important: All settings required by fog are already in the kernel, when you are done making changes click save and close the application.
Now you need to build the kernel:

make bzImage

or possibly just:

make

This could take 10 minutes, depending on the speed of your machine and how many options you checked. "
http://fogproject.org/wiki/index.php..._Custom_Kernel
 
Old 08-06-2014, 03:38 PM   #7
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by istalev View Post
I am using a full-system simulator, so it's not actually a real machine. I am running a client-server setup and trying to communicate over ethernet. It appears that the simulator expects the eth0 interface to be there. Neither dummy0 or bond0 seem to work for simple ping tests. I think I must have missed the necessary kernel configuration, though I believe I have them all enabled via the menuconfig...

Edit: Running lspci results in this:

lspci: /sys/bus/pci/devices: No such file or directory
Try this:
Code:
lspci | grep -i network
 
Old 08-06-2014, 03:56 PM   #8
istalev
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Code:
lspci | grep -i network
also yields: lspci: /sys/bus/pci/devices: No such file or directory

I am using the kernel specified in my original post (linux-linaro) since it is most compatible with the simulator I'm using. I have enabled ALL the configuration options in "Device Drivers --> Network device support --> Ethernet driver support" and any others I saw that are related to networks.
 
Old 08-06-2014, 04:02 PM   #9
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by istalev View Post
Code:
lspci | grep -i network
also yields: lspci: /sys/bus/pci/devices: No such file or directory

I am using the kernel specified in my original post (linux-linaro) since it is most compatible with the simulator I'm using. I have enabled ALL the configuration options in "Device Drivers --> Network device support --> Ethernet driver support" and any others I saw that are related to networks.
Try running it again with "root" privileges-
 
Old 08-06-2014, 04:17 PM   #10
istalev
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Running it again as root does not find it either. I opened up the system's disk image, and the /sys directory is indeed empty. The disk image I am using is also from Linaro.
 
Old 08-06-2014, 05:06 PM   #11
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by istalev View Post
Running it again as root does not find it either. I opened up the system's disk image, and the /sys directory is indeed empty. The disk image I am using is also from Linaro.
Something is indeed odd, the initrd image should still be presented in the latest kernel.

Try jefro's instructions using kernel 2.6.35.3-

If it helps; both initrd and ramfs are zipped at compile time but the difference is initrd is a block device unpacked to be mounted by the kernel at booting.
While ramfs is unpacked via cpio into memory.

I found that the other day studying documentation about LILO-

Have you tried recompiling the kernel?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install Ethernet drivers in Damn small linux Sanpreet Singh Linux - Newbie 1 01-25-2013 03:11 AM
Proprietary nvidia drivers vs. generic intel sound and ethernet drivers vharishankar Linux - Hardware 2 02-22-2005 05:32 AM
problems in installing drivers for myson mtd80x fast based ethernet card drivers pop_harish Linux - Hardware 0 02-12-2005 05:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration