Replace r8169 with r8168 driver in initrd.img

Issues related to hardware problems
ataylor
Posts: 34
Joined: 2008/06/25 07:36:29

Replace r8169 with r8168 driver in initrd.img

Post by ataylor » 2012/05/06 23:53:44

Greetings,

I am trying to install CentOS 6.2 on a Zotac ZBox ID81, which (unfortunately!) has a Realtek RTL8111/R8168B (rev 6) Gigabit Ethernet Controller.

Known fault, the r8169 driver used by RHEL for this card does not work at the moment and as I need to do multiple PXE/Kickstart installs, this is a big problem.

I've been through the process at http://elrepo.org/tiki/FAQ to identify the required driver:

lspci | grep -i net
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

lspci -n | grep '01:00.0'
01:00.0 0200: 10ec:8168 (rev 06)

Searching for the Vendor:Device ID pairing of 10ec:8168 on the DeviceIDs page (http://elrepo.org/tiki/DeviceIDs) will show that kmod-r8168 should work with this Ethernet controller.
latest:
kmod-r8168-8.029.00-1.el6.elrepo.x86_64.rpm 2012-04-09 17:28 67K

I need to rebuild the initrd.img so that it will use this driver.
I've tried:
yum install dracut-network
install r8168 driver from rpm -ivH, reboot
dracut initrd.img.new `uname -r`

No dice.
Has anyone had any experience with this general problem ?

Thanks,
Alan

AndrewSerk
Posts: 60
Joined: 2010/11/21 03:41:16

Re: Replace r8169 with r8168 driver in initrd.img

Post by AndrewSerk » 2012/05/07 15:14:37

Hi Alan,

Not sure exactly where the issues is but thought I would post this link for dracut as it contains good info on the subject : http://people.redhat.com/harald/dracut-rhel6.html

Hope this helps,

Andrew

pjwelsh
Posts: 2632
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: Replace r8169 with r8168 driver in initrd.img

Post by pjwelsh » 2012/05/07 16:23:54

I have a Dell desktop that needed the kmod-r8168. To go from not working -> working only required the yum install of the kmod-r8168-8.029.00-1.el6.elrepo.i686 rpm from the elrepo repository that you mentioned. I did not need to manually do anything else.

ataylor
Posts: 34
Joined: 2008/06/25 07:36:29

Re: Replace r8169 with r8168 driver in initrd.img

Post by ataylor » 2012/05/08 13:58:55

Yes, replacing the driver on an installed system is no problem. What I need to do is actually use the r8168 driver to install the system to start with - PXE won't work otherwise. The only way I can see to do that is rebuild initrd.img so the installer will use r8168, not r8169.

From what I can see, I need to get the system installed before I can use dracut ...

Thanks,
Alan

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Replace r8169 with r8168 driver in initrd.img

Post by pschaff » 2012/05/08 20:26:10

For a normal install I would say you needed a driver update disk, but I'm not sure how that could work with PXE so apparently creating a new images/pxeboot/initrd.img is the way to go.

The file seems to be an xz compressed cpio archive. To see the contents:
[code]xz -d < initrd.img | cpio --list[/code]
The r8169 driver is present:
[code]# xz -d < initrd.img | cpio --list | grep r816
modules/2.6.32-220.el6.x86_64/kernel/drivers/net/r8169.ko.gz
137411 blocks[/code]
Replacing the driver is probably relatively straightforward. What I don't know is what you may have to do to the modules.dep, modprobe.d, udev, or hal configuration to see that it gets used:
[code]# xz -d < initrd.img | cpio --list | grep -Ei "etc/hal|etc/udev|etc/modprobe|modules.dep"
modules/2.6.32-220.el6.x86_64/modules.dep
modules/2.6.32-220.el6.x86_64/modules.dep.bin
etc/hal
etc/hal/fdi
etc/hal/fdi/preprobe
etc/hal/fdi/information
etc/hal/fdi/policy
etc/modprobe.d
etc/modprobe.d/libmlx4.conf
etc/udev
etc/udev/rules.d
etc/udev/rules.d/60-pcmcia.rules
etc/udev/rules.d/91-drm-modeset.rules
etc/udev/rules.d/60-raw.rules
etc/udev/rules.d/90-hal.rules
etc/udev/udev.conf
137411 blocks[/code]

ataylor
Posts: 34
Joined: 2008/06/25 07:36:29

Re: Replace r8169 with r8168 driver in initrd.img

Post by ataylor » 2012/05/08 22:09:27

What I've tried so far is along the lines of:
(using http://smshaker.wordpress.com/2009/04/09/adding-network-driver-to-pxe-initrdimg/)

cd /var/tmp/initrd/

copy initrd.img.pxeboot to initrd.img.xz

xz --format=lzma initrd.img.xz --decompress
changes:
-rwxr-x---. 1 root root 30M 08/05/12 09:34 initrd.img.xz
to:
-rwxr-x---. 1 root root 68M 08/05/12 09:34 initrd.img

gives:
-rwxr-x---. 1 root root 68M 08/05/12 09:34 initrd.img

cd initrd.new
cpio -ivdum sbin
drwxr-xr-x. 2 root root 4.0K 11/12/11 07:33 dev
drwxr-xr-x. 16 root root 4.0K 08/05/12 09:39 etc
drwxr-xr-x. 21 root root 4.0K 08/05/12 09:39 firmware
lrwxrwxrwx. 1 root root 10 08/05/12 09:39 init -> /sbin/init
drwxr-xr-x. 3 root root 4.0K 08/05/12 09:39 lib
drwxr-xr-x. 5 root root 4.0K 08/05/12 09:39 lib64
drwxr-xr-x. 3 root root 4.0K 08/05/12 09:39 modules
drwxr-xr-x. 2 root root 4.0K 11/12/11 07:33 proc
drwxr-xr-x. 2 root root 4.0K 08/05/12 09:39 sbin
drwxr-xr-x. 2 root root 4.0K 11/12/11 07:33 selinux
drwxr-xr-x. 2 root root 4.0K 11/12/11 07:33 sys
drwxr-xr-x. 2 root root 4.0K 11/12/11 07:33 tmp
drwxr-xr-x. 8 root root 4.0K 08/05/12 09:39 usr
drwxr-xr-x. 7 root root 4.0K 08/05/12 09:39 var

copy r8168.ko to /var/tmp//initrd/initrd.new/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/
chmod 744 /var/tmp/initrd/initrd.new/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/r8168.ko.gz
lsl /var/tmp//initrd/initrd.new/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/r816*
-rwxr--r--. 1 root root 69K 08/05/12 09:49 /var/tmp//initrd/initrd.new/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/r8168.ko.gz
-rwxr--r--. 1 root root 24K 07/12/11 05:41 /var/tmp//initrd/initrd.new/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/r8169.ko.gz

add
>>>>
10ec Realtek Semiconductor Co., Ltd.
8168 RTL8111/8168B Gigabit Ethernet
>>>>
to
/var/tmp//initrd/initrd.new/usr/share/hwdata/pci.ids

add
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8168
to
/var/tmp/initrd/initrd.new/modules/2.6.32-220.el6.x86_64/modules.alias

add
>>>>
r8168
eth
"RTL8111/8168B PCI Express Gigabit Ethernet"
>>>>
to
/var/tmp/initrd/initrd.new/modules/module-info

cd /var/tmp/initrd/initrd.new/
find . -print |cpio -o -H newc | xz --format=lzma > ../initrd.img.out
cd /var/tmp/initrd/
gives in /var/tmp/initrd/:

-rw-rw----. 1 root root 30M 08/05/12 10:16 initrd.img.out
drwxrwx---. 15 root root 4.0K 08/05/12 09:39 initrd.new

chmod 750 initrd.img.out
mv initrd.img.out initrd.img
gives:
-rwxr-x---. 1 root root 30M 08/05/12 10:16 initrd.img

copy initrd.img to /var/lib/tftpboot/boot/CentOS/6.2/x86_64/initrd.img

Doesn't work I'm afraid ....

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Replace r8169 with r8168 driver in initrd.img

Post by pschaff » 2012/05/08 22:46:15

Please give the exact symptoms of "Doesn't work".

ataylor
Posts: 34
Joined: 2008/06/25 07:36:29

Re: Replace r8169 with r8168 driver in initrd.img

Post by ataylor » 2012/05/09 05:00:59

Hi Phil,

Thanks for your time. With my new initrd.img (r8168 driver) the installer does not recognize the Realtek card at all and complains that there is no eth0. (actually says "only one" network card which is wlan0 - can't use this.

With the original initrd.img (r8169) it does recognise the realtek network interface and starts the install, but most of the time then crashes with a read error.

BRgds/ Alan

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Replace r8169 with r8168 driver in initrd.img

Post by pschaff » 2012/05/09 10:57:26

For some reason your changes were not sufficient to cause the alternate driver to be used. Sorry I can't spot the problem, but perhaps with that information someone else can.

ataylor
Posts: 34
Joined: 2008/06/25 07:36:29

Re: Replace r8169 with r8168 driver in initrd.img

Post by ataylor » 2012/05/11 08:42:03

Thanks Phil, no progress so far but I'll advise if anything improves

Post Reply