Skip to content

Commit

Permalink
Update README and at Fedora/RedHat installation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
casch-at committed Dec 20, 2022
1 parent d506c2f commit 66a1cc6
Showing 1 changed file with 138 additions and 67 deletions.
205 changes: 138 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,71 +13,142 @@ If you are searching for the Realtek 2.5 Gbits **USB Ethernet**, which may use R
- [Realtek R8152 DKMS](https://github.com/awesometic/realtek-r8152-dkms)

## Installation

There are 3 ways to install this DKMS module. Choose one as your tastes.

Those are not interfering with each other. So you can do all 3 methods but absolutely you don't need to.

Installation using the Debian package is recommended for the sake of getting the newer driver.

### Debian package

#### Released package file

Download the latest Debian package from the Release tab on the Github repository.

Then enter the following command.

```bash
sudo dpkg -i realtek-r8125-dkms*.deb
```

> If multiple files selected by the wild card, you should type the specific version of the file.
>
> ```bash
> sudo dpkg -i realtek-r8125-dkms_9.010.01-1_amd64.deb
> ```
If dependency error occurs, try to fix that with `apt` command.
```bash
sudo apt install --fix-broken
```
#### Launchpad PPA (Recommended)

Add the Launchpad PPA.

```bash
sudo add-apt-repository ppa:awesometic/ppa
```

Then install the package using `apt` tool.

```bash
sudo apt install realtek-r8125-dkms
```

### autorun.sh

Using the `autorun.sh` script that Realtek provides on their original driver package. This is **not installed as a DKMS**, only efforts to the current kernel.

Download or clone this repository and move to the extracted directory, then run the script.

```bash
sudo ./autorun.sh
```

### dkms-install.sh

This script is from aircrack-ng team. You can install the DKMS module by a simple command.

Download or clone this repository and move to the extracted directory, then run the script.

```bash
sudo ./dkms-install.sh
```

There are 3 ways to install this DKMS module not every works for every
distribution. This table should help you decide which way to go.

| Nr | Method | Fedora/RedHat based | Debian based |
|----|-----------------|---------------------|-----------------|
| 1 | deb package | | x |
| 2 | Launchpad PPA | | x |
| 3 | autorun.sh | x | x |
| 4 | dkms-install.sh | x (Recommended) | x (Recommended) |

Those are not interfering with each other. So you can do all 3 methods but
absolutely you don't need to.

1. First method using the Debian (DEB) package
1. Download the deb package
```bash
curl -sSL
```
2. Install the deb package
```bash
sudo dpkg -i realtek-r8125-dkms_9.010.01-1_amd64.deb
```
If dependency error occurs, try to fix that with `apt` command.
```bash
sudo apt install --fix-broken
```

2. Second method using the Launchpad PPA

1. Add the Launchpad PPA
```bash
sudo add-apt-repository ppa:awesometic/ppa
```

2. Install the package using `apt` tool
```bash
sudo apt install realtek-r8125-dkms
```

3. Third method using the autorun.sh script
Using the `autorun.sh` script that Realtek provides on their original
driver package. This is **not installed as a DKMS**, only efforts to the
current kernel.

1. Download/Clone repository
```bash
git clone --depth 1 https://github.com/awesometic/realtek-r8125-dkms.git
cd realtek-r8125-dkms
```
2. Install driver by running the autorun.sh script
```bash
sudo ./autorun.sh
```

4. Fourth method using the `dkms-install.sh` script

This script is from aircrack-ng team. You can install the DKMS module by a
simple command.

1. Download/Clone repository
```bash
git clone --depth 1 https://github.com/awesometic/realtek-r8125-dkms.git
cd realtek-r8125-dkms
```

3. Install dependencies
+ apt (Debian/Ubuntu)
```
sudo apt install dkms
```
+ dnf/yum (Fedora/RedHat)
```bash
sudo dnf install dkms dracut
```

2. Install DKMS module by running the `dkms-install.sh` script
```bash
sudo ./dkms-install.sh
```

3. Blacklist the r8169 module
```bash
sudo tee -a /etc/modprobe.d/blacklist-r8169.conf > /dev/null <<EOT
blacklist r8169
EOT
```
4. Ensure module r8125 will be included in the initramfs
```bash
sudo tee -a /etc/modprobe.d/realtek-r8125.conf > /dev/null <<EOT
r8125
EOT
```
5. Create the initramfs
You can list the currently included modules if you want, there should
only be one line of output.
```bash
sudo lsinitrd /boot/initramfs-$(uname --kernel-release).img | grep r81
-rw-r--r-- 1 root root 55164 Nov 16 19:00 usr/lib/modules/$(uname --kernel-release)/kernel/drivers/net/ethernet/realtek/r8169.ko.xz
```
Now recreate the initramfs to include the blacklist and the r8125 module
```bash
sudo dracut --force --kver $(uname --kernel-release)
```
Now list the modules again of the newly created initramfs. You should
see now 4 lines.
```bash
sudo lsinitrd /boot/initramfs-$(uname --kernel-release).img | grep r81
-rw-r--r-- 1 root root 49 Nov 16 19:00 etc/modprobe.d/blacklist-r8169.conf
-rw-r--r-- 1 root root 6 Nov 16 19:00 etc/modules-load.d/realtek-r8125.conf
-rw-r--r-- 1 root root 64916 Nov 16 19:00 usr/lib/modules/$(uname --kernel-release)/extra/r8125.ko.xz
-rw-r--r-- 1 root root 55164 Nov 16 19:00 usr/lib/modules/$(uname --kernel-release)/kernel/drivers/net/ethernet/realtek/r8169.ko.xz
```
6. Reboot the system to load the r8125 module instead of r8168 module
```bash
sudo systemctl start reboot.target --job-mode=replace-irreversibly --no-block
```
7. Verify that the driver is really in use now instead of the r8169
```bash
sudo lspci -v -d ::0200 | grep 81
2a:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
Kernel driver in use: r8125
Kernel modules: r8169, r8125
```
## Verify the module is loaded successfully
After installing the DKMS package, you may not be able to use the new `r8125` module on the fly. This because the existing `r8169` module will be loaded priority to `r8125` so that it prevents working of the `r8125` module.
Expand All @@ -101,7 +172,7 @@ blacklist r8169
EOT
```
To apply the new blacklist to your kernel, update your initramfs via
To apply the new blacklist to your kernel, update your initramfs.
```bash
sudo update-initramfs -u
Expand All @@ -126,7 +197,7 @@ dpkg-buildpackage -b -rfakeroot -us -uc
## LICENSE
GPL-2 on Realtek driver and the debian packaing.
GPL-2 on Realtek driver and the debian packing.
## References
Expand Down

0 comments on commit 66a1cc6

Please sign in to comment.