How do I get a ko to load at boot?

I’m configuring a new laptop for my sons christmas present and since I’d like him to learn how to use a computer rather than drive a Windows GUI I’ve chosen SUSE 11.0. I’ve managed to get the R8101e nic working by downloading the code, compiling it etc and once I do a insmod ./src/8101.ko it starts working but when booting the boot output says loading eth0_nsc_ and then times out on the dhcp. I’m assuming that I need to add the equvalent of the insmod to one or more config files but which ones and what do I add?

Any help?

Pete

peteh wrote:
> I’m configuring a new laptop for my sons christmas present and since I’d
> like him to learn how to use a computer rather than drive a Windows GUI
> I’ve chosen SUSE 11.0. I’ve managed to get the R8101e nic working by
> downloading the code, compiling it etc and once I do a insmod
> ./src/8101.ko it starts working but when booting the boot output says
> loading eth0_nsc_ and then times out on the dhcp. I’m assuming that I
> need to add the equvalent of the insmod to one or more config files but
> which ones and what do I add?

First of all, did you “install” the driver? For most make files. that involves a
‘sudo make install’ step, which copies the .ko file to the appropriate place in
/lib/modules/… and runs a depmod command.

Secondly, is there some other driver that is grabbing the PCI ID of the R8101e?
If there is, then you will need to add that module to the file
/etc/modprobe.d/blacklist.

If all else fails, you can use YaST => System => /etc/sysconfig Editor to get
the module loaded at bootup. Click on the + next to System and Kernel, then on
the MODULES_LOADED_ON_BOOT. Finally add the “8101” in the box. This requires
that step 1 above was completed.

Larry

Larry

Larry,
Yes I completed the first step of make install, so I think I’m ok there. I took your point about the PCI so I ran a lspci -v and got

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev 02)
Subsystem: Hewlett-Packard Company Device 360b
Flags: bus master, fast devsel, latency 0, IRQ 16
I/O ports at 3000 [size=256]
Memory at d0410000 (64-bit, prefetchable) [size=4]
Memory at d0400000 (64-bit, prefetchable) [size=64]
[virtual] Expansion ROM at d0420000 [disabled] [size=128]
Capabilities: [40] Power Management version 3
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [ac] MSI-X: Enable- Mask- TabSize=2
Capabilities: [cc] Vital Product Data <?>
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [140] Virtual Channel <?>
Capabilities: [160] Device Serial Number 00-00-ff-ff-00-00-00-09
Kernel modules: r8169

so I put the entry in the etc\modprobe,d\blacklist as suggested (see extract below)

This driver is obsolete and should never be loaded as default.

See https://bugzilla.novell.com/show_bug.cgi?id=146728

blacklist eepro100

Blacklist the realtek r8169 driver

blacklist r8169

All to no avail. I tried adding the entry in yast to see if it would force the matter. Still no joy.

Pete[/size][/size][/size][/size]

After you have just rebooted, what does

sudo /sbin/modprobe -v 8101

show?

Larry

The place to add module names to be loaded on boot is /etc/sysconfig/kernel, variable MODULES_LOADED_ON_BOOT. You can use a text editor or YaST to edit this file.

Larry,
Hopefully the below will shed light

linux-ydu4:~ # modprobe -v r8101
FATAL: Module r8101 not found.
linux-ydu4:~ # find / -name r8101.ko
/root/r8101-1.010.00/src/r8101.ko
/lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
linux-ydu4:~ # modprobe -v r8101.ko
FATAL: Module r8101.ko not found.
linux-ydu4:~ # insmod ./lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.koinsmod: can’t read ‘./lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko’: No such file or directory
linux-ydu4:~ # insmod /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
linux-ydu4:~ # modprobe -v r8101.ko
FATAL: Module r8101.ko not found.
linux-ydu4:~ # modprobe -v r8101
FATAL: Module r8101 not found.

I followed the install instructions

	# make clean modules	(as root or with sudo)
	# make install
	# depmod -a
	# insmod ./src/r8101.ko	(or r8101.o for kernel 2.4.x)

Pete

Well the .ko is still in your directories. You need to move it to the appropriate directory under /lib/modules and then do a depmod -a. Then modprobe and modinfo will work.

Ken,
If you look, in amongst my typos, is the output from a find indicating the ko is in the right place. See below

linux-ydu4:~ # find / -name r8101.ko
/root/r8101-1.010.00/src/r8101.ko
/lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
linux-ydu4:~ # ls /root/r8101-1.010.00/src/r8101.ko
/root/r8101-1.010.00/src/r8101.ko
linux-ydu4:~ # ls -l /root/r8101-1.010.00/src/r8101.ko
-rw-r–r-- 1 root root 58748 Dec 3 05:09 /root/r8101-1.010.00/src/r8101.ko
linux-ydu4:~ # ls -l /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
-rwxr–r-- 1 root root 58748 Dec 3 05:10 /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko

That’s also why I did the insmod from as opposed to my root directory, just to show it worked.

Pete

peteh wrote:
> Larry,
> Hopefully the below will shed light
>
> linux-ydu4:~ # modprobe -v r8101
> FATAL: Module r8101 not found.
> linux-ydu4:~ # find / -name r8101.ko
> /root/r8101-1.010.00/src/r8101.ko
> /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
> linux-ydu4:~ # modprobe -v r8101.ko
> FATAL: Module r8101.ko not found.
> linux-ydu4:~ # insmod
> ./lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.koinsmod: can’t
> read ‘./lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko’: No
> such file or directory
> linux-ydu4:~ # insmod
> /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
> linux-ydu4:~ # modprobe -v r8101.ko
> FATAL: Module r8101.ko not found.
> linux-ydu4:~ # modprobe -v r8101
> FATAL: Module r8101 not found.

Is it r8101 or 8101?

Larry

Larry,
Its r8101 I think since it’s ko is r8101.ko

Pete

Is your running kernel 2.6.25.5-1.1-pae? uname -a will tell you.

Also did you do a depmod -a after installing it to the right place? If so you should find the module name in /lib/modules/<kernel name>/modules.*

But check that the module is going into the correct directory, based on the kernel name.

Ken,
Yes the module is in the right part of the code tree see below

linux-ydu4:~ # uname -a
Linux linux-ydu4 2.6.25.18-0.2-pae #1 SMP 2008-10-21 16:30:26 +0200 i686 i686 i386 GNU/Linux
linux-ydu4:~ # ls -l /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
-rwxr–r-- 1 root root 58748 Dec 3 05:10 /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
linux-ydu4:~ # uname -a
Linux linux-ydu4 2.6.25.18-0.2-pae #1 SMP 2008-10-21 16:30:26 +0200 i686 i686 i386 GNU/Linux
linux-ydu4:~ # ls -l /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko
-rwxr–r-- 1 root root 58748 Dec 3 05:10 /lib/modules/2.6.25.5-1.1-pae/kernel/drivers/net/r8101.ko

And yes I did do a depmod -a

Pete

Ken,
Arrgh! I hate realtek and their rotten drivers. They’re the bain of my life at work and now at home. My kernel may be 2.6.25.18 but the realtek compile has created me a 2.6.25.5-1 directory structure. Hopefully I can just move the ko.

Pete

Hi
You don’t have it in the correct directory;

Your kernel: 2.6.25.18-0.2-pae
Your path: /lib/modules/2.6.25.5-1.1-pae

2.6.25.5-1.1 was the default kernel from the install.

It needs to be in /lib/modules/2.6.25.18-0.2-pae


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 0:48, 1 user, load average: 0.13, 0.28, 0.27
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.82

Larry & Ken,
Thanks to you both. How the compile created the spurious code tree is beyond my understanding and I’m not prepared to spend the time worrying about it. Thanks to the efforts of you both this laptop now has a working LAN card and my son will be getting a laptop with a real operating system on for Christmas. (You’ve no concept of just how much putting Windows on this would have offended me! It’s become a matter of principle as much as anything else.)
Thanks again and seasons greetings to you both.

Pete

Glad it’s working. Hope your son enjoys it. Best of the season to you too! :slight_smile: