Solved Sysctl variables location

Hi
I am trying to configure my laptop's touchpad "elantech". I want to completely disable vertical scrolls and two-finger scrolls. In this context, I have put following line in /boot/loader.conf:
Code:
hw.psm.synaptics_support="1"
and following lines in /etc/sysctl.conf
Code:
hw.psm.synaptics.max_pressure="220"
hw.psm.synaptics.min_pressure="80"
hw.psm.synaptics.max_width="7"
I did not put any line mentioning "elantech" in any of these files, but when I issue following command:
Code:
sysctl -a |grep elantech
It shows many loaded values, for example:
Code:
hw.psm.elantech.natural_scroll: 0
hw.psm.elantech.three_finger_drag: 0
hw.psm.elantech.touchpad_off: 0
hw.psm.elantech.vscroll_div_max: 50
hw.psm.elantech.vscroll_div_min: 30
hw.psm.elantech.vscroll_min_delta: 15
hw.psm.elantech.vscroll_ver_area: 0
hw.psm.elantech.vscroll_hor_area: 0
......................
So the question arises that from where "sysctl" is picking these values and how can I tune them?
Regards
 
Those are probably the default values. They aren't picked from anywhere. The default values are set by the kernel (in this case by the respective driver).

If they're so-called “loader tunables”, they can be set via /boot/loader.conf. Otherwise, if they're normal sysctl variables, they can be set via /etc/sysctl.conf (both of these files have manual pages, so please refer to loader.conf(5) or sysctl.conf(5) for details), and of course you can change them on the command line with the sysctl(8) command, unless they're read-only.

PS: Loader tunables and sysctl variables are usually documented in the manual page of the respective driver. In this case, I think, it is the psm(4) driver.
 
Is there any way to confirm that whether they are kernel-tunables or sysctl-variables?
The easiest way is to try. The sysctl(8) command will print an error message when you try to change a value that is only a loader tunable. Also, it should be documented in the manual page of the respective driver. I think that's psm(4) in this case.

If everything else fails, you can always look at the source code, provided that you're a little bit familiar with programming. This is one of the big advantages of open-source software: There is always the source code to use as a “last resort documentation”. ;)
 
Is there any way to confirm that whether they are kernel-tunables or sysctl-variables?

Yes, it is a flag question, you could install sysutils/nsysctl (>= 1.1) [1]:

% nsysctl -aNG | grep elantech

you can read the comments of sys/sysctl.h for a description of the flags (if you like a GUI: deskutils/sysctlview [2] has a window for the flags and Help->Flags for a description)

[1] nsysctl tutorial
[2] sysctlview screenshots
 
Back
Top