upp
upp copied to clipboard
Add option to read param=value pairs from configuration file and add systemd unit to apply configuration at boot
This PR includes the following changes:
- Add
upp set -c/--from-conf <file>
that reads a configuration file withparam=value
pairs in each line and applies just asupp set
does. An example configuration file could have:
/smc_pptable/FanAcousticLimitRpm=2550
/smc_pptable/FanTargetTemperature=70
-
Replace all
return 2
byexit(2)
to properly signalize parent process with INVALID ARGUMENT return code -
Add a systemd unit to apply pp configurations at boot. This unit is called
[email protected]
and should be copied to/etc/systemd/system/[email protected]
by users or to/usr/lib/systemd/system/[email protected]
by package maintainers. This unit should be started (to apply once) or enabled (to apply at boot) with a card instance (as in/sys/class/drm/<card>
), e.g.systemctl enable [email protected]
. This unit will read the configuration file in/etc/upliftpowerplay/<card>.conf
and set the desired parameters. -
Note that the systemd unit sets the DPM to
profile_peak
before applying upp to avoid the graphics driver crashing due to SMU in sleep mode (see #32 and #37). After applying, it restores to "auto," so users must consider whether a different DPM configuration is applied before the unit is invoked at boot (e.g. in a udev rule).