User Tools

Site Tools


doc:appunti:hardware:rtl8852be_on_debian_12

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:rtl8852be_on_debian_12 [2024/10/04 11:46] – [Creating the dkms source package into the chroot] niccolodoc:appunti:hardware:rtl8852be_on_debian_12 [2025/05/26 09:34] (current) – [DKMS self compiled module does not work!] niccolo
Line 1: Line 1:
 ====== RTL8852BE WiFi adapter on Debian 12 Bookworm ====== ====== RTL8852BE WiFi adapter on Debian 12 Bookworm ======
 +
 +===== DKMS self compiled module does not work! =====
 +
 +:!: **WARNING**! The recipe explained in this page actually does not work! At the end you will have a kernel module and a firmware blob that enable the WiFi adapter, they even support the WiFi scanning function, showing the available ESSIDs, but if you try to associate with an access point, the action fails with the following messages in loop:
 +
 +<code>
 +wlan0: authenticate with b2:32:6e:53:27:2a
 +wlan0: 80 MHz not supported, disabling VHT
 +</code>
 +
 +What actually does work is installing **kernel 6.12** from Bookworm backports, along with the **firmware-realtek** package:
 +
 +  * **[[https://packages.debian.org/bookworm-backports/linux-image-6.12.22+bpo-amd64|linux-image-6.12.22+bpo-amd64_6.12.22-1~bpo12+1_amd64.deb]]**
 +  * **[[https://packages.debian.org/bookworm-backports/firmware-realtek|firmware-realtek_20241210-1~bpo12+1_all.deb]]**
 +
 +===== Compiling the module with DKMS =====
 +
 +:!: **WARNING**! The kernel module obtained with this procedure actually does not work!
  
 The Realtek WiFi Network Controller **RTL8852BE** is not supported by the **6.1.0 Linux kernel** shipped with **Debian 12 Bookworm**. In this page you can find the steps required to compile and install the required kernel module and firmware. The Realtek WiFi Network Controller **RTL8852BE** is not supported by the **6.1.0 Linux kernel** shipped with **Debian 12 Bookworm**. In this page you can find the steps required to compile and install the required kernel module and firmware.
Line 8: Line 26:
   * Download and install the **rtw8852b_fw-1.bin** firmware.   * Download and install the **rtw8852b_fw-1.bin** firmware.
  
 +{{ .:mini_pc_t9plus:ami-bios-secure-boot.jpg?200|Secure Boot in BIOS}}
 A **self compiled kernel module** is strictly tied to the running kernel, so **it must be re-compiled** whenever the kernel package is upgraded. The official Debian kernel is properly signed, so it runs even if the **Secure Boot** option is enabled into the BIOS. But the self compiled kernel module is a non-trusted software running at kernel level, so it requires that the Secure Boot into the BIOS to be disabled. A **self compiled kernel module** is strictly tied to the running kernel, so **it must be re-compiled** whenever the kernel package is upgraded. The official Debian kernel is properly signed, so it runs even if the **Secure Boot** option is enabled into the BIOS. But the self compiled kernel module is a non-trusted software running at kernel level, so it requires that the Secure Boot into the BIOS to be disabled.
  
Line 20: Line 39:
  
 <code> <code>
 +apt install debootstrap
 mkdir -p /usr/local/src/chroot/dkms mkdir -p /usr/local/src/chroot/dkms
 debootstrap bookworm /usr/local/src/chroot/dkms http://deb.debian.org/debian/ debootstrap bookworm /usr/local/src/chroot/dkms http://deb.debian.org/debian/
Line 51: Line 71:
 git deborig HEAD git deborig HEAD
 dpkg-buildpackage -us -uc dpkg-buildpackage -us -uc
 +</code>
 +
 +The **%%git clean -xfd%%** does a complete cleanup of the source tree. The **git-deborig(1)** script (provided by the **devscripts** Debian packages), creates the **../rtw89_1.0.2.orig.tar.xz** archive from the GIT main branch. The .orig.tar.xz archive is required to build a complete Debian package.
 +
 +At the end of the process you will find the **../rtw89-dkms_1.0.2-3_all.deb** packages, which is the one you have to install into the target system.
 +
 +===== Installing the DKMS package into the target system =====
 +
 +Into the target host you need some packages that are required to build the kernel module from the DKMS sources. You need also to install the Linux headers of the same version of your running kernel:
 +
 +<code>
 +apt install dkms linux-headers-6.1.0-25-amd64
 +</code>
 +
 +Now you are ready to install the DKMS package, this will automatically compile the binaries of the kernel modules and install them into **/usr/lib/firmware/rtw89/**:
 +
 +<code>
 +dpkg -i /usr/local/src/chroot/dkms/usr/local/src/rtw89-dkms_1.0.2-3_all.deb
 +</code>
 +
 +If you want to load the kernel module without a reboot, just run the commands:
 +
 +<code>
 +depmod -a
 +modprobe rtw_8852be
 +</code>
 +
 +You may encounter a problem if Secure Boot is disabled:
 +
 +<code>
 +modprobe: ERROR: could not insert 'rtw_8852be': Key was rejected by service 
 +</code>
 +
 +You can inspect the status of Secure Boot with the **mokutil** utility (from the same name Debian package):
 +
 +<code>
 +mokutil --sb-state
 +SecureBoot enabled
 +</code>
 +
 +===== Providing the firmware =====
 +
 +If you have installed the non-free Debian package **firmware-realtek**, the kernel module will automatically load the **/lib/firmware/rtw89/rtw8852b_fw.bin**, as logged by the kernel:
 +
 +<code>
 +rtw89_8852be 0000:02:00.0: firmware: failed to load rtw89/rtw8852b_fw-1.bin (-2)
 +rtw89_8852be 0000:02:00.0: firmware: failed to load rtw89/rtw8852b_fw-1.bin (-2)
 +rtw89_8852be 0000:02:00.0: Direct firmware load for rtw89/rtw8852b_fw-1.bin failed with error -2
 +rtw89_8852be 0000:02:00.0: firmware: direct-loading firmware rtw89/rtw8852b_fw.bin
 +rtw89_8852be 0000:02:00.0: loaded firmware rtw89/rtw8852b_fw.bin
 +</code>
 +
 +But this is a non working fall-back, you can confirm that the WiFi adapter is not working:
 +
 +<code>
 +ifconfig wlan0 up
 +iwlist wlan0 scan
 +wlan0     Interface doesn't support scanning : Network is down
 +</code>
 +
 +You can download the required firmware from the **[[https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtw89/rtw8852b_fw-1.bin|kernel Git repository]]** and save it into **/usr/lib/firmware/rtw89/**; there are no directories for locally installed firmwares.
 +
 +===== Signal level not reported =====
 +
 +If everything is working, you can check for available WiFi networks using **iwlist**:
 +
 +<code>
 +rfkill unblock wlan
 +ifconfig wlan0 up
 +iwlist wlan0 scan
 +</code>
 +
 +The current module (rtw89 1.0.2) does not support the signal level reporting, for every ESSID you see the following:
 +
 +<code>
 +Quality=70/70  Signal level=0 dBm
 </code> </code>
  
doc/appunti/hardware/rtl8852be_on_debian_12.1728035205.txt.gz · Last modified: by niccolo