1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add cpu scale frequency configuration

This commit is contained in:
Ycarus 2018-04-17 09:27:15 +02:00
parent c5916d5454
commit 183bef4a8b
4 changed files with 92 additions and 0 deletions

View file

@ -20,6 +20,40 @@
</div>
</div>
</fieldset>
<% if nixio.fs.access("/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq") then %>
<fieldset class="cbi-section" id="system">
<legend><%:Systems settings%></legend>
<div class="cbi-section-descr"></div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Minimum scaling CPU frequency%></label>
<div class="cbi-value-field">
<input type="text" name="scaling_min_freq" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("echo /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq")):match("%d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Maximum scaling CPU frequency%></label>
<div class="cbi-value-field">
<input type="text" name="scaling_max_freq" class="cbi-input-text" value="<%=tonumber((luci.sys.exec("echo /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq")):match("%d+"))%>">
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Scaling governor%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" name="scaling_governor">
<%
governor=luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor")
available_governors=luci.sys.exec("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors")
for gov in string.gmatch(available_governors, "[^%s]+") do
%>
<option value="<%=gov%>" <% if governor == gov then %>selected="selected"<% end %>>
<%
end
%>
</select>
</div>
</div>
</fieldset>
<% end %>
</div>
<div class="cbi-page-actions">
<input type="hidden" name="token" value="<%=token%>" />