module configed, but not compiled with rpmbuild

Issues related to applications and software problems and general support
Post Reply
danialbehzadi
Posts: 4
Joined: 2020/08/23 06:40:09

module configed, but not compiled with rpmbuild

Post by danialbehzadi » 2020/09/15 07:03:47

Hey,

I'm trying to add `dummy_hcd` module to my kernel in CentOS 8 on an Intel NUC machine.
Here is the query from my config:

Code: Select all

$ grep -i dummy_hcd /home/danialbehzadi/rpmbuild/SOURCES/kernel-4.18.0-x86_64.config
CONFIG_USB_DUMMY_HCD=m
but after booting into it, I get:

Code: Select all

$ sudo modprobe dummy_hcd
modprobe: FATAL: Module dummy_hcd not found in directory /lib/modules/4.18.0-193.14.2.el8.graph3.x86_64
This is my build command based on CentOS wiki and the Kernel Source in CentOS vault with build-out and build-err logs:

Code: Select all

$ rpmbuild -bb --target=x86_64 kernel.spec 2> build-err.log | tee build-out.log

mathog
Posts: 221
Joined: 2008/07/09 23:52:06

Re: module configed, but not compiled with rpmbuild

Post by mathog » 2020/09/16 22:47:23

Try following the instructions here:

https://medium.com/@alexanderyegorov_67 ... 287e9d145a


Off the top of my head I'm betting you didn't do a "make install", so it isn't under /lib/modules, and modprobe cannot find it.

danialbehzadi
Posts: 4
Joined: 2020/08/23 06:40:09

Re: module configed, but not compiled with rpmbuild

Post by danialbehzadi » 2020/09/20 08:55:30

Thank mathog.

I could make `dummy_hcd.ko` and `g_mass_storage.ko` and installed them. But when building them I got these warning:

Code: Select all

WARNING: "usb_gadget_udc_reset" [drivers/usb/gadget/udc/dummy_hcd.ko] undefined!
WARNING: "usb_gadget_giveback_request" [drivers/usb/gadget/udc/dummy_hcd.ko] undefined!
WARNING: "usb_add_gadget_udc" [drivers/usb/gadget/udc/dummy_hcd.ko] undefined!
WARNING: "usb_ep_set_maxpacket_limit" [drivers/usb/gadget/udc/dummy_hcd.ko] undefined!
WARNING: "usb_del_gadget_udc" [drivers/usb/gadget/udc/dummy_hcd.ko] undefined!
WARNING: "usb_gadget_deactivate" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_ep_queue" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_unregister_driver" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_ep_alloc_request" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_set_state" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_activate" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_ep_dequeue" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_vbus_draw" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_set_selfpowered" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_ep_free_request" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_ep_match_desc" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_gadget_probe_driver" [drivers/usb/gadget/libcomposite.ko] undefined!
WARNING: "usb_ep_disable" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_enable" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_queue" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_set_wedge" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_set_halt" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_alloc_request" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_clear_halt" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_dequeue" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_free_request" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
WARNING: "usb_ep_fifo_flush" [drivers/usb/gadget/function/usb_f_mass_storage.ko] undefined!
Then, when I try to modprobe `dummy_hcd`, I get this:

Code: Select all

modprobe: ERROR: could not insert 'dummy_hcd': Unknown symbol in module, or unknown parameter (see dmesg)
Here is the relevant part of dmesg:

Code: Select all

[ 2045.685249] dummy_hcd: Unknown symbol usb_ep_set_maxpacket_limit (err 0)
[ 2045.685258] dummy_hcd: Unknown symbol usb_add_gadget_udc (err 0)
[ 2045.685276] dummy_hcd: Unknown symbol usb_gadget_udc_reset (err 0)
[ 2045.685287] dummy_hcd: Unknown symbol usb_gadget_giveback_request (err 0)
[ 2045.685292] dummy_hcd: Unknown symbol usb_del_gadget_udc (err 0)

danialbehzadi
Posts: 4
Joined: 2020/08/23 06:40:09

Re: module configed, but not compiled with rpmbuild

Post by danialbehzadi » 2020/09/20 13:25:30

Just found some mistakes in CentOS wiki whcih lead to this issue.

At the end of I need the Kernel Source, before `rpmbuild -bp --target=$(uname -m) kernel.spec`, we need to modify the kernel specification file as told in ection 4 of `Custom Kernel`.

In last part of `Custom Kernel` section 2, we shouldn't copy the entire contents of the `configs/` directory to the `~/rpmbuild/SOURCES/`, but only copy our `.config` file to the corresponding file in `~/rpmbuild/SOURCES/`, since otherwise the `generate_all_configs.sh` script will make duplicates of the config files with an extra version number in file name, e.g. `kernel-4.18.0-4.18.0-x86_64.config`

Post Reply

Return to “CentOS 8 - General Support”