Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DKMS Build Fails on CentOS 9 Stream (5.14.0-412.el9.x86_64) #7

Open
rwlove opened this issue Feb 11, 2024 · 5 comments
Open

DKMS Build Fails on CentOS 9 Stream (5.14.0-412.el9.x86_64) #7

rwlove opened this issue Feb 11, 2024 · 5 comments

Comments

@rwlove
Copy link

rwlove commented Feb 11, 2024

DKMS make.log for gasket-0.0.git.252.c41789f9 for kernel 5.14.0-412.el9.x86_64 (x86_64)
Sun Feb 11 09:01:33 AM EST 2024
make -C "/lib/modules/5.14.0-412.el9.x86_64/build" M="/var/lib/dkms/gasket/0.0.git.252.c41789f9/build" modules
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/usr/src/kernels/5.14.0-412.el9.x86_64'
  CC [M]  /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.o
/var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.c: In function ‘gasket_register_device’:
/var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.c:1846:47: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1846 |     internal->class = class_create(driver_desc->module, driver_desc->name);
      |                                    ~~~~~~~~~~~^~~~~~~~
      |                                               |
      |                                               struct module *
In file included from ./include/linux/device.h:31,
                 from ./include/linux/cdev.h:8,
                 from /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.h:11,
                 from /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.c:12:
./include/linux/device/class.h:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  230 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.c:1846:23: error: too many arguments to function ‘class_create’
 1846 |     internal->class = class_create(driver_desc->module, driver_desc->name);
      |                       ^~~~~~~~~~~~
In file included from ./include/linux/device.h:31,
                 from ./include/linux/cdev.h:8,
                 from /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.h:11,
                 from /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.c:12:
./include/linux/device/class.h:230:29: note: declared here
  230 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:299: /var/lib/dkms/gasket/0.0.git.252.c41789f9/build/gasket_core.o] Error 1
make[1]: *** [Makefile:1934: /var/lib/dkms/gasket/0.0.git.252.c41789f9/build] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.14.0-412.el9.x86_64'
make: *** [Makefile:15: all] Error 2```
@rwlove
Copy link
Author

rwlove commented Feb 11, 2024

I can build by pulling the latest source and applying the following change:

index b1c2726..c0a940e 100644
--- a/src/gasket_core.c
+++ b/src/gasket_core.c
@@ -1839,14 +1839,7 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
        mutex_init(&internal->mutex);
        memset(internal->devs, 0, sizeof(struct gasket_dev *) * GASKET_DEV_MAX);
 
-    /* Function signature for `class_create()` is changed in kernel >= 6.4.x
-     * to only accept a single argument.
-     * */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
-    internal->class = class_create(driver_desc->module, driver_desc->name);
-#else
-    internal->class = class_create(driver_desc->name);
-#endif
+       internal->class = class_create(driver_desc->name);
 
        if (IS_ERR(internal->class)) {
                pr_err("Cannot register %s class [ret=%ld]\n",```

@rwlove
Copy link
Author

rwlove commented Feb 11, 2024

I should also mention that I have only validated that the build succeeds, I have not tested that the driver works.

@cyqsimon
Copy link

Ah damnit it's those pesky backports again. It's basically the same problem as this one I had last year: google#14. I'll submit an issue to upstream.

@rwlove
Copy link
Author

rwlove commented May 11, 2024

@cyqsimon thanks. Please let me know if there's anything I can do to help.

cyqsimon added a commit to cyqsimon/gasket-driver that referenced this issue Jun 20, 2024
- Explicitly handle breaking changes in RHEL 9.4 backports
cyqsimon added a commit to cyqsimon/gasket-driver that referenced this issue Jun 20, 2024
- Explicitly handle breaking changes in RHEL 9.4 backports
@Handrail9
Copy link

Would this also be affecting Fedora Server 41? dkms.service keeps failing and showing this error

8:46 PM
dkms.service: Consumed 3.373s CPU time, 445M memory peak.
systemd
8:46 PM
Failed to start dkms.service - Builds and install new kernel modules through DKMS.
systemd
8:46 PM
dkms.service: Failed with result 'exit-code'.
systemd
8:46 PM
dkms.service: Main process exited, code=exited, status=11/n/a
systemd
8:46 PM
Refer to previous errors for more information.
dkms
8:46 PM
Error! One or more modules failed to install during autoinstall.
dkms
8:46 PM
Autoinstall on 6.12.4-200.fc41.x86_64 failed for module(s) gasket(10).
dkms
8:46 PM
Consult /var/lib/dkms/gasket/0.0.git.256.b6a7c6d8/build/make.log for more information.
dkms
8:46 PM
Error! Bad return status for module build on kernel: 6.12.4-200.fc41.x86_64 (x86_64)
dkms
8:46 PM
(bad exit status: 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants