Realtek RTL 8125 2.5Gbps LAN controller.

JMOR

New Member


Messages: 2

Let me apologize upfront if this is too much of a basic question. Sure there are enough resources out there for me to figure this one out by myself. But, I am complete newbie to BSD Unix, and some guidance may help me to speed up the process.

I am trying to install FreeBSD (13.0) in my new PC but I am missing the very important Ethernet driver, hence no connection to Internet. I have a MSI X570 Unify motherboard which comes with a Realtek RTL 8125 2.5Gbps LAN controller. (Additionally to a Intel Wi-Fi 6 AX200 connection, but I am not even looking at this yet)

I am thinking in copying the driver into the USB installer, some directory in either memstick.img or mini-memstick.img (preferably the later, but it won't have the base system nor way to access the Internet to get it - NIC not recognized). Then proceed with the installation as per the HandBook, afterwards copy the driver I put in the installer into the just installed base system, do some magic, and hopefully after rebooting I would be able to access the network card.

Am I wrong or am I wrong? Anyway, some directions would be appreciated.

By the way, I think this is the driver I should be using: realtek-re-kmod (Kernel driver for Realtek PCIe Ethernet Controllers from FreshPorts). But, it seems I would need to access the port from the PC to get the driver? which would be impossible given that I won't have a functional network connection. Though, I could in any case just download the driver straight up from Realtek's website and put that into the installer image.

Again, some guidance about the proper way to proceed in this case would be appreciate it.

Thanks in advance.

As an aside: I understand that maybe in production systems it is more common to use Intel NICs. But there are quite a few models of motherboards from the big players (MSI, Gigabyte, ASRock, and so on) that come with this Realtek 2.5Gbps NIC. I think FreeBSD would make a BIG favor to not a small number of home users were it to include this driver in the base system.
 

T-Daemon

Daemon

Reaction score: 664
Messages: 1,382

By the way, I think this is the driver I should be using: realtek-re-kmod (Kernel driver for Realtek PCIe Ethernet Controllers from FreshPorts). But, it seems I would need to access the port from the PC to get the driver? which would be impossible given that I won't have a functional network connection. Though, I could in any case just download the driver straight up from Realtek's website and put that into the installer image.
Better download the FreeBSD package than the driver from the manufacturer:

fetch https://pkg.freebsd.org/FreeBSD:13:amd64/quarterly/All/realtek-re-kmod-v196.04_2.txz

After the system is installed drop into a shell of the installer (or reboot into the new system) and extract (tar(1)) the package into the new system, edit /boot/loader.conf, set the necessary variables to load the driver.

Manually extracting the package won't be registered in the systems local package database. To make the database aware of the package reinstall the package with the systems ports(7) / pkg(8) facilities.

There are +COMPACT_MANIFEST and +MANIFEST files leftovers from the package after extracting manually, you might want them removed.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,683
Messages: 36,456

If you're downloading packages in advance might as well download the package for pkg too. Extract it and use the included pkg-static command to install itself. Then use pkg-add(8) to install the downloaded module.
 

T-Daemon

Daemon

Reaction score: 664
Messages: 1,382

If you're downloading packages in advance might as well download the package for pkg too. Extract it and use the included pkg-static command to install itself. Then use pkg-add(8) to install the downloaded module.
Nice!

Assuming downloaded packages are in /tmp :
Code:
tar xf pkg-1.16.3.txz
usr/local/sbin/pkg-static add pkg.1.16.3.txz
pkg add realtek-re-kmod-v196.4_2.txz
rm -r usr +COMPACT_MANIFEST +MANIFEST pkg-1.16.3.txz realtek-re-kmod-v196.4_2.txz
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,683
Messages: 36,456

Fixed the code for you, /usr/local/sbin/pkg-static should be relative from the directory you extracted the .txz in, so it's usr/local/sbin/pkg-static. Then it doesn't matter where you saved or extracted the archive (I usually just do this in /tmp).
 
Top