using sysctl.conf for module that initialize in early bootup

Greg KH greg at kroah.com
Fri Aug 5 06:28:56 EDT 2016


On Fri, Aug 05, 2016 at 02:52:01PM +0530, Pankaj Gupta wrote:
> Dear All,
> 
> I am trying to introduce a flag which controls probe of a driver that
> initialize in device_initcall(). I want to use a flag, if the flag is true
> driver will be initialed and if its false then probe will return without
> registering the driver. The value of flag can be changed at runtime and that
> should persist after reboot.

"persist after reboot"?  Why do you want that?  kernel drivers can't
write to any filesystems, you should control the kernel from userspace.
Only load your driver if you "know" you want to load it and have it
control the hardware, no need to do anything strange in the kernel for
something like this at all.

good luck!

greg k-h



More information about the Kernelnewbies mailing list