lm_sensors package requires echo supressed newline
Two scripts in this package 'fancontrol' and 'pwmconfig' both fail to operate correctly on a base Alpine standard install. 'pwmconfig' fails to set PWM fans to manual mode, and 'fancontrol' fails to enable PWM. This is not due to a hardware limitation, as I am able to control the fans manually by writing to the appropriate /sys/ file.
I have traced the issue to the use of
echo within the scripts. In various places each script echos values to /sys/ files. This results in (for example):
./pwmconfig: line 232: echo: write error: Invalid argument
This issue appears in multiple places in both scripts.
It appears that the scripts assumes that
echo supressess trailing newlines by default - a behaviour that doesn't seem to be true using default Alpine coreutils.
This can be resolved by replacing instances of
echo -n. See my fixed fancontrol script diff. I think the aports package could include a patch to fix this seemingly Alpine-specific issue.