strongtz / i915-sriov-dkms

dkms module of Linux i915 driver with SR-IOV support
930 stars 114 forks source link

DKMS autoinstall question #127

Open makoONE opened 9 months ago

makoONE commented 9 months ago

Does anyone know how to teach the dkms autoinstaller the --force flag? After a proxmox kernel upgrade the i915 module is built correctly but not installed. A "dkms status" then shows the message for the new kernel: (WARNING! Diff between built and installed module!) whereupon I have to manually correct this with the command ""dkms install -m i915-sriov-dkms -v 6.5 -k $(uname -r) --force". It would be nice if the installation would run automatically with every kernel upgrade.

skill7899 commented 9 months ago

DKMS (Dynamic Kernel Module Support) is a system that enables generating Linux kernel modules (drivers) during kernel upgrades. The DKMS autoinstaller typically handles module installations automatically when the kernel is updated.

If you want to instruct the DKMS autoinstaller to use the --force flag during module installations, you can achieve this by configuring DKMS to install modules forcefully. Here are the general steps:

Locate the DKMS Configuration File: Find the DKMS configuration file, which is usually located at /etc/dkms/framework.conf. You can use a text editor like nano or vim to edit the file. bash Copy code sudo nano /etc/dkms/framework.conf Edit the Configuration File: Add or modify the following line to enable forceful installations: bash Copy code FORCE_MODULE_INSTALL=yes If this line doesn't exist, you can add it. Save the file and exit the text editor. Update DKMS Configuration: After making changes to the DKMS configuration, you may need to update the DKMS framework. bash Copy code sudo dkms autoinstall This command should reconfigure DKMS based on the changes you made in the configuration file. Verify the Change: You can check the status of the DKMS modules to ensure that the --force flag is being used during installations: bash Copy code sudo dkms status If the modules are being installed forcefully, you should see that reflected in the status output. Please note that forcing installations may have implications, and it should be done with caution. It's typically used when dealing with specific issues or conflicts, and it's not the default behavior to avoid unintended consequences. Always consider the reasons for using the --force flag and make sure it's necessary in your specific situation.

makoONE commented 9 months ago

Many thanks for the quick response, but unfortunately the suggested solution does not work. As described, I have added the code "FORCE_MODULE_INSTALL=yes" in the file /etc/dkms/framework.conf. When I then run a Proxmox kernel upgrade (to version 6.5.11-6-pve), the familiar output appears again on the console :

Building module:
Cleaning build area...
make -j16 KERNELRELEASE=6.5.11-6-pve -j16 -C /lib/modules/6.5.11-6-pve/build M=/var/lib/dkms/i915-sriov-dkms/6.5/build KVER=6.5.11-6-pve...........
Signing module /var/lib/dkms/i915-sriov-dkms/6.5/build/i915.ko
Cleaning build area...

i915.ko:
Running module version sanity check.
Module version for i915.ko
exactly matches what is already found in kernel 6.5.11-6-pve.
DKMS will not replace this module.
You may override by specifying --force.
depmod...
dkms: autoinstall for kernel: 6.5.11-6-pve.

Checking the status shows the following as usual:

root@homelab:/# dkms status
i915-sriov-dkms/6.5, 6.5.11-4-pve, x86_64: installed
i915-sriov-dkms/6.5, 6.5.11-5-pve, x86_64: installed
i915-sriov-dkms/6.5, 6.5.11-6-pve, x86_64: installed (WARNING! Diff between built and installed module!)

As a result, the installation was unfortunately not forced automatically.