Project

General

Profile

Packaging Request #3311

[rtl8812au-ng] Realtek Wi-Fi chip drivers

UltrasonicMadness - almost 2 years ago - . Updated over 1 year ago.

Status:
fixed
Priority:
wish
Assignee:
% Done:

0%


Description

I recently bought a wireless adapter after checking on h-node (https://www.h-node.org/wifi/view/en/2242/TP-Link-802-11ac-WLAN-Adapter/1/1/undef/undef/undef/undef/wifi-works/undef) that it worked on libre systems such as Parabola (my device ID in lsusb matches the corrected one in that h-node page's description), though I can't find the driver and it doesn't appear to be included in linux-libre-firmware or linux-libre-firmware-whence. Would it be possible to add githu8 aircrack-ng/rtl8812au to Parabola?

History

#1

Updated by bill-auger almost 2 years ago

  • Priority changed from bug to wish

there is an AUR package for that device - have you tried it? -
are you familiar with makepkg?

#2

Updated by bill-auger almost 2 years ago

  • Status changed from open to in progress
#3

Updated by bill-auger almost 2 years ago

the licensing looks good; so i packaged it - not sure if it will work or not because i do not have the hardware; but you could try it

the package name is 'rtl8812au-dkms'

#4

Updated by UltrasonicMadness almost 2 years ago

I tried installing it - there seems to be a problem in the install process.

==> dkms install --no-depmod rtl8812au/5.6.4.2.20220606 -k 5.15.41-gnu-1-lts
Error! Bad return status for module build on kernel: 5.15.41-gnu-1-lts (x86_64)
Consult /var/lib/dkms/rtl8812au/5.6.4.2.20220606/build/make.log for more information.
==> WARNING: `dkms install --no-depmod rtl8812au/5.6.4.2.20220606 -k 5.15.41-gnu-1-lts' exited 10

make.log contains this text, followed by the output of `make --help`:

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Mon 18 Jul 12:51:24 BST 2022
make: unrecognized option '--uname_r=5.15.41-gnu-1-lts'
#5

Updated by bill-auger almost 2 years ago

could you try this experiment

edit the file (with sudo) /usr/src/rtl8812au-5.6.4.2.20220606/dkms.conf

change this line:

  MAKE[0]="make --uname_r=$kernelver" 

to:
  MAKE[0]="make KVER=${kernelver}" 

then try building the module like:
$ sudo dkms install --no-depmod rtl8812au/5.6.4.2.20220606

#6

Updated by UltrasonicMadness almost 2 years ago

I've just tried it now - I get this error when running:

Sign command: /usr/lib/modules/5.15.41-gnu-1-lts/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=5.15.41-gnu-1-lts KVER=5.15.41-gnu-1-lts...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.15.41-gnu-1-lts (x86_64)
Consult /var/lib/dkms/rtl8812au/5.6.4.2.20220606/build/make.log for more information.

The log file contains this:

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Tue 19 Jul 15:40:35 BST 2022
Makefile:2175: /hal/phydm/phydm.mk: No such file or directory
make: *** No rule to make target '/hal/phydm/phydm.mk'.  Stop.

However, the path looked off (I've never seen /hal as a root folder on a Unix-like system) so I did some digging in the Makefile and found that it referred to $(src)/hal/phydm/phydm.mk - I set the src variable to /usr/src/rtl8812au-5.6.4.2.20220606 - the location of the hal folder with phydm and then I got this error in make.log:

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Tue 19 Jul 15:51:58 BST 2022
Generating a RSA private key
......................+++++
.+++++
writing new private key to 'MOK.priv'
-----
make: mokutil: No such file or directory
make: *** [Makefile:2342: sign] Error 127

I looked at the Makefile and it appeared to be running a program so I looked for mokutil - it appears that this program is designed for (U)EFI systems - the computer I'm running Parabola on is a BIOS system but I tried it anyway and sure enough (still in make.log):

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Tue 19 Jul 16:00:04 BST 2022
Generating a RSA private key
......+++++
...........+++++
writing new private key to 'MOK.priv'
-----
EFI variables are not supported on this system
make: *** [Makefile:2342: sign] Error 1

Uninstalled mokutil and changed the configuration file with KVER to additionally set NO_SKIP_SIGN so that it wouldn't run that bit:

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Tue 19 Jul 16:18:01 BST 2022
echo "Skipping key creation" 
Skipping key creation
At main.c:291:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76
sign-file: 88XXau.ko: No such file or directory
make: *** [Makefile:2345: sign] Error 1

I don't know where that C file is but I do notice something odd in the Makefile:

ifeq ($(NO_SKIP_SIGN), y)
        @openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER >
        @mokutil --import MOK.der
else
        echo "Skipping key creation" 
endif
        @$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der 88XXau.ko

I move that last line just above the else with indentation intact. Running DKMS again, the error is now simply:

DKMS make.log for rtl8812au-5.6.4.2.20220606 for kernel 5.15.41-gnu-1-lts (x86_64)
Tue 19 Jul 16:21:40 BST 2022
echo "Skipping key creation" 
Skipping key creation

Though I noticed the DKMS install command is still printing MOK information

$ sudo dkms install --no-depmod rtl8812au/5.6.4.2.20220606
Sign command: /usr/lib/modules/5.15.41-gnu-1-lts/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=5.15.41-gnu-1-lts KVER=5.15.41-gnu-1-lts NO_SKIP_SIGN=no...
Error!  Build of rtl8812au.ko failed for: 5.15.41-gnu-1-lts (x86_64)
Make sure the name of the generated module is correct and at the root of the
build directory, or consult make.log in the build directory
/var/lib/dkms/rtl8812au/5.6.4.2.20220606/build for more information.

I'm not quite sure what to try from here - I looked up how to disable MOK in DKMS but the main result was a Dell page detailing how to disable secure boot and the other results appeared to be guides on how to get DKMS to work with secure boot.

Edit: to be clear, the firmware for the device is still showing as missing in NetworkManager.

#7

Updated by bill-auger almost 2 years ago

the solution was suggested in the original error message

Make sure the name of the generated module is correct and at the root of the build directory

the built module in the root of the build directory, gets the file name: 88XXau.ko; so i changed BUILT_MODULE_NAME to '88XXau', and it installs now

rtl8812au-dkms 5.6.4.2.20220606-3 will have that change

#8

Updated by UltrasonicMadness almost 2 years ago

That's odd. I still seem to be having the same problems as detailed in the previous post. It doesn't seem to be outputting an 88XXau.ko file unless I run `sudo make` in the /usr/src/rtl8812au-5.6.4.2.20220606 - even if I copy this file to /var/lib/dkms/rtl8812au/5.6.4.2.20220606/build, it shows the same error. I can't find any generated .ko files in either /usr/src or /var/lib/dkms.

$ sudo dkms install --no-depmod rtl8812au/5.6.4.2.20220606
Sign command: /usr/lib/modules/5.15.41-gnu-1-lts/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=5.15.41-gnu-1-lts KVER=5.15.41-gnu-1-lts...
Error!  Build of 88XXau.ko failed for: 5.15.41-gnu-1-lts (x86_64)
Make sure the name of the generated module is correct and at the root of the
build directory, or consult make.log in the build directory
/var/lib/dkms/rtl8812au/5.6.4.2.20220606/build for more information.

#9

Updated by bill-auger almost 2 years ago

i could not make it work either, with the original package (pkgrel=1) - try the updated package (pkgrel=3)

#10

Updated by UltrasonicMadness almost 2 years ago

It works. I'm currently accessing this forum through the new Wi-Fi card. For the record, I made sure the old version of the package was uninstalled before installing the new one - DKMS install took some time but this is normal in my limited experience with it. Rebooted and a green LED on the device came to life for the first time. Thank you very much for packaging this driver - I would mark this as solved but I don't think I have the relevant permissions to do so.

#11

Updated by bill-auger almost 2 years ago

  • Assignee set to bill-auger
#12

Updated by bill-auger almost 2 years ago

  • Status changed from in progress to fixed
#13

Updated by bill-auger over 1 year ago

sry but we need to remove this package - it contains massive blobs, which i did not see originally

Most realtek recent drivers have a nonfree firmware as byte arrays in the C files. The files have GPL license headers; but the corresponding source code is apparently not available.
for example:

  • hal/rtl8812a/hal8812a_fw.c

Someone would need to liberate/replace those firmwares. The architecture of the CPU of these WiFi cihp is 8051; so it's already possible to de-compile the code with radare2, and we know the entry point.

#14

Updated by gap over 1 year ago

bill-auger we have had massive blobs in the form of NVIDIA packages which I reported over 3 months ago in #3293.

To quote myself from #3293:

From now on, I also recommend that we don't add any kernel module packages unless the Linux-libre project has checked them first.

Now I see evidence in this issue that was the correct strategy to recommend.

#15

Updated by UltrasonicMadness over 1 year ago

Hello everyone and sorry about this - I based this request entirely on the h-node page without checking the linked drivers for blobs.

#16

Updated by bill-auger over 1 year ago

  • Description updated (diff)

thanks for reminding - i just corrected the h-node entry

Also available in: Atom PDF