I wrote a simple init script to modify sysfs files at boot and set the needed values. It reads the files and the values to put in the sysfs files from a config file. It can be useful to set parameters like cpu scaling frequencies, etc. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 60513 [details] Init script
Created attachment 60514 [details] Configuration file
should be trivial to make the config file syntax work like sysctl.conf ... maybe even have the config file install as sysfsctl.conf :)
You mean something like: /sys/<path> = <value> For example: /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 1199970 In this way we should write in the config file the content of all the sysfs tree, or, better, only the files that contain values usable for tuning the system. For example we should exclude /sys/class/*, I think, because modifying those files could cause problems and, in fact, in most cases it is impossible. Or, simply, one can put in the config file only the files he wants to modify. Ok, I'll modify the script to work in this simpler way. What did you mean for "having the config file install as sysfsctl.conf" ?
Created attachment 60583 [details] Configuration file This is the new configuration file. It contains only one array. Each array cell contains an assignment like "<file> = <value>". I think this is a simpler syntax.
Created attachment 60584 [details] Init script The new version of the init script, to read the config file containing only one array
*** Bug 94780 has been marked as a duplicate of this bug. ***
Created attachment 60625 [details, diff] procps-3.2.5-sysfsctl.patch adds support to procps for a 'sysfsctl' binary which acts just like 'sysctl' but uses /etc/sysfsctl.conf instead of /etc/sysctl.conf e-mailed upstream to see how they feel about it
This sounds good! Any idea when it will become available?
vapier: you sent the patch to upstream, what was the outcome?
iirc, upstream responded only to me rather than the mailing lists and just said "it's in the works" ... i.e. he had bigger plans and didnt want to go the route i suggested but i'm guessing nothing materialized