Skip to content

Commit 389d8a6

Browse files
committed
noma.py: Add turbo
1 parent 98678bf commit 389d8a6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

noma/noma.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
noma (info|start|stop|restart|logs|check|status)
66
noma (temp|swap|ram)
77
noma (freq|memory|voltage) [<device>]
8+
noma turbo
89
noma usb-setup
910
noma install-box
1011
noma create-swap
@@ -205,8 +206,15 @@ def node(args):
205206
elif args["freq"]:
206207
node.freq(args["<device>"])
207208

208-
elif args["memory"]:
209-
print(node.memory(args["<device>"]))
209+
elif args['turbo']:
210+
print("Set CPU scaling")
211+
from subprocess import DEVNULL
212+
for cpu_num in range(0, 4):
213+
device_path = "/sys/devices/system/cpu/cpu{n}/cpufreq/scaling_governor".format(n=cpu_num)
214+
call(["echo", "ondemand > {p} ".format(p=device_path)], shell=True, stdout=DEVNULL, stderr=DEVNULL)
215+
216+
elif args['memory']:
217+
print(node.memory(args['<device>']))
210218

211219
elif args["backup"]:
212220
node.backup()

0 commit comments

Comments
 (0)