sysfs entry is not created for the module parameter of loadable kernel module

Hi,
I'm using the kernel image from Linus mainline and the rootfs generated from the buildroot. Also, I have added my module in the "buildroot/package/mymodule".
In the source file of "mymodule", have added the module parameter as mentioned below :
module_param(m_Argument, int, S_IRUSR | S_IWUSR);

This module parameter is not created in the sysfs.
But I'm able to load the module with the argument but I would like to see the entry in sysfs as well.

Can anyone please check this and let me know the suggestion ?

Build steps are as below :

  • Built the rootfs from buildroot
  • Added "mymodule" and then again built the rootfs (this time it was incremental build)

Thank you.

Comments

  • I would like to add to the above, just tried even by cleaning "make clean" and built rootfs again. Still the sysfs entry is not created for the module parameter. I can see sysfs mounted.
    I'm able to load the module with argument & remove the module.

  • Sorry for the confusion, sysfs entry got created after the module loading, I was checking before the module load. Please ignore this.

Categories

Upcoming Training