dkms icon indicating copy to clipboard operation
dkms copied to clipboard

Allow kernel specific dkms.conf

Open 16Martin opened this issue 2 years ago • 1 comments

I have different kernels on my system, which were built using different versions of GCC. I need to make sure dkms uses the correct GCC version for each individual kernel.

I can create this effect for specific modules and versions, because dkms has (starting on line 476) a set of dkms.conf files it loads in sequence. This list contains /etc/dkms/$module-$module_version-$1.conf where $1 is the kernel version. If I create such files with their contents of the form

MAKE[0]="CC=/usr/bin/gcc-x.y.z make"

I can get the desired effect.

However, I manually have to maintain such files for all modules for all versions for all kernel versions, which is a bit unwieldy.`

I would like to see the list of default dkms.conf files extended to include something along the lines of

  • /etc/dkms/$1.conf
  • /etc/dkms/$1-$2.conf

so that I can have default configs for all kernels and architectures. (I left out the architecture part above to keep the description short.)

16Martin avatar Jan 24 '23 11:01 16Martin

Could you try this branch https://github.com/xuzhen/dkms/tree/cc ? It can automatically detecting gcc version used by target kernel if kernel version >= 4.18. No longer need to add CC=... in dkms.conf

xuzhen avatar Jan 24 '23 16:01 xuzhen