I have some custom hardware that uses a kernel module called foo.ko
. This has to be insmod
from the Linux kernel.
Is there is a way to pass a parameter to the kernel module during insmod, something like:
insmod foo.ko <parameter>
?
Name the parameters like this:
insmod foo.ko mystring="bebop" mybyte=255
From Passing Command Line Arguments to a Module : The Linux Kernel Module Programming Guide
You can set any needed parameters at load time this way:
insmod param_name=param_value
and set it in your source code this way:
module_param(param_name, param_type, permission);
param types supported:
int -> integer value
charp -> character pointer
....
Permission is a mask like S_IRUGO
, you may need to check moduleparam.h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With