To be able to update the kernel to
6.5.11-4-pve, WITH
R8168 kernel module working, you need to build the kernel module for the new version of the kernel. The module was previously build for the kernel version you were running.
To fix it you'll need to get the kernel headers for the new version:
Code:
apt-get install linux-headers-6.5.11-4-pve
Second, you'll need to fix the kernel module source code, as Realtek did not really update the source code so it builds correctly for kernel 6.5. Luckily, fixing it is simple. Check my notes in the end for a technical explanation for the issue.
Edit the following file with your favourite editor:
Code:
nano /usr/src/r8168-8.051.02/r8168_n.c
Then add the following line to the beginning of it:
Code:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
#include <net/gso.h>
#endif
My suggestion is, you should add it in between the 2 lines below:
Code:
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
So it looks like this:
Code:
#include <linux/netdevice.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
#include <net/gso.h>
#endif
#include <linux/etherdevice.h>
Then you can try building the kernel module:
Code:
dkms build -m r8168 -v 8.051.02 -k 6.5.11-4-pve
You can check if anything went wrong this way:
Code:
cat /var/lib/dkms/r8168/8.051.02/build/make.log
You MIGHT need to install
grub-efi-amd64 if you have related errors while building the module. If so, do this:
Code:
apt install grub-efi-amd64
Then retry building the kernel module.
After that you should be able to upgrade the kernel to 6.5.11-4 and also upgrade Proxmox to 8.1:
ADDENDUM - What's wrong with the kernel module source code?
The
skb_gso_segment C function definition was moved from the
netdevice.h header file to
net/gso.h in kernel
6.4.10 (if I'm not wrong) [1].
Hence the error when building the kernel module. The function definition couldn't be found.
The fix is just a matter of adding the
net/gso.h header include.
However that's only necessary for kernel 6.4.10 forward. Hence the
Code:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
conditional statement and its matching
statement around the
include.
References:
[1] -
https://lore.kernel.org/netfilter-devel/1367259744-8922-16-git-send-email-pablo@netfilter.org/