Kernel 6.1.0-0.deb11.5-amd64 module build error (r8168-dkms)

The r8168-dkms can’t be build for Linux kernel 6.1. When rebooting the wired network interface is not up.
See Adapted for Linux 6.1 by zu1k · Pull Request #47 · mtorromeo/r8168 · GitHub and Additional patch for K6.1-rc · Issue #46 · mtorromeo/r8168 · GitHub for the fix.


  • Parrot version in use (if you are not aware of it, open terminal and type cat /etc/os-release | grep VERSION):
    VERSION_ID=“5.2”
    VERSION=“5.2 (Electro Ara)”
    VERSION_CODENAME=ara

  • Kernel version (if you are not aware of it, open terminal and type uname -r):
    6.0.0-12parrot1-amd64

  • Logs/Terminal output (use pastebin or similar services):
    $cat /var/lib/dkms/r8168/8.050.03/build/make.log
    DKMS make.log for r8168-8.050.03 for kernel 6.1.0-0.deb11.5-amd64 (x86_64)
    sam. 01 avril 2023 20:12:13 CEST
    make: Entering directory ‘/usr/src/linux-headers-6.1.0-0.deb11.5-amd64’
    CC [M] /var/lib/dkms/r8168/8.050.03/build/r8168_n.o
    CC [M] /var/lib/dkms/r8168/8.050.03/build/r8168_asf.o
    CC [M] /var/lib/dkms/r8168/8.050.03/build/rtl_eeprom.o
    CC [M] /var/lib/dkms/r8168/8.050.03/build/rtltool.o
    In file included from /var/lib/dkms/r8168/8.050.03/build/r8168_n.c:87:
    /var/lib/dkms/r8168/8.050.03/build/r8168_n.c: In function ‘rtl8168_init_one’:
    /var/lib/dkms/r8168/8.050.03/build/r8168.h:564:57: error: too many arguments to function ‘netif_napi_add’
    564 | #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
    | ^~~~~~~~~~~~~~
    /var/lib/dkms/r8168/8.050.03/build/r8168_n.c:26875:9: note: in expansion of macro ‘RTL_NAPI_CONFIG’
    26875 | RTL_NAPI_CONFIG(dev, tp, rtl8168_poll, R8168_NAPI_WEIGHT);
    | ^~~~~~~~~~~~~~~
    In file included from /var/lib/dkms/r8168/8.050.03/build/r8168_n.c:46:
    /usr/src/linux-headers-6.1.0-0.deb11.5-common/include/linux/netdevice.h:2569:1: note: declared here
    2569 | netif_napi_add(struct net_device *dev, struct napi_struct *napi,
    | ^~~~~~~~~~~~~~
    make[1]: *** [/usr/src/linux-headers-6.1.0-0.deb11.5-common/scripts/Makefile.build:255: /var/lib/dkms/r8168/8.050.03/build/r8168_n.o] Error 1
    make: *** [/usr/src/linux-headers-6.1.0-0.deb11.5-common/Makefile:2030: /var/lib/dkms/r8168/8.050.03/build] Error 2
    make: Leaving directory ‘/usr/src/linux-headers-6.1.0-0.deb11.5-amd64’

sudo apt install r8168-dkms
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following package was automatically installed and is no longer required:
linux-headers-6.0.0-0.deb11.6-common
Use ‘sudo apt autoremove’ to remove it.
The following NEW packages will be installed:
r8168-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 107 kB of archives.
After this operation, 1 427 kB of additional disk space will be used.
Get:1 Index of /parrot/ lts/non-free amd64 r8168-dkms all 8.050.03-2parrot1 [107 kB]
Fetched 107 kB in 0s (750 kB/s)
Selecting previously unselected package r8168-dkms.
(Reading database … 460020 files and directories currently installed.)
Preparing to unpack …/r8168-dkms_8.050.03-2parrot1_all.deb …
Unpacking r8168-dkms (8.050.03-2parrot1) …
Setting up r8168-dkms (8.050.03-2parrot1) …
Loading new r8168-8.050.03 DKMS files…
Building for 6.0.0-12parrot1-amd64 6.1.0-0.deb11.5-amd64
Building initial module for 6.0.0-12parrot1-amd64
Done.

r8168.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/6.0.0-12parrot1-amd64/updates/dkms/
      depmod…
      Building initial module for 6.1.0-0.deb11.5-amd64
      Error! Bad return status for module build on kernel: 6.1.0-0.deb11.5-amd64 (x86_64)
      Consult /var/lib/dkms/r8168/8.050.03/build/make.log for more information.

Yes, i got the same build-error:

" After the latest Kernel update 6.1.0-0.deb11.5, the Ethernet (wired) connection disappeared?

Only the wireless connection remained after the latest Kernel update 6.1.0-0.deb11.5??

How to reinstall the Ethernet (wired) connection again?? :face_with_raised_eyebrow:

Parrot version in use

VERSION_ID=“5.2”
VERSION=“5.2 (Electro Ara)”
VERSION_CODENAME=ara

Kernel version
6.1.0-0.deb11.5-amd64"

Sorry, but what to do with this?? How to update the kernel? (sorry for newbie question), but i dont really know how to update the kernel manually…? :confused:

Kernel 6.1-rc needs an additional patch:
`diff -Naur r8168.h r8168.h
— r8168.h 2022-06-19 03:55:16.000000000 +0100
+++ r8168.h 2022-10-19 17:55:14.380161219 +0100
@@ -561,7 +561,11 @@
*typedef struct napi_struct napi_ptr;
typedef int napi_budget;

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function)
+#else
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
+#endif
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
*#define RTL_GET_NETDEV(priv_ptr) struct net_device dev = priv_ptr->dev;`

It also works with rc2.

From: https://github.com/mtorromeo/r8168/issues/46

For now you could clone the fork (GitHub - zu1k/r8168: Linux device driver for Realtek Ethernet controllers (unofficial mirror)) with the fix and build manually.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.