mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-04-08 17:05:56 +02:00
code improvements for snap to work in strict confinement
This commit is contained in:
parent
d8e0f3fc6e
commit
232450f936
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION='20'
|
||||
cpucount=`nproc`
|
||||
cpucount=`cat /proc/cpuinfo|grep processor|wc -l`
|
||||
FLROOT=/sys/devices/system/cpu
|
||||
DRIVER=auto
|
||||
VERBOSE=0
|
||||
|
@ -26,17 +26,23 @@ parts:
|
||||
apps:
|
||||
auto-cpufreq:
|
||||
command: bin/auto-cpufreq
|
||||
environment:
|
||||
LC_ALL: C.UTF-8
|
||||
LANG: C.UTF-8
|
||||
PKG_MARKER: SNAP
|
||||
plugs:
|
||||
- cpu-control
|
||||
- system-observe
|
||||
- hardware-observe
|
||||
- system-files
|
||||
environment:
|
||||
LC_ALL: C.UTF-8
|
||||
LANG: C.UTF-8
|
||||
PKG_MARKER: SNAP
|
||||
|
||||
service:
|
||||
command: bin/auto-cpufreq --daemon 2>&1 | tee -a /var/log/auto-cpufreq.log
|
||||
plugs:
|
||||
- cpu-control
|
||||
- system-observe
|
||||
- hardware-observe
|
||||
- system-files
|
||||
environment:
|
||||
LC_ALL: C.UTF-8
|
||||
LANG: C.UTF-8
|
||||
|
@ -321,7 +321,7 @@ def sysinfo():
|
||||
|
||||
# get distro information in snap env.
|
||||
if os.getenv("PKG_MARKER") == "SNAP":
|
||||
searchfile = open("/usr/lib/os-release", "r")
|
||||
searchfile = open("/var/lib/snapd/hostfs/etc/os-release", "r")
|
||||
for line in searchfile:
|
||||
if line.startswith('NAME='):
|
||||
distro = line[5:line.find('$')].strip("\"")
|
||||
|
Loading…
x
Reference in New Issue
Block a user