autoinstall for kernel: 6.5.11-3-pve failed!

andrema2

Member
Dec 7, 2020
28
5
8
52
Hi, I tried to update my proxmox servers. Two of them went ok without a problem. One of them I'm getting this error message

Code:
Setting up proxmox-kernel-6.5.11-3-pve (6.5.11-3) ...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 6.5.11-3-pve /boot/vmlinuz-6.5.11-3-pve
dkms: running auto installation service for kernel 6.5.11-3-pve.
Sign command: /lib/modules/6.5.11-3-pve/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 -j8 KERNELRELEASE=6.5.11-3-pve -C /lib/modules/6.5.11-3-pve/build M=/var/lib/dkms/r8168/8.051.02/build......(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.5.11-3-pve (x86_64)
Consult /var/lib/dkms/r8168/8.051.02/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
dkms: autoinstall for kernel: 6.5.11-3-pve failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/proxmox-kernel-6.5.11-3-pve.postinst line 20.
dpkg: error processing package proxmox-kernel-6.5.11-3-pve (--configure):
 installed proxmox-kernel-6.5.11-3-pve package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of proxmox-kernel-6.5:
 proxmox-kernel-6.5 depends on proxmox-kernel-6.5.11-3-pve; however:
  Package proxmox-kernel-6.5.11-3-pve is not configured yet.

dpkg: error processing package proxmox-kernel-6.5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of proxmox-default-kernel:
 proxmox-default-kernel depends on proxmox-kernel-6.5; however:
  Package proxmox-kernel-6.5 is not configured yet.

This is the log that make.log has.

Code:
DKMS make.log for r8168-8.051.02 for kernel 6.5.11-3-pve (x86_64)
Tue Nov 21 11:31:11 AM -03 2023
make: Entering directory '/usr/src/linux-headers-6.5.11-3-pve'
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/r8168_n.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/r8168_asf.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/rtl_eeprom.o
  CC [M]  /var/lib/dkms/r8168/8.051.02/build/rtltool.o
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c: In function ‘r8168_csum_workaround’:
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:29208:24: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘sk>
29208 |                 segs = skb_gso_segment(skb, features);
      |                        ^~~~~~~~~~~~~~~
      |                        skb_gso_reset
/var/lib/dkms/r8168/8.051.02/build/r8168_n.c:29208:22: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from int>
29208 |                 segs = skb_gso_segment(skb, features);
      |                      ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:251: /var/lib/dkms/r8168/8.051.02/build/r8168_n.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.5.11-3-pve/Makefile:2039: /var/lib/dkms/r8168/8.051.02/build] Error 2
make: *** [Makefile:234: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.5.11-3-pve'

What can I do to solve it ?
 
Hey,
it looks like that at some point you installed a driver for a network realtek network card.
You can download a recent version from the official site [0]. As there are some recent changes, there might be a good chance that it has been updated to work with a recent version of the kernel. I would suggest following the install instructions from the README, after that you should be able to complete the installation of the new kernel.

[0] https://www.realtek.com/en/componen...0-1000m-gigabit-ethernet-pci-express-software
 
I just uninstall the driver and let the update happen. Once it did I was expecting the disconnections I was seeing before. They did not appeared so far. I can confirm I'm using the r8169 driver instead of the r8168 that I was using before.

In my case it seems that the issue is solved
 
  • Like
Reactions: JF62
I just uninstall the driver and let the update happen. Once it did I was expecting the disconnections I was seeing before. They did not appeared so far. I can confirm I'm using the r8169 driver instead of the r8168 that I was using before.

In my case it seems that the issue is solved
Looks like mine are also fixed by installing the driver manually
 
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:

Code:
apt upgrade


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
Code:
$endif
statement around the include.

References:
[1] - https://lore.kernel.org/netfilter-devel/1367259744-8922-16-git-send-email-pablo@netfilter.org/
 
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:

Code:
apt upgrade


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
Code:
$endif
statement around the include.

References:
[1] - https://lore.kernel.org/netfilter-devel/1367259744-8922-16-git-send-email-pablo@netfilter.org/

Keep in mind r8169 is working on Kernel 6.5.11-4. I just tested.

So you can uninstall r8168-dkms completely and move on.
Just remember to remove r8169 from modprobe blacklist otherwise it will not be loaded at boot time.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!