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