realtek-r8152-dkms icon indicating copy to clipboard operation
realtek-r8152-dkms copied to clipboard

DKMS is building and installing for the wrong kernel after kernel upgrade

Open lightmaster opened this issue 4 months ago • 1 comments

Previous kernel version: 6.5.11-8-pve New kerenl version:6.5.13-8-pve

When 6.5.13-8-pve was installed, dkms built and installed the driver for both kernels. However, while it correctly built it for the then currently running kernel (the old one):

6.5.11-8-pve make log
DKMS make.log for realtek-r8152-2.17.1 for kernel 6.5.11-8-pve (x86_64)
Fri Mar 15 10:04:01 PM EDT 2024
make -C src/ modules
make[1]: Entering directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'
make -C /lib/modules/6.5.11-8-pve/build M=/var/lib/dkms/realtek-r8152/2.17.1/build/src modules
make[2]: Entering directory '/usr/src/linux-headers-6.5.11-8-pve'
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.o
  MODPOST /var/lib/dkms/realtek-r8152/2.17.1/build/src/Module.symvers
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.mod.o
  LD [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
  BTF [M] /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
Skipping BTF generation for /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-6.5.11-8-pve'
make[1]: Leaving directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'

When it attempted to build and install it for kernel 6.5.13-1-pve, it instead installed it for the old kernel.

6.5.13-1-pve make log
DKMS make.log for realtek-r8152-2.17.1 for kernel 6.5.13-1-pve (x86_64)
Fri Mar 15 10:29:33 PM EDT 2024
make -C src/ modules
make[1]: Entering directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'
make -C /lib/modules/6.5.11-8-pve/build M=/var/lib/dkms/realtek-r8152/2.17.1/build/src modules
make[2]: Entering directory '/usr/src/linux-headers-6.5.11-8-pve'
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.o
  MODPOST /var/lib/dkms/realtek-r8152/2.17.1/build/src/Module.symvers
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.mod.o
  LD [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
  BTF [M] /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
Skipping BTF generation for /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-6.5.11-8-pve'
make[1]: Leaving directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'

After booting to 6.5.13-1-pve, if I try to ping an IP that is on that realtek interface, I can't. If I then build and install the modules with dkms build -m realtek-r8152/2.17.1 --force && dkms install -m realtek-r8152/2.17.1 --force, then reboot, it works and the log looks like it should, building for the correct kernel:

6.5.13-1-pve make log
DKMS make.log for realtek-r8152-2.17.1 for kernel 6.5.13-1-pve (x86_64)
Fri Mar 15 11:13:06 PM EDT 2024
make -C src/ modules
make[1]: Entering directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'
make -C /lib/modules/6.5.13-1-pve/build M=/var/lib/dkms/realtek-r8152/2.17.1/build/src modules
make[2]: Entering directory '/usr/src/linux-headers-6.5.13-1-pve'
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.o
  MODPOST /var/lib/dkms/realtek-r8152/2.17.1/build/src/Module.symvers
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.mod.o
  LD [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
  BTF [M] /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
Skipping BTF generation for /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-6.5.13-1-pve'
make[1]: Leaving directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'

And now, if I try to build and install for the old kernel that's not running with the commands dkms build -m realtek-r8152/2.17.1 -k 6.5.11-8-pve --force && dkms install -m realtek-r8152/2.17.1 -k 6.5.11-8-pve --force, the log now shows that it tried to build for 6.5.11-8-pve but actually built for the running kernel 6.5.13-1-pve

6.5.11-8-pve make log
DKMS make.log for realtek-r8152-2.17.1 for kernel 6.5.11-8-pve (x86_64)
Fri Mar 15 11:20:19 PM EDT 2024
make -C src/ modules
make[1]: Entering directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'
make -C /lib/modules/6.5.13-1-pve/build M=/var/lib/dkms/realtek-r8152/2.17.1/build/src modules
make[2]: Entering directory '/usr/src/linux-headers-6.5.13-1-pve'
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.o
  MODPOST /var/lib/dkms/realtek-r8152/2.17.1/build/src/Module.symvers
  CC [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.mod.o
  LD [M]  /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
  BTF [M] /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko
Skipping BTF generation for /var/lib/dkms/realtek-r8152/2.17.1/build/src/r8152.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-6.5.13-1-pve'
make[1]: Leaving directory '/var/lib/dkms/realtek-r8152/2.17.1/build/src'

lightmaster avatar Mar 16 '24 03:03 lightmaster