Help with updating NIC drivers in Ubuntu

brachy33

Gawd
Joined
Oct 14, 2004
Messages
567
I have recently setup a server using a Intel® PRO/1000 PT Server Adapter. The current stable kernel in Ubuntu for my machine is 2.6.15-26-amd-generic. This kernel does NOT have the proper drivers for my NIC. I have downloaded the correct drivers from here:

http://downloadfinder.intel.com/scr...FullName=Linux*&lang=eng&strOSs=39&submit=Go!

In the readme file, Intel is explaining how to build, compile and install the driver into Linux. However, I am very new to Linux and I am not quite sure how to go about this. These are the instructions per Intel:

Building and Installation
=========================

To build a binary RPM* package of this driver, run 'rpmbuild -tb
<filename.tar.gz>'. Replace <filename.tar.gz> with the specific filename
of the driver.

NOTE: For the build to work properly, the currently running kernel MUST
match the version and configuration of the installed kernel sources.
If you have just recompiled the kernel reboot the system now.

RPM functionality has only been tested in Red Hat distributions.

1. Move the base driver tar file to the directory of your choice. For
example, use /home/username/e1000 or /usr/local/src/e1000.

2. Untar/unzip archive:

tar zxf e1000-x.x.x.tar.gz

3. Change to the driver src directory:

cd e1000-x.x.x/src/

4. Compile the driver module:

make install

The binary will be installed as:

/lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000/e1000.[k]o

The install locations listed above are the default locations. They
might not be correct for certain Linux distributions. For more
information, see the ldistrib.txt file included in the driver tar.

5. Load the module using either the insmod or modprobe command:

modprobe e1000

insmod e1000

Note that for 2.6 kernels the insmod command can be used if the full
path to the driver module is specified. For example:

insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000/e1000.ko
===================================================

I am also trying to find this out on the Ubuntu forums but haven't gotten any good feeback as of yet.

With Ubuntu, I don't think the RPM tool is available. So, what is the correct way to do this in Ubuntu?? Can someone give some advice or point me in a direction where I might find step by step how-to info for installing these drivers??

Thank you!
 
1.) You don't need to make it into an RPM - only useful if you use an RPM based distribution

2.) apt-get the kernel-sources - If I remember correctly, Ubuntu does not ship with the actual linux kernel source code, just a binary compiled kernel. But you can get the kernel sources by apt-getting from official mirrors.

Note: you have to get the same version of the kernel sources as the one you're running - a stock Dapper install (6.06) is 2.6.15 kernel I think (the specialized Ubuntu patched one).

Then you just follow the directions to the letter from step 1.

1.) put the source tarball somewhere like in your home directory.
2.) Untar
3.) cd into the directory, and make && make install...
etc.

If you have trouble, let us know where exactly you get stuck.
 
BillLeeLee: Thanks for the reply. I must confess that so far I do not understand much of why I need to do things like "build headers", "build-essential", "make", "install", and the many others just to install a driver. So, I am just taking these things for granted versus actually understanding WHY I am doing them.

I really LOVE Linux and the different distros that I have been using thus far and I am doing my best to get info and books on the topics to learn the basics of Linux programming. Definitely more in depth and with good reason! It's great stuff. I gotta get used to not being able to just run some executable file to install all my little drivers for me. With that behind me, what would some of the Terminal code look like for installing these newer drivers? Would you mind walking me through the code, as it would be done in the Ubuntu Terminal?

My "uname -r" gives 2.6.15.26-amd-generic. So, to start off the whole thing, what should I first do in the Terminal? I put the Tarball file in a folder (directory?) called "e1000" in "/home/username/e1000".
sudo apt-get install kernel-sources 2.6.15.26.amd-generic

sudo apt-get install build-essential

sudo untar /home/username/e1000/e1000-7.1.9.tar.gz

sudo cd ....

The Untar and cd steps, as you can tell, I am not sure how to write in the Terminal exactly. From there, what should my next code steps look like (ie. make, install)? Again, thank you for any help.
 
Okay, I may have the package name wrong, since I don't use Ubuntu anymore and have no idea what you have to apt-get to get the kernel sources, but I'll give it a try and explain why I do what I do and why the instructions do what they do.

Here are the steps I would follow:

STEPS:

1.) Grab the kernel sources
Code:
sudo apt-get install linux-source-2.6.15

2.) Just to make it easier, let's make a folder in your home directory to store the driver into:
Code:
mkdir ~/drivers

If you didn't know, ~ is an alias for your home directory, typically /home/USERNAME, or /root if you're root user.

3.) Download/move the tarballed gzipped driver into the directory drivers, use mv or download it there somehow, and then change into the drivers directory.

Code:
cd ~/drivers

4.) Untar the tar.gz driver. If you got the latest, it's called e1000-7.1.9.tar.gz
Code:
tar xzf e1000-7.1.9.tar.gz

Just use tab completion (hit tab after typing e100... and the bash terminal will complete it for you).

tar is the tar archiver. The three options we pass it are zxf

z = ungzip. the .tar.gz extension indicates the folder is both tarballed and has also been compressed with the gzip tool. So this command ungzips, handy.

x = extract

f = file. Means to operate on the file you give it.

5.) After executing the untar command, you will get a new directory called: e1000-7.1.9. cd into its src file.

Code:
cd e1000-7.1.9/src

Again, just use tab completion so you don't have to type in the whole e1000... bit.

6.) compile and install the binary.

Code:
sudo make install

If you will deal with compiling programs in the future (which you should rarely have to) or will be getting into like C/C++ programming, then these commands will become pretty familiar. make is the make utility, which executes commands in a special file called makefile or Makefile (the format of which is really annoying). And the general format for most unix/linux programs is to have a label called install, so when you call make install the make program determines if anything needs to be compiled and then installs the compiled binary (or whatever) into a specified directory. But this is nitty gritty stuff that you shouldn't have to worry too much about at this point.

7.) The module will be installed in a pretty typical module location...
Code:
/lib/modules/Some_Kernel_Version/kernel/drivers/net/e1000/e1000.ko

Kernel modules are almost always located inside these directories. You'll see a lot of other stuff in here since the binary Ubuntu kernels have pretty much every module for general usage compiled with it.

8.) you are now ready to load the module during the runtime.

Code:
sudo modprobe e1000

modprobe is a handy command used to add or remove modules during runtime. There is a lot more to it, but I couldn't possibly explain it all, so I'll direct you to manpages later.

9.) restart the network interface.

Code:
sudo ifconfig eth0 down && sudo ifconfig eth0 up

ifconfig is used to configure network interfaces like your NIC. What the above line does is just bring down eth0 (commonly your primary NIC) and then brings it back up.

If you don't know what a command does or what all its options are, I suggest you get friendly with man.

For example, if you don't know what tar's options are - type in
Code:
man tar
in a terminal and a manual page for tar is brought up. Many linux command have a man page.

As to why you need stuff like 'make', 'gcc', and such - since Ubuntu targets end users, it doesn't come with development tools installed by default (at least not when I was using it) and the updated e1000 drivers Intel provides is in source code form, so you have to compile it before using it. This requires the programs like 'make' and 'gcc' (GNU Compiler collection tools) installed.

linux-headers are the essential linux header files (for C/C++) that are necessary to build pretty much all linux programs. I didn't know Ubuntu didn't ship with those included either. :confused:
 
Thank you very much for your time. I will let you know how the setup goes later today!

Best regards!
 
BillLeeLee,

I am getting stuck at the "sudo make install" command. Everything up to that point was working just perfectly, as far as I could tell. Here is what I am getting after the last command:

Code:
timserver@timserver-desktop:~$ sudo apt-get install linux-source-2.6.15
Reading package lists... Done
Building dependency tree... Done
linux-source-2.6.15 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
timserver@timserver-desktop:~$ cd ~/drivers
timserver@timserver-desktop:~/drivers$ cd e1000-7.1.9/src
timserver@timserver-desktop:~/drivers/e1000-7.1.9/src$ sudo make install
Makefile:66: *** Linux kernel source not found.  Stop.
timserver@timserver-desktop:~/drivers/e1000-7.1.9/src$

Please note that this was the second time around doing this in the terminal, so I don't have the unzipping code in there. So, why do you think that it's telling me that "Linux kernel source not found. Stop" when I just got the source?

Thanks again for your help! It has been fun learning these few coding bits.
 
Paste the output of:

Code:
ls /usr/src/ | grep linux

as well as the output of:

Code:
ls /lib/modules/

and then the output of:

Code:
uname -r

Thanks.
 
Thanks for the quick reply. Here is the output of the info you requested:

Code:
timserver@timserver-desktop:~$ ls /usr/src | grep linux
linux-source-2.6.15.tar.bz2

timserver@timserver-desktop:~$ ls /lib/modules/
2.6.15-23-amd64-generic  2.6.15-26-amd64-generic

timserver@timserver-desktop:~$ uname -r
2.6.15-26-amd64-generic

Thanks again.
 
Umm, sorry, I got a little thing wrong - you don't need kernel sources to compile the external intel modules, according to Ubuntu's package repository site. All you need are the linux kernel-headers.

So...

Code:
sudo apt-get install linux-headers-2.6.15-26-amd64-generic

And resume from where you last left off.

I hope that works. :)
 
OK! Everything appeared to work from that change. Here is the info from the terminal as I went about the install:

Code:
timserver@timserver-desktop:~$ sudo apt-get install linux-headers-2.6.15-26-amd6 4-generic
Password:
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  linux-headers-2.6.15-26
The following NEW packages will be installed:
  linux-headers-2.6.15-26 linux-headers-2.6.15-26-amd64-generic
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 7773kB of archives.
After unpacking 77.0MB of additional disk space will be used.
Do you want to continue [Y/n]? Y

Get:1 [url]http://security.ubuntu.com[/url] dapper-security/main linux-headers-2.6.15-26 2. 6.15-26.46 [6910kB]
Get:2 [url]http://security.ubuntu.com[/url] dapper-security/main linux-headers-2.6.15-26-am d64-generic 2.6.15-26.46 [863kB]
Fetched 7773kB in 34s (224kB/s)
Selecting previously deselected package linux-headers-2.6.15-26.
(Reading database ... 74092 files and directories currently installed.)
Unpacking linux-headers-2.6.15-26 (from .../linux-headers-2.6.15-26_2.6.15-26.46 _amd64.deb) ...
Selecting previously deselected package linux-headers-2.6.15-26-amd64-generic.
Unpacking linux-headers-2.6.15-26-amd64-generic (from .../linux-headers-2.6.15-2 6-amd64-generic_2.6.15-26.46_amd64.deb) ...
Setting up linux-headers-2.6.15-26 (2.6.15-26.46) ...

Setting up linux-headers-2.6.15-26-amd64-generic (2.6.15-26.46) ...

timserver@timserver-desktop:~$ cd ~/drivers

timserver@timserver-desktop:~/drivers$ cd e1000-7.1.9/src

timserver@timserver-desktop:~/drivers/e1000-7.1.9/src$ sudo make install
make -C /lib/modules/2.6.15-26-amd64-generic/build SUBDIRS=/home/timserver/drive rs/e1000-7.1.9/src modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.15-26-amd64-generic'
  CC [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000_main.o
  CC [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000_hw.o
  CC [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000_param.o
  CC [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000_ethtool.o
  CC [M]  /home/timserver/drivers/e1000-7.1.9/src/kcompat.o
  LD [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000.o
  Building modules, stage 2.
  MODPOST
  CC      /home/timserver/drivers/e1000-7.1.9/src/e1000.mod.o
  LD [M]  /home/timserver/drivers/e1000-7.1.9/src/e1000.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.15-26-amd64-generic'
gzip -c ../e1000.7 > e1000.7.gz
# remove all old versions of the driver
find /lib/modules/2.6.15-26-amd64-generic -name e1000.ko -exec rm -f {} \; || tr ue
find /lib/modules/2.6.15-26-amd64-generic -name e1000.ko.gz -exec rm -f {} \; ||  true
install -D -m 644 e1000.ko /lib/modules/2.6.15-26-amd64-generic/kernel/drivers/n et/e1000/e1000.ko
/sbin/depmod -a || true
install -D -m 644 e1000.7.gz /usr/share/man/man7/e1000.7.gz
man -c -P'cat > /dev/null' e1000 || true
man:
cannot write to /var/cache/man/cat7/e1000.7.gz in catman mode
e1000.

timserver@timserver-desktop:~/drivers/e1000-7.1.9/src$ sudo modprobe e1000

So, after all that I think everything is working as it should. However, this part:

Code:
cannot write to /var/cache/man/cat7/e1000.7.gz in catman mode
e1000.

...Has got me a little confused. Did it install ok? I did a:

Code:
lspci | grep Eth
And I received this:

Code:
0000:02:00.0 Ethernet controller: Intel Corporation: Unknown device 107d (rev 06)

Do you think that Ubuntu is using the correct driver now or should I see something like "Intel Corporation e1000" or something along those lines?

You have been the most helpful person I have come across on these forums. I can't thank you enough for your help.

Tim
 
I am thinking that the driver installed. After doing a broadband speed test, I tested the highest that I have ever gotten on this server:
7 megabits per second
Communications 7 megabits per second
Storage 853.3 kilobytes per second
1MB file download 1.2 seconds
Subjective rating Awesome

Info
Date & time Thursday, August 3, 10:23PM*
Test type IDT4 Free
Connection type Cable
Region Illinois
Data size 1024KB

That was either a wicked coincidence or things are working as they should now. I have never gotten above 4 Mb/s in my past testing!
 
Well, the catman thing is not a big deal - it just couldn't install the man pages for the driver for some reason.

I would assume you already have a current ethernet device since you're apt-getting, and that interface is called "eth0"

Confirm this with:

Code:
ifconfig

Let's see if your system sees the Intel Pro/1000

Try...
Code:
ifconfig eth1

edit: not sure about your freak speed up, but any network card out there today would not be limited by a 4 Mbps connection (10/100/1000 you know).
 
Yes, connection is working albeit I don't know if Ubuntu is using the new driver.

Code:
timserver@timserver-desktop:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:15:17:0B:FF:B7
          inet addr:192.168.0.180  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::215:17ff:fe0b:ffb7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24574 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4623216 (4.4 MiB)  TX bytes:4616230 (4.4 MiB)
          Base address:0xac00 Memory:fe9e0000-fea00000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:368 errors:0 dropped:0 overruns:0 frame:0
          TX packets:368 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:116650 (113.9 KiB)  TX bytes:116650 (113.9 KiB)


And then...

Code:
timserver@timserver-desktop:~$ ifconfig eth1
eth1: error fetching interface information: Device not found

This is still throwing me off...

Code:
timserver@timserver-desktop:~$ lspci | grep Eth
0000:02:00.0 Ethernet controller: Intel Corporation: Unknown device 107d (rev 06)


The connection on eth0 is so much faster now. Just loading these pages as well as logging into my work server and others is noticeably faster.
 
Wait, does this machine only have *one* NIC, the PCI-express one?

Well, it should be using the new e1000, since if you look at the output, it removed the old e1000 in /lib/modules... and put a new one in.
 
I have been using 2 of the 3 NIC's on this system. One was a Broadcom NIC that was really pathetic and always dropped packets as well as people connecting to the NIC during gaming (I have now disabled this NIC per jumper removal on my board). The second was the nVidia nF4 LAN which I had never enabled to begin with. The main NIC, the Intel 1000 PT NIC, is the one I wanted to get working at its peak. After your instructions for updating the driver, this machine and its ability to now negotiate a solid net link is simply amazing!

I just got done hosting a 6 on 6 session of BF2 on the server. In the past, a few people would get occasional lag and some dropped connections. After playing tonight with some friends, they have all given 2 thumbs up and said that they have never jumped on my server and had it that smooth before. I was able to do that behind a 8Mbs/768Kbs broadband line, which most people said was impossible. Now, it's back to setting the server up as an FTP and home-based server!

In all seriousness, thank you for your time. I have printed out all your instructions and will be documenting them for referral down the road. Now, is there some place I can send a check to?? ;-)

Best regards,

B33
 
Yes, please wire the money to my secret Swiss account...

But in all seriousness, glad it worked. :)

If you ever update your kernel and the kernel dosn't come with the improved e1000 drivers, you'll have to repeat the steps again for the new kernel (get new linux headers for that kernel, recompile the driver).
 
Use 'lsmod' to see what modules are installed ('lsmod | grep "e1000").

The obvious solution to finding out if the driver is installed correctly is of course to disconnect the cables to the other ones :)
 
Back
Top