Installing a custom kernel doesn't install external kernel modules
Hello, I've got a question about how is the rebuilding of external kernel modules invoked during a new kernel version installation? The reason I'm asking is because when I install a modified kernel the Nvidia GPU driver modules are not built and installed like they are for regular kernels. Example how it works with standard kernel: I have kernel-default-5.10.3, kernel-default-5.10.4 is released, I run zypper dup, during the kernel installation the Nvidia modules are rebuilt against the new kernel and installed. I can reboot into the new kernel and everything works. Example with my situation: I take the kernel source kernel-source-5.10.4 from the standard Tumbleweed repos, make a few changes, build the rpms (make rpm-pkg), install them with Zypper but it doesn't install the Nvidia modules, I have to do this manually or else the GUI wouldn't work. So what exactly triggers the module rebuild? What does the official kernel rpm has that my rpm built for the same source doesn't?
07.01.2021 19:09, B пишет:
Hello,
I've got a question about how is the rebuilding of external kernel modules invoked during a new kernel version installation?
The reason I'm asking is because when I install a modified kernel the Nvidia GPU driver modules are not built and installed like they are for regular kernels.
Example how it works with standard kernel: I have kernel-default-5.10.3, kernel-default-5.10.4 is released, I run zypper dup, during the kernel installation the Nvidia modules are rebuilt against the new kernel and installed. I can reboot into the new kernel and everything works.
There is no rebuild. When new kernel is installed so called weak links to modules built against older kernel version are created as long as new kernel is kABI compatible. 5.10.3 and 5.10.4 are most likely compatible.
Example with my situation: I take the kernel source kernel-source-5.10.4 from the standard Tumbleweed repos, make a few changes, build the rpms (make rpm-pkg), install them with Zypper but it doesn't install the Nvidia modules, I have to do this manually or else the GUI wouldn't work.
What is full name of your RPM and your kernel?
So what exactly triggers the module rebuild? What does the official kernel rpm has that my rpm built for the same source doesn't?
07.01.2021 20:58, Andrei Borzenkov пишет:
07.01.2021 19:09, B пишет:
Hello,
I've got a question about how is the rebuilding of external kernel modules invoked during a new kernel version installation?
The reason I'm asking is because when I install a modified kernel the Nvidia GPU driver modules are not built and installed like they are for regular kernels.
Example how it works with standard kernel: I have kernel-default-5.10.3, kernel-default-5.10.4 is released, I run zypper dup, during the kernel installation the Nvidia modules are rebuilt against the new kernel and installed. I can reboot into the new kernel and everything works.
There is no rebuild. When new kernel is installed so called weak links to modules built against older kernel version are created as long as new kernel is kABI compatible. 5.10.3 and 5.10.4 are most likely compatible.
OK, it is not exactly true. nVidia KMP package contains trigger that is executed when kernel-$flavor-devel package is installed (it also runs when KMP package itself is installed). This trigger compiles nVidia modules for the latest kernel-$flavor-devel installed.
Example with my situation: I take the kernel source kernel-source-5.10.4 from the standard Tumbleweed repos, make a few changes, build the rpms (make rpm-pkg), install them with Zypper but it doesn't install the Nvidia modules, I have to do this manually or else the GUI wouldn't work.
What is full name of your RPM and your kernel?
That still holds. Trigger will run only when RPM with specific name is installed.
So what exactly triggers the module rebuild? What does the official kernel rpm has that my rpm built for the same source doesn't?
Yeah, I just found out that KMP packages only work on specific flavors, the Nvidia one is for the default flavor. When I build the kernel it's just kernel and not kernel-default, as I see there's not an option to just set the flavor but I'm testing one more thing currently.
Renaming kernel-devel to kernel-default-devel or adding that it provides kernel-default-devel won't work since those packages provide different things. The only way is to probably build rpms from https://github.com/openSUSE/kernel-source Might try another day or just stick to manually rebuilding Nvidia modules.
07.01.2021 22:53, B пишет:
Renaming kernel-devel to kernel-default-devel or adding that it provides kernel-default-devel won't work since those packages provide different things.
The only way is to probably build rpms from https://github.com/openSUSE/kernel-source
You can simply add trigger script to your kernel RPM that compiles nvidia modules. Just copy from nvidia KMP and adjust as appropriate. Or even add dummy RPM that contains just this script.
Might try another day or just stick to manually rebuilding Nvidia modules.
The RPM spec is generated by scripts/package/mkspec in the kernel source, I tried messing with those but it's too much hassle every time. I was mainly interested to know if there was a simple way to set this up, like if it was controlled by a hook in Zypper that I could easy add to. I already had a script that would apply a patch, change some settings in .config and spit out some commands so I could easily install that kernel and it was easier to just improve that. I changed that it won't just echo those commands but would ask if I want to run them so I'll be sticking with that for the time being.
On 07/01/2021 17.09, B wrote:
Hello,
Example with my situation: I take the kernel source kernel-source-5.10.4 from the standard Tumbleweed repos, make a few changes, build the rpms (make rpm-pkg), install them with Zypper but it doesn't install the Nvidia modules, I have to do this manually or else the GUI wouldn't work.
There is a trick. You should change the kernel name (there is a configure option for this) when you build your own. But I do not know if it has effect on your current problem. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 07/01/2021 20.17, B wrote:
Do you mean CONFIG_LOCALVERSION= in the .config or is there another option?
It is long since I do it... Let me have a look. [...] Yes, that one. Otherwise, the modules will be writen to the same directory as the package you installed and possibly overwrite them. At least, that was so when I did it, which admittedly was some years ago. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
I've been using CONFIG_LOCALVERSION before to name my kernels and it doesn't help in this situation, it's just a suffix that gets added to the name but it doesn't change the flavor of the kernel.
participants (3)
-
Andrei Borzenkov
-
B
-
Carlos E. R.