Difference between revisions of "Realtek 8168"

From LinuxMCE
Jump to: navigation, search
m
m (Asus M3A78-EM: updated links)
Line 1: Line 1:
{| align="right"
+
{| align="right"
 
   | __TOC__
 
   | __TOC__
 
   |}
 
   |}
Line 79: Line 79:
 
--[[User:Sethj|Sethj]] 15:13, 3 December 2008 (CET)
 
--[[User:Sethj|Sethj]] 15:13, 3 December 2008 (CET)
  
First I manually created the Media Director [[Generic_PC#Manual_Setup_of_a_Media_Director]] from the Web Admin page. Did not want it to build an AMD64 image, wanted to stay with i386, and I knew the MAC address of the new MD onboard NIC. Ran "Setup Diskless MD" when that completed I clicked the "Rebuild Image" for the new MD. While that was running I completed the next few things. Wait for this to complete, and then continue.
+
[[Generic_PC#Manual_Setup_of_a_Media_Director | First I manually created the Media Director]] from the [[LinuxMCE Admin Website]]. Did not want it to build an AMD64 image, wanted to stay with i386, and I knew the MAC address of the new MD onboard NIC. Ran "Setup Diskless MD" when that completed I clicked the "Rebuild Image" for the new MD. While that was running I completed the next few things. Wait for this to complete, and then continue.
  
 
* Download the driver package for Linux from Asus' web site here : [http://support.asus.com/download/download.aspx?SLanguage=en-us&model=M3A78-EM LinuxDrivers.zip] - It is under "Others"
 
* Download the driver package for Linux from Asus' web site here : [http://support.asus.com/download/download.aspx?SLanguage=en-us&model=M3A78-EM LinuxDrivers.zip] - It is under "Others"

Revision as of 15:07, 6 December 2008

The Realtek RTL8168 network card on LinuxMCE

This card is supposed to work with the r8169 module, but this seems to fail for newer cards. Realtek provides the source code for a r8168 module on their site.

What you need to do

  • Download the driver from Realtek (at the time of this article, the version is 8.008.00, released 2008/7/24) to compile the r8168 module
  • Install the linux-source package, to hack into the r8169 module.

The default r8169 module and Realtek's r8168 overlap on a PCI ID, and that's why you need the kernel source. You'll compile the r8169 without the PCI ID that r8168 will associate with.

>>TODO: Insert section of required packages for the build to work

Compiling Realtek's r8168 module

  • Download the Realtek driver: you'll get a file called r8168-8.008.00.tar.bz2
  • unpack the file:
tar -jxf r8168-8.008.00.tar.bz2
  • switch into the directory that is created:
cd r8168-8.008.00
  • build the module:
make
  • copy the module to the running kernel:
cp src/r8168.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/

Hacking the r8169 module

  • Install the kernel source:
apt-get install linux-source
  • Un pack the kernel source:
cd /usr/src; tar -jxf linux-source-2.6.22.tar.bz2
  • Switch to the kernel directory:
cd linux-source-2.6.22
  • Copy the running kernel's configuration:
cp /boot/config-2.6.22-14-generic .config
  • Prepare the kernel so you can build modules:
make scripts prepare
  • Apply this patch:
patch < r8168.diff
 --- drivers/net/r8169.c.orig	2008-09-05 17:07:29.000000000 +0300
 +++ drivers/net/r8169.c	2008-09-04 23:49:51.000000000 +0300
 @@ -162,7 +162,7 @@
  	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8129), 0, 0, RTL_CFG_0 },
  	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8136), 0, 0, RTL_CFG_2 },
  	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8167), 0, 0, RTL_CFG_0 },
 -	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8168), 0, 0, RTL_CFG_1 },
 +	//{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8168), 0, 0, RTL_CFG_1 },
  	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8169), 0, 0, RTL_CFG_0 },
  	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4300), 0, 0, RTL_CFG_0 },
  	{ PCI_DEVICE(0x1259,			0xc107), 0, 0, RTL_CFG_0 },
  • Build the network modules:
make M=`pwd`/drivers/net modules
  • Confirm that the new r8169 module doesn't have the "pci:v000010ECd00008168sv" alias:
modinfo drivers/net/r8169.ko
  • Copy the new r8169.ko to the running kernel:
cp drivers/net/r8169.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/
  • Run depmod
depmod
  • Load the module:
modprobe r8168

MDs

After you created the modules as described above:

  • Copy the modules to all the affected MD filesystems, in the corresponding location
  • Follow the instructions on the Unrecognized NIC page

Asus M3A78-EM

Here are the steps required to get this motherboard's Realtek 8168 Gigabit Ethernet Working for an MD.

--Sethj 15:13, 3 December 2008 (CET)

First I manually created the Media Director from the LinuxMCE Admin Website. Did not want it to build an AMD64 image, wanted to stay with i386, and I knew the MAC address of the new MD onboard NIC. Ran "Setup Diskless MD" when that completed I clicked the "Rebuild Image" for the new MD. While that was running I completed the next few things. Wait for this to complete, and then continue.

  • Download the driver package for Linux from Asus' web site here : LinuxDrivers.zip - It is under "Others"
  • unzip the package to /usr/src
sudo su
cd /usr/src
unzip -qq /path/to/LinuxDrivers.zip
cd /usr/src/LinuxDrivers/LAN/r8168-8.003.00/r8168-8.003.00
make
cp src/r8168.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/
mv /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko.not
depmod -a
/usr/pluto/bin/Diskless_BuildDefaultImage.sh
cp /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8168.ko /usr/pluto/diskless/<moon #>/lib/modules/2.6.22-14-generic/kernel/drivers/net
vi /usr/pluto/diskless/<moon #>/etc/initramfs-tools/modules
added r8168 and saved
cd /usr/pluto/diskless
chroot <moon #>
mv /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko.not
depmod -a /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8168.ko
cd /boot
update-initramfs -uv
(scrolled up to verify the new module was added it was at the top of the output)
for S and G's ran depmod -a again
exit out of the chroot

Now boot or reboot the MD.

For a Core: (Not Tested)

  • Download the driver package for Linux from Asus' web site here : LinuxDrivers.zip - It is under "Others"
  • unzip the package to /usr/src
sudo su
cd /usr/src
unzip -qq /path/to/LinuxDrivers.zip
cd /usr/src/LinuxDrivers/LAN/r8168-8.003.00/r8168-8.003.00
make
cp src/r8168.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/
mv /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8169.ko.not
depmod -a /lib/modules/2.6.22-14-generic/kernel/drivers/net/r8168.ko
vi /etc/initramfs-tools/modules
add r8168
cd /boot 
update-initramfs -uv
(scroll up to verify the new module was added)
for S and G's run depmod -a again

Now reboot, and that should sort it out.