View previous topic :: View next topic |
Author |
Message |
jesnow l33t
Joined: 26 Apr 2006 Posts: 895
|
Posted: Sun Sep 10, 2023 8:15 pm Post subject: r8125 NIC and kernel upgrading |
|
|
OK, it's kernel day, and time to build a new kernel.
BUT I have a realtek r8125 nic, the driver is not in the kernel yet. There is at least package in portage now. And I have it installed. So far so good. So I build the new kernel and notice there is nothing in .config about the r8125. I know that the r8169 driver in kernel is incompatible with the r1825 driver, but where do I build the r8125 driver?
It turns out there are chickens and eggs involved. The r8125 package is up to date, but will only install against built sources. But if you build and install the kernel without having first re-emerged r8125, when you reboot you will have no ethernet. This is painful, especially for a headless machine, which is now shut in, unreachable. It seems you have to re-emerge r8125 after you have built the kernel and installed it. So I did this, while still running the old kernel. It didn't work. And then of course I had to go get physical access to the machine, install a keyboard and monitor and try again.
Eventually it worked after several tries.
So my question: what is the procedure for this?
1) build new kernel
2) install new kernel and modules
3) update boot loader
4) update /usr/src/linux symlink
5) emerge -1 r8125
6) reboot
This is precisely what didn't work for me. It seems like it didn't want to install it properly unless I was running the new kernel. What did I do wrong? The machine came up with no network (=big hassle). Maybe I just need a different nic that has in-kernel ethernet support. Any insight would be greatly appreciated.
Cheers,
Jon. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5374 Location: Bavaria
|
Posted: Sun Sep 10, 2023 9:28 pm Post subject: Re: r8125 NIC and kernel upgrading |
|
|
jesnow wrote: | [...] I know that the r8169 driver in kernel is incompatible with the r1825 driver, [...] |
May I ask you how old your information is ?
Because I have also one - this is the output of my "lpsci -nnk" - please compare the ID: 10ec:8125
Code: | 0000:02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller [10ec:8125] (rev 05)
Subsystem: Gigabyte Technology Co., Ltd RTL8125 2.5GbE Controller [1458:e000]
Kernel driver in use: r8169 |
(I have kernel version 6.1.x)
It is important that this driver can load the correct firmware. I have:
Code: | CONFIG_EXTRA_FIRMWARE="... rtl_nic/rtl8125b-2.fw ..." |
Maybe you need another firmware file ... best is to enable r8169 as <M>odule in your kernel.
(see more here: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Driver_needs_Firmware )
If you really must use an external module I suggest these links:
Gentoo way:
https://wiki.gentoo.org/wiki/Kernel/Upgrade#Reinstalling_external_kernel_modules
Linux kernel:
https://docs.kernel.org/kbuild/modules.html |
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 895
|
Posted: Sun Sep 10, 2023 10:05 pm Post subject: Re: r8125 NIC and kernel upgrading |
|
|
I last struggled with this driver back in February, using kernel 5.15.10. At that time the net-misc/r8125 package was several iterations behind the manufacturer's external driver, and though I tried mightily to do it the gentoo way (as a module and compiled in), I failed and went with the external one at that time. I exactly want to get the job done the gentoo way this time.
I am using:
Code: |
Linux merckx 6.1.46-gentoo #1 SMP PREEMPT_DYNAMIC Sun Sep 10 13:15:16 CDT 2023 x86_64 Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz GenuineIntel GNU/Linux
|
and
Code: |
merckx /home/jesnow # equery list r8125 -p
* Searching for r8125 ...
[-P-] [ ] net-misc/r8125-9.008.00-r1:0
[-P-] [ ] net-misc/r8125-9.009.01-r1:0
[-P-] [ ] net-misc/r8125-9.009.02-r1:0
[IP-] [ ] net-misc/r8125-9.011.01-r1:0
|
And to be clear, it all works now, the gentoo way, after a lot of trial and error. I did a bunch of googling and couldn't find a clear path to do the kernel upgrade smoothly, which is why I asked the question. I prefer to know what I'm doing rather than just trying it every which way until it works.
We do appear to have the same hardware:
Code: | 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller [10ec:8125]
Subsystem: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller [10ec:0123]
Kernel driver in use: r8125
Kernel modules: r8125
|
I have linux-firmware emerged, but did not know about the firmware blob that makes the r8125 work with the r8169 driver. That would be very nice. I will give it a try. That sounds like it could be added to the r8xxx gentoo documentation, as I think lots of people are buying these inexpensive 2.5GBE cards.
That server has run 68 different hand-compiled kernels, starting with 2.6.16. I think its current hardware is from 2010.
Many thanks!
Cheers,
Jon.
|
|
Back to top |
|
|
jesnow l33t
Joined: 26 Apr 2006 Posts: 895
|
Posted: Sun Sep 10, 2023 10:23 pm Post subject: |
|
|
I see that r8168 and r8125 support USE="use-firmware", I don't know if that automatically loads it (as one might think it would) or what it does. I have it turned off right now.
Cheers,
Jon. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5374 Location: Bavaria
|
Posted: Sun Sep 10, 2023 10:34 pm Post subject: Re: r8125 NIC and kernel upgrading |
|
|
jesnow wrote: | That server has run 68 different hand-compiled kernels, starting with 2.6.16. I think its current hardware is from 2010. |
Impressive ... I cannot remember where I started ... I only know my first kernel was 2.2 (because we had the old paket filter / firewall software "ipchains")
jesnow wrote: | Many thanks! |
You are very Welcome !
Peter |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5374 Location: Bavaria
|
Posted: Sun Sep 10, 2023 10:39 pm Post subject: |
|
|
jesnow wrote: | I see that r8168 and r8125 support USE="use-firmware", I don't know if that automatically loads it (as one might think it would) or what it does. I have it turned off right now. |
Hmmm ... "euse -i use-firmware" says: "net-misc/r8125: Support automatic firmware loading" ... but I dont understand it, because if a module needs firmware it should load it always ?! |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2692
|
Posted: Mon Sep 11, 2023 5:49 am Post subject: |
|
|
pietinger wrote: | but I dont understand it, because if a module needs firmware it should load it always ?! |
Not necessarily. Firmware might perform tasks better/faster for example, but might not be necessary for the task to be performed.
From what I saw from the ebuild, it's a configuration option that sets a variable which is later controls macros in the sources. However I don't understand kernel programming and can't tell for sure what it does. I think it enables the module to load firmware that can perform certain tasks faster/better or enables it to perform them in general. Names of the functions that the macros control can be meaningful to someone more familiar with the adapter capabilities.
Best Regards,
Georgi
p.s. I have an 8139 that worked OK since 5.8 or whatever was current in 2018 when I did the installation on that hardware up to 5.11, if that's relevant. Now I have 8169 and it works OK. It's one and the same driver. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|