how to read a text config file in the Kernel?
can sys_call do it???
thank you.
Printable View
how to read a text config file in the Kernel?
can sys_call do it???
thank you.
You can create a script that reads the config file, and modprobes/insmods your module with the appropriate parameters.
I am not quite sure what you mean.....Quote:
Originally Posted by lakerdonald
I know write a script to read the config, and insert it.
but the problem is how?
thank you.
Make all the options module_params in your code, then read the values from the config file and pass them as key=value pairs to insmod:
Would be read by the script and pass to insmod:Code:#foo.conf
number_of_devs=4
priority=2
god="lakerdonald"
for example.Code:insmod /foo/bar.ko number_of_devs=4 priority=2 god="lakerdonald"
thank you...
sorry I didn't put my question clearly, so it is not really I am looking for, let me rephrase the question.
I want to read a config file in the kernel, and try to parse it...
I am trying to read a set of rules from a text file, and there are many of them.
How can I do it??
After I have read in, how do I parse it? is there anything that similar to "fgets" that I can call in the kernel???
Thank you