Alessio Treglia

everybody lies
  • Quality Assurance
  • it blog
  • rss
  • Home
  • About
  • Roma3 WiFi Authenticator
  • Installation Report Generator
  • Contact

How to compile r8168 and r8101 modules for Realtek ethernet adapters

quadrispro | July 8, 2008

r8169 module has a lot of bugs and it doesn’t work well with a large number of Realtek’s adapters, so, a few days ago, I posted a patch for the Realtek r8101 module, which supports kernel 2.6.23 but not the 2.6.24, newest kernel in Ubuntu 8.04 «Hardy Heron».

This howto could be a solution for a large number of ethernet adapters issues.

The first step is downloading the right driver (r8101 or r8168) for the adapter:

  • r8168 supports RTL8111B, RTL8168B, RTL8111, RTL8168 and RTL8111C;
  • r8102 supports RTL8100E, RTL8101E and RTL8102E-GR.

Don’t try to compile the module now, it will not work, we need to apply a patch in order to make it working with Hardy’s kernel

Dowload in Home dir the patch for r8168 module or that for r8101, open a terminal and type these instructions to extract the tarball (I think it’s unnecessary, but filenames and paths could change, in according with the driver version):


cd ~/
tar -xvf r8101-1.007.00.tar.bz2
cd r8101-1.007.00/src

Now apply the patch to the r8168 sources dir:


patch < ~/r8168-8.005.00.hardy.diff.txt

Or, if you need r8101 driver, type this:


patch < ~/r8101-1.007.00.hardy.diff.txt

Finally, compile and install the module:


cd ..
make clean modules
sudo make install
sudo depmod -a

To avoiding r8169’s loading at boot, create and open a new file, /etc/modprobe.d/blacklist-network:


sudo nano /etc/modprobe.d/blacklist-network

And add this line:


blacklist r8169

Finally, update the initial ramdisk:


sudo update-initramfs -u

At the next boot, your ethernet adapter will work really fine ;)

Categories
Bugs and issues, Hardy, Howtos and docs, Kernel and modules, Planet Ubuntu
Comments rss
Comments rss
Trackback
Trackback

« A new macro for the Italian wiki Realtek’s modules, new version has been released »

6 responses

I suggest not buying or using realtek cards at all.

Herman Bos | July 8, 2008 | 2:50 pm

I suggest not buying or using realtek cards at all. Avoid like the plague.

Amazing what random behavior they can produce.

We normally stick with intel nics, something we do not regret. they most costs 40 euro more but thats definitely worth it.

[Reply]

I found it also useful to preserve the environment variables

Ste | July 8, 2008 | 7:47 pm

I found it also useful to preserve the environment variables by using

sudo -E make

and yes realtek is a plague. It took me 3 weeks to figure out that the standard Linux driver could not resume the power status correctly.

[Reply]

[...] you read my previous article about r8169 module but

Alessio Treglia: Realtek’s modules, new version has been released | Christian eBuddy Blog | August 24, 2008 | 2:42 pm

[...] you read my previous article about r8169 module but it wasn’t the best solution for your Realtek ethernet adapter, now [...]

[...] you read my previous article about r8169 module but

Alessio Treglia » Realtek’s modules, new version has been released | September 18, 2008 | 3:38 pm

[...] you read my previous article about r8169 module but it wasn’t the best solution for your Realtek ethernet adapter, now [...]

It gives me this error.. what should i do? c@a:~/r8101-1.007.00/src$ patch

Constantine Tsardounis | October 28, 2008 | 5:34 pm

It gives me this error.. what should i do?

c@a:~/r8101-1.007.00/src$ patch < ~/r8168-8.005.00.hardy.diff.txt
can’t find file to patch at input line 4
Perhaps you should have used the -p or –strip option?
The text leading up to this was:
————————–
|diff -c ./r8168.h ../../r8168-8.005.00.new/src/r8168.h
|*** ./r8168.h 2008-01-09 05:27:22.000000000 -0800
|— ../../r8168-8.005.00.new/src/r8168.h 2008-04-14 15:20:55.000000000 -0700
————————–
File to patch:

[Reply]

Using the latest 8101 driver from Realtek (1.010) with Ubuntu

Brian Wilson | November 10, 2008 | 8:18 pm

Using the latest 8101 driver from Realtek (1.010) with Ubuntu 8.10 (kernel 2.4.27-generic) did not require your patch. The rest of your instructions are still accurate. Thanks for providing this information.

[Reply]

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Click to cancel reply

Categories

Bugs and issues GTK+ Hardy Howtos and docs Installation Report Generator Kernel and modules Planet Ubuntu Python Wiki and documentation

Recent comments

  • estorino on Realtek’s modules, new version has been released
  • Brian Wilson on How to compile r8168 and r8101 modules for Realtek ethernet adapters
  • Constantine Tsardounis on How to compile r8168 and r8101 modules for Realtek ethernet adapters
  • quadrispro on Installation Report Generator
  • Søren Juul on Installation Report Generator

Archive

RSS Planet Ubuntu

  • Jorge Castro: I broke the internets
  • Jeff Bailey: We're here!
  • Celeste Lyn Paul: System Settings as a Design Lesson
  • Mackenzie Morgan: Compiz? Emerald? Metacity? What's the Difference?
  • Jorge Castro: Lenovo X200 and Ubuntu 8.10
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox