[SOLVED] 7to8 upgrade issue with DKMS modules: update-initramfs trying to generate image for non-installed kernel?

myxal

New Member
Dec 23, 2021
3
0
1
38
Cheers. I tried to upgrade yesterday, and had the `apt dist-upgrade` process fail on the new kernel packages, because the amdgpu module (installed from AMD repo) failed to build via DKMS.

# dpkg.log
2023-07-14 00:48:35 configure pve-kernel-6.2.16-4-pve:amd64 6.2.16-4 <none>
2023-07-14 00:48:35 status half-configured pve-kernel-6.2.16-4-pve:amd64 6.2.16-4
# term.log
...
checking for linux/pgtable.h... yes
checking for drm/drm_simple_kms_helper.h... yes
checking for supported chips... done
checking for module configuration... done
configure: creating ./config.status
config.status: creating config/config.h
Building module:
Cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=6.2.16-4-pve -j4 TTM_NAME=amdttm SCHED_NAME=amd-sched -C /lib/modules/6.2.16-4-pve/build M=/var/lib/dkms/amdgpu/5.13.11.21.50-1384495/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.2.16-4-pve (x86_64)
Consult /var/lib/dkms/amdgpu/5.13.11.21.50-1384495/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.2.16-4-pve ESC[31mfailed!ESC[0m
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/pve-kernel-6.2.16-4-pve.postinst line 20.
ESC[1mdpkg:ESC[0m error processing package pve-kernel-6.2.16-4-pve (--configure):
installed pve-kernel-6.2.16-4-pve package post-installation script subprocess returned error exit status 2
ESC[1mdpkg:ESC[0m dependency problems prevent configuration of pve-kernel-6.2:
pve-kernel-6.2 depends on pve-kernel-6.2.16-4-pve; however:
Package pve-kernel-6.2.16-4-pve is not configured yet.
ESC[1mdpkg:ESC[0m error processing package pve-kernel-6.2 (--configure):
dependency problems - leaving unconfigured
I'm currently stuck in a state where manipulating kernel packages fails, because when update-initramfs is triggered from the package scripts, it tries to build initramfs image for a kernel version which has long since been uninstalled, 5.13.19-5. Notably, this does not happen when I simply issue `update-initramfs -u -k all`.
update-initramfs: Generating /boot/initrd.img-5.13.19-5-pve
grep: /boot/config-5.13.19-5-pve: No such file or directory
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
grep: /boot/config-5.13.19-5-pve: No such file or directory
E: gzip compression (CONFIG_RD_GZIP) not supported by kernel
update-initramfs: failed for /boot/initrd.img-5.13.19-5-pve with 1
I figure I could fix the issue by removing whatever is causing update-initramfs to try, but I'm not sure where to look. The only filename with this version number I found are cached package for the kernel and its headers:
# find /var/ /etc /boot -name "*5.13.19-5*"
/var/cache/apt/archives/pve-headers-5.13.19-5-pve_5.13.19-13_amd64.deb
/var/cache/apt/archives/pve-kernel-5.13.19-5-pve_5.13.19-13_amd64.deb
In terms of file contents, the only reference I could find was some temp file for the amdgpu dkms package:
# grep -r "5.13.19-5" /var /etc /boot/
... (a few log files)
/var/tmp/amdgpu-dkms-kernels:5.13.19-5-pve
Any hints on fixing this? (Even if I have to uninstall the amdgpu module)
 
So this was pretty simple in the end - the call to `update-initramfs` is part of `postrm` script of the `amdgpu-dkms` package, where it simply reads the `amdgpu-dkms-kernels` file line by line. The old kernel version was the only line in that file.

I replaced that line with "all" and the package uninstallation succeeded. Following that, `apt dist-upgrade` and finally a check for any incomplete dpkg operations with `dpkg -l | grep -v ^ii`, and now `pve7to8 --full` reports that everything's OK
 

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!