Skip to content

Commit

Permalink
fixing name of module
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Nov 3, 2024
1 parent 59f56c7 commit 9824382
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
################################################################################
#
# r8821cu is the Linux device driver released for Realtek 5 Gigabit Ethernet
# 8821cu is the Linux device driver released for Realtek 5 Gigabit Ethernet
# controllers with PCI-Express interface.
#
# Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved.
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Realtek r8821cu DKMS
# Realtek 8821cu DKMS

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/awesometic/realtek-r8821cu-dkms?sort=semver&style=for-the-badge)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/awesometic/realtek-8821cu-dkms?sort=semver&style=for-the-badge)

This provides Realtek r8821cu driver in DKMS way so that you can keep the latest driver even after the kernel upgrade.
This provides Realtek 8821cu driver in DKMS way so that you can keep the latest driver even after the kernel upgrade.

## Before use

This DKMS package is for Realtek RTL8821cu (r8821cu in module name) Ethernet, which is designed for the PCI interface.
This DKMS package is for Realtek RTL8821cu (8821cu in module name) Ethernet, which is designed for the PCI interface.

If you are searching for the Realtek 2.5 Gbits **PCI or USB Ethernet**, which may use RTL8125 and RTL8152 respectively, please refer to another DKMS project for that Realtek driver.

Expand All @@ -30,13 +30,13 @@ Download the latest Debian package from the Release tab on the Github repository
Then enter the following command.

```bash
sudo dpkg -i realtek-r8821cu-dkms*.deb
sudo dpkg -i realtek-8821cu-dkms*.deb
```

> If multiple files selected by the wild card, you should type the specific version of the file.
>
> ```bash
> sudo dpkg -i realtek-r8821cu-dkms_10.013.00-1_amd64.deb
> sudo dpkg -i realtek-8821cu-dkms_10.013.00-1_amd64.deb
> ```
If dependency error occurs, try to fix that with `apt` command.
Expand All @@ -56,7 +56,7 @@ sudo add-apt-repository ppa:awesometic/ppa
Then install the package using `apt` tool.

```bash
sudo apt install realtek-r8821cu-dkms
sudo apt install realtek-8821cu-dkms
```

### autorun.sh
Expand All @@ -81,23 +81,23 @@ sudo ./dkms-install.sh

## Verify the module is loaded successfully

After installing the DKMS package, you may not be able to use the new `r8821cu` module on the fly. This because the existing `r8169` module will be loaded priority to `r8821cu` so that it prevents working of the `r8821cu` module.
After installing the DKMS package, you may not be able to use the new `8821cu` module on the fly. This because the existing `r8169` module will be loaded priority to `8821cu` so that it prevents working of the `8821cu` module.

Check if the `r8169` module loaded currently.

```bash
lsmod | grep -i r8169
```

If there is a result, maybe the `r8821cu` module wasn't loaded properly. You can check out modules currently in use via `lspci -k` or `dmesg` too.
If there is a result, maybe the `8821cu` module wasn't loaded properly. You can check out modules currently in use via `lspci -k` or `dmesg` too.

To use the `r8821cu` module explicitly you can add the `r8169` module to not be loaded by adding it to a blacklist file.
To use the `8821cu` module explicitly you can add the `r8169` module to not be loaded by adding it to a blacklist file.

Enter the following command to configure the blacklist.

```bash
sudo tee -a /etc/modprobe.d/blacklist-r8169.conf > /dev/null <<EOT
# To use r8821cu driver explicitly
# To use 8821cu driver explicitly
blacklist r8169
EOT
```
Expand All @@ -110,7 +110,7 @@ sudo update-initramfs -u

Finally, reboot to take effect.

> - If you need to load both r8169 and r8821cu, maybe removing r8821cu firmware could make it work. Please enter `sudo rm -f /lib/firmware/rtl_nic/rtl8821cu*` to remove all the r8821cu firmwares on the system. But it is just a workaround, you should have to do this every time installing the new kernel version or new Linux firmware.
> - If you need to load both r8169 and 8821cu, maybe removing 8821cu firmware could make it work. Please enter `sudo rm -f /lib/firmware/rtl_nic/rtl8821cu*` to remove all the 8821cu firmwares on the system. But it is just a workaround, you should have to do this every time installing the new kernel version or new Linux firmware.
> - In the case of the Debian package, I will update the scripts to make it do this during the installation.
## Debian package build
Expand All @@ -131,4 +131,4 @@ GPL-2 on Realtek driver and the debian packaing.

## References

- [Realtek r8821cu driver release page](https://www.realtek.com/Download/List?cate_id=584)
- [Realtek 8821cu driver release page](https://www.realtek.com/Download/List?cate_id=584)
12 changes: 6 additions & 6 deletions REALTEK_README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

<Quick install with proper kernel settings>
Unpack the tarball :
# tar vjxf r8821cu-9.aaa.bb.tar.bz2
# tar vjxf 8821cu-9.aaa.bb.tar.bz2

Change to the directory:
# cd r8821cu-9.aaa.bb
# cd 8821cu-9.aaa.bb

If you are running the target kernel, then you should be able to do :

# ./autorun.sh (as root or with sudo)

You can check whether the driver is loaded by using following commands.

# lsmod | grep r8821cu
# lsmod | grep 8821cu
# ifconfig -a

If there is a device name, ethX, shown on the monitor, the linux
Expand Down Expand Up @@ -88,10 +88,10 @@

1. Force the link status when insert the driver.

If the user is in the path ~/r8821cu, the link status can be forced
If the user is in the path ~/8821cu, the link status can be forced
to one of the 5 modes as following command.

# insmod ./src/r8821cu.ko speed=SPEED_MODE duplex=DUPLEX_MODE autoneg=NWAY_OPTION
# insmod ./src/8821cu.ko speed=SPEED_MODE duplex=DUPLEX_MODE autoneg=NWAY_OPTION

,where
SPEED_MODE = 1000 for 1000Mbps
Expand All @@ -103,7 +103,7 @@
= 1 for auto-negotiation on (nway force)
For example:

# insmod ./src/r8821cu.ko speed=100 duplex=0 autoneg=1
# insmod ./src/8821cu.ko speed=100 duplex=0 autoneg=1

will force PHY to operate in 100Mpbs Half-duplex(nway force).

Expand Down
6 changes: 3 additions & 3 deletions autorun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ if [ "$check" != "" ]; then
/sbin/rmmod r8169
fi

check=`lsmod | grep r8821cu`
check=`lsmod | grep 8821cu`
if [ "$check" != "" ]; then
echo "rmmod r8821cu"
/sbin/rmmod r8821cu
echo "rmmod 8821cu"
/sbin/rmmod 8821cu
fi

echo "Build the module and install"
Expand Down
4 changes: 2 additions & 2 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
realtek-r8821cu-dkms for Debian
realtek-8821cu-dkms for Debian

This installs a DKMS for Realtek r8821cu drivers.
This installs a DKMS for Realtek 8821cu drivers.

-- Deokgyu Yang <[email protected]> Tue, 06 Oct 2024 11:08:35 +0900
2 changes: 1 addition & 1 deletion debian/README.source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
realtek-r8821cu-dkms for Debian
realtek-8821cu-dkms for Debian

The driver source can be found here:
https://www.realtek.com/Download/List?cate_id=584
Expand Down
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
realtek-r8821cu-dkms (10.013.00-1) stable; urgency=medium
realtek-8821cu-dkms (10.013.00-1) stable; urgency=medium

* Initial package with r8821cu 10.013.00 driver by Realtek
* Initial package with 8821cu 10.013.00 driver by Realtek

-- Deokgyu Yang <[email protected]> Tue, 06 Oct 2024 11:08:35 +0900
6 changes: 3 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Source: realtek-r8821cu-dkms
Source: realtek-8821cu-dkms
Section: contrib/kernel
Priority: optional
Maintainer: Deokgyu Yang <[email protected]>
Build-Depends: debhelper (>=11~), dkms (<< 3.0.3-3~) | dh-sequence-dkms
Standards-Version: 4.6.2.1
Homepage: https://github.com/awesometic/realtek-r8821cu-dkms
Homepage: https://github.com/awesometic/realtek-8821cu-dkms

Package: realtek-r8821cu-dkms
Package: realtek-8821cu-dkms
Architecture: any
Multi-Arch: foreign
Depends: dkms (>= 1.95), ${misc:Depends}
Expand Down
4 changes: 2 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: realtek-r8821cu-dkms
Source: https://github.com/awesometic/realtek-r8821cu-dkms
Upstream-Name: realtek-8821cu-dkms
Source: https://github.com/awesometic/realtek-8821cu-dkms

Files: *
Copyright: 2024 Realtek Semiconductor Corp.
Expand Down
2 changes: 1 addition & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# set -e

NAME=realtek-r8821cu
NAME=realtek-8821cu
PACKAGE_NAME=$NAME-dkms
DEB_NAME=$(echo $PACKAGE_NAME | sed 's,_,-,')
CVERSION=$(dpkg-query -W -f='${Version}' $DEB_NAME | awk -F "-" '{print $1}' | cut -d\: -f2)
Expand Down
2 changes: 1 addition & 1 deletion debian/prerm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

NAME=realtek-r8821cu
NAME=realtek-8821cu
VERSION=10.013.00

set -e
Expand Down
6 changes: 3 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ VERSION := $(shell dpkg-parsechangelog -S Version | sed 's/-.*//' | sed 's/+pris
dh $@ --parallel --with dkms

override_dh_install:
dh_install dkms.conf REALTEK_README.txt Makefile usr/src/realtek-r8821cu-$(VERSION)
dh_install src/* usr/src/realtek-r8821cu-$(VERSION)/src
dh_install dkms.conf REALTEK_README.txt Makefile usr/src/realtek-8821cu-$(VERSION)
dh_install src/* usr/src/realtek-8821cu-$(VERSION)/src

override_dh_dkms:
dh_dkms -V $(VERSION)

override_dh_fixperms:
dh_fixperms
find debian/realtek-r8821cu-dkms/usr/src -type f -exec chmod -x {} \;
find debian/realtek-8821cu-dkms/usr/src -type f -exec chmod -x {} \;

override_dh_builddeb:
dh_builddeb -- -Zxz
Expand Down
4 changes: 2 additions & 2 deletions dkms-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ else
fi

DRV_DIR="$(pwd)"
DRV_NAME=r8821cu
DRV_VERSION=10.013.00
DRV_NAME=8821cu
DRV_VERSION=5.12.0.4

cp -r ${DRV_DIR} /usr/src/${DRV_NAME}-${DRV_VERSION}

Expand Down
4 changes: 2 additions & 2 deletions dkms-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ else
fi

DRV_DIR="$(pwd)"
DRV_NAME=r8821cu
DRV_VERSION=10.013.00
DRV_NAME=8821cu
DRV_VERSION=5.12.0.4

dkms remove ${DRV_NAME}/${DRV_VERSION} --all
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
Expand Down
4 changes: 2 additions & 2 deletions dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="realtek-r8821cu"
PACKAGE_VERSION="10.013.00"
PACKAGE_NAME="realtek-8821cu"
PACKAGE_VERSION="5.12.0.4"
PROCS_NUM=`nproc`
[ $PROCS_NUM -gt 16 ] && PROCS_NUM=16
MAKE="'make' -j$PROCS_NUM KVER=${kernelver} BSRC=/lib/modules/${kernelver} modules"
Expand Down

0 comments on commit 9824382

Please sign in to comment.