Request for system-files interfaces (read governor override file) for auto-cpufreq

Hello,

With recent PR auto-cpufreq has ability to override governor. I also made snapcraft.yaml changes which allow me to read contents of this file with snap.

plugs:
   etc-auto-cpufreq-conf:
    interface: system-files
    write:
    - /etc/auto-cpufreq.conf
   opt-auto-cpufreq:
    interface: system-files
    write:
    - /opt/auto-cpufreq/override.pickle

In a nutshell if user uses i.e: --force=performance flag governor state will be stored in this file.

Could you please allow “opt-auto-cpufreq” interface for auto-cpufreq so I make a new release and publish this updated version to Snap store?

Thank you,

Adnan

+1 from me for this as this snap is the clear owner of that path - although I wonder if perhaps auto-cpufreq could be changed to automatically prefix these paths with the $SNAP_COMMON prefix if that environment variable is defined - as snaps can store whatever data they want under $SNAP_COMMON, ie something like the following could work:

STORE = os.getenv("SNAP_COMMON", "") + "/opt/auto-cpufreq/venv/override.pickle"

Thanks @alexmurray!

But in meantime I found another way to write this override.pickle file directly as part of snap container.

if os.getenv("PKG_MARKER") == "SNAP":
    governor_override_state = Path("/var/snap/auto-cpufreq/current/override.pickle")
else:
    governor_override_state = Path("/opt/auto-cpufreq/override.pickle")

Since I do the same thing with --stats flag (file).

This way I don’t even need any additional permissions/plugs, hence unless you have some other ideas, please feel free to close this request.

Thank you and everybody else regardless!

Excellent - thanks, I will remove this request from our queue.