# Setup apt install software-properties-common ubuntu-dev-tools add-apt-repository ppa:canonical-kernel-team/ubuntu/ppa apt install linux-generic linux-generic-wip dkms=2.8.7-2ubuntu2 pull-lp-debs v4l2loopback kinetic
This installs v5.15 and preliminary v5.19 kernels in a jammy chroot, together with dkms from jammy release pocket. It also fetches a sample dkms module from kinetic, that supports both kernels. # apt install ./v4l2loopback-dkms_0.12.7-2ubuntu2_all.deb Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'v4l2loopback-dkms' instead of './v4l2loopback-dkms_0.12.7-2ubuntu2_all.deb' Suggested packages: v4l2loopback-utils The following NEW packages will be installed: v4l2loopback-dkms 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/29.3 kB of archives. After this operation, 113 kB of additional disk space will be used. Get:1 /root/v4l2loopback-dkms_0.12.7-2ubuntu2_all.deb v4l2loopback-dkms all 0.12.7-2ubuntu2 [29.3 kB] Selecting previously unselected package v4l2loopback-dkms. (Reading database ... 93941 files and directories currently installed.) Preparing to unpack .../v4l2loopback-dkms_0.12.7-2ubuntu2_all.deb ... Unpacking v4l2loopback-dkms (0.12.7-2ubuntu2) ... Setting up v4l2loopback-dkms (0.12.7-2ubuntu2) ... Loading new v4l2loopback-0.12.7 DKMS files... It is likely that 5.15.0-52-generic belongs to a chroot's host Building for 5.15.0-54-generic and 5.19.0-18-generic Building initial module for 5.15.0-54-generic Done. v4l2loopback.ko: Running module version sanity check. - Original module - Installation - Installing to /lib/modules/5.15.0-54-generic/updates/dkms/ depmod... Building initial module for 5.19.0-18-generic Error! Bad return status for module build on kernel: 5.19.0-18-generic (x86_64) Consult /var/lib/dkms/v4l2loopback/0.12.7/build/make.log for more information. dpkg: error processing package v4l2loopback-dkms (--configure): installed v4l2loopback-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: v4l2loopback-dkms E: Sub-process /usr/local/libexec/mk-sbuild/dpkg returned an error code (1) # dkms status v4l2loopback/0.12.7, 5.15.0-54-generic, x86_64: installed With current dkms, the module is built correctly for v5.15 kernel bug fails for v5.19 kernel. In the build log we can see that gcc-11 is used to build the module instead of gcc-12. warning: the compiler differs from the one used to build the kernel The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0 You are using: cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Upgrade dkms package to the proposed version # apt install dkms Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: cpp-12 gcc-12 libasan8 libgcc-12-dev libtsan2 Suggested packages: gcc-12-locales menu gcc-12-multilib gcc-12-doc The following NEW packages will be installed: cpp-12 gcc-12 libasan8 libgcc-12-dev libtsan2 The following packages will be upgraded: dkms ... Setting up gcc-12 (12.1.0-2ubuntu1~22.04) ... Setting up dkms (2.8.7-2ubuntu2.1) ... Setting up v4l2loopback-dkms (0.12.7-2ubuntu2) ... Removing old v4l2loopback-0.12.7 DKMS files... Module v4l2loopback-0.12.7 for kernel 5.15.0-54-generic (x86_64). Before uninstall, this module version was ACTIVE on this kernel. v4l2loopback.ko: - Uninstallation - Deleting from: /lib/modules/5.15.0-54-generic/updates/dkms/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. depmod... Deleting module v4l2loopback-0.12.7 completely from the DKMS tree. Loading new v4l2loopback-0.12.7 DKMS files... It is likely that 5.15.0-52-generic belongs to a chroot's host Building for 5.15.0-54-generic and 5.19.0-18-generic Building initial module for 5.15.0-54-generic Done. v4l2loopback.ko: Running module version sanity check. - Original module - Installation - Installing to /lib/modules/5.15.0-54-generic/updates/dkms/ depmod... Building initial module for 5.19.0-18-generic Done. v4l2loopback.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/5.19.0-18-generic/updates/dkms/ depmod... Processing triggers for libc-bin (2.35-0ubuntu3) ... # dkms status v4l2loopback/0.12.7, 5.15.0-54-generic, x86_64: installed v4l2loopback/0.12.7, 5.19.0-18-generic, x86_64: installed We observe that the dkms module is built correctly for both v5.15 and v5.19 kernels. Also we can see that matching toolchain was used for each kernel: # readelf -p .comment /lib/modules/*/updates/dkms/v4l2loopback.ko File: /lib/modules/5.15.0-54-generic/updates/dkms/v4l2loopback.ko String dump of section '.comment': [ 1] GCC: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 [ 2d] GCC: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 File: /lib/modules/5.19.0-18-generic/updates/dkms/v4l2loopback.ko String dump of section '.comment': [ 1] GCC: (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0 [ 2d] GCC: (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0 gcc-11 for v5.15, and gcc-12 for v5.19 kernel. ** Tags removed: verification-needed verification-needed-jammy ** Tags added: verification-done verification-done-jammy -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to zfs-linux in Ubuntu. https://bugs.launchpad.net/bugs/1991664 Title: backport dkms fixes to build modules correctly for hwe-5.19+ kernels with custom compiler Status in backport-iwlwifi-dkms package in Ubuntu: Fix Released Status in dkms package in Ubuntu: Fix Released Status in linux package in Ubuntu: Fix Released Status in v4l2loopback package in Ubuntu: Fix Released Status in zfs-linux package in Ubuntu: Fix Released Status in backport-iwlwifi-dkms source package in Jammy: New Status in dkms source package in Jammy: Fix Committed Status in linux source package in Jammy: Incomplete Status in v4l2loopback source package in Jammy: New Status in zfs-linux source package in Jammy: New Bug description: [ Impact ] * hwe-5.19 kernel has to be compiled with gcc-12+ for the new security kernel config options that have been enabled in that kernel (init zero structs). * dkms needs to be patched to attempt to use the same compiler as was used to build the kernel, specifically use gcc for v5.15 but gcc-12 for v5.19+ in jammy * dkms autopkgtests also need to be improved to ensure there are no false negatives when kernel has module under test already built-in at the same version. * because linux-headers packages in Ubuntu do not depend on a toolchain, and it is very hard to correctly depend on a native or cross-toolchain, add gcc-12 dependency in the dkms package. [ Test Plan ] * Retrigger dkms module test for a built-in package of the same version as already built into the kernel, for example zfs-linux dkms. It should pass. * Attempt to build dkms modules against v5.15 kernel and v5.19 kernel from proposed. dkms module should be built with gcc and gcc-12 respectively. [ Where problems could occur ] * New gcc-12 dependency on the dkms package may result in two compilers being installed in the Ubuntu Desktop Live image * New gcc-12 dependency may prevent automatic upgrade/installation of the dkms package update via unattended upgrades. [ Other Info ] * It is questionable for dkms to depend on any c-compiler, given that a module for a given kernel can really be built with the same toolchain and the same compiler features. * In debian, linux kernel packages ship and extra configuration file in the kernel headers, dkms uses said configuration file to use a matching compiler, and linux-headers packages depend on the toolchain used to build a given kernel. Maybe in the future Ubuntu could consider using the same packaging. * Some DKMS modules need further fixes to preserve and not loose the compiler setting To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/backport-iwlwifi-dkms/+bug/1991664/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp