linux-speakup / speakup

Speakup is a screen review package for the Linux operating system
9 stars 1 forks source link

default driver parameters #7

Open sthibaul opened 3 years ago

sthibaul commented 3 years ago

It would be useful to be able to specify the default driver parameters among the module command parameters, so that one can record for instance

options speakup_dectlk rate=200

in /etc/modprobe.d/something.conf

osmten commented 1 year ago

I'm fairly new to kernel development and Speakup seems very interesting and meaningful project for me. Since this is tagged as "good first issue", I would start with this.

Modprobe command seems to take arguments specified in /etc/modprobe.d/something.conf for every kernel module. I think modprobe would do the same for speakup modules as well. This will be done by a user in userspace, writing arguments to a .conf file in /etc/modprobe.d/filename.conf and running modprobe command on a speakup module.

I'm trying to understand the issue, please correct me if I'm wrong. Is this the issue about specifying sane default arguments in the docs so the users can write to /etc/modprobe.d/filename.conf. Any help or elaboration would be appreciated.

Thank you.

sthibaul commented 1 year ago

Hello, Thanks for joining! Support for taking parameters from something.conf is already there indeed, but the parameters don't exist yet. In the speakup_dectlk case, speakup_dectlk.c only supports the ser, dev, and start parameters, see the calls to module_param_named and MODULE_PARM_DESC. It would be useful to introduce the other parameters, to change the compile-time default value already set in the vars array.

sthibaul commented 1 year ago

See for instance https://lore.kernel.org/r/20220829203625.6s6x57miowu4p664@begin In that example we hardcoded DIRECT being the first entry of the vars array. To make it more general, we'd probably want to introduce in each file an enum that provides the index of each variable.

osmten commented 1 year ago

Thank you for detailed answer. I will look into it.

SikkiLadho commented 1 year ago

Hi, There's spk_vars for core speakup module(speakup.ko), should they also be parametrized as module parameters?

sthibaul commented 1 year ago

That would be useful as well, yes

SikkiLadho commented 1 year ago

Moreover, there's a description for these vars in Documentation/ABI/stable/sysfs-driver-speakup. Should we add that description in the MODULE_PARAM_DESC() or just "set x variable on load" will be enough?

sthibaul commented 1 year ago

The description from Documentation would be useful yes.