
src/gz pandora http://www.qzxx.com/pogoplug 小熊源 做个标记
/usr/lib/lua/luci/view/admin_status/index.htm
<fieldset class="cbi-section">
<legend><%:System%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Router Name%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Router Model%></td><td>DIY router by Sxx1314</td></tr>
<tr><td width="33%"><%:Cpu Model%></td><td>MARVELL 88F6560 (ARM926EJ-S)</td></tr>
<tr><td width="33%"><%:Cpu Clock%></td><td>1.6*2 GHz</td></tr>
<tr><td width="33%"><%:CPU Info%></td><td><%:Core%><a>:</a>2/ <%:Thread%><a>:</a>2</td></tr>
<tr><td width="33%"><%:Flash Size%></td><td>2048 MB</td></tr>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(luci.version.distname)%> <%=pcdata(luci.version.distversion)%> /
<%=pcdata(luci.version.luciname)%> (<%=pcdata(luci.version.luciversion)%>)
</td></tr>
<tr><td width="33%"><%:Kernel Version%></td><td><%=luci.sys.exec("uname -r")%></td></tr>
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
<tr><td width="33%"><%:Update%></td><td ><input type="button" class="cbi-button cbi-button-apply" name="Update_Address" value="<%:Update Address%>" onclick="window.open('http://www.right.com.cn/forum/thread-102073-1-1.html')" /></td></tr>
<tr><td width="33%"><%:donate%></td><td ><input type="button" class="cbi-button cbi-button-apply" name="donate" value="<%:Friendship Donation%>" onclick="window.open('http://'+window.location.host+'/jz.png')" /></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:System%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Router Name%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Router Model%></td><td><%=pcdata(system or "?")%></td></tr>
<tr><td width="33%"><%:Cpu Model%></td><td><%=pcdata(model or "?")%></td></tr>
<tr><td width="33%"><%:Cpu Clock%></td><td><%=pcdata(cpuclock or "?")%> MHz</td></tr>
<tr><td width="33%"><%:Flash Size%></td><td><%=pcdata(flashsize or "?")%> MB</td></tr>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(luci.version.distname)%> <%=pcdata(luci.version.distversion)%> /
<%=pcdata(luci.version.luciname)%> (<%=pcdata(luci.version.luciversion)%>)
</td></tr>
<tr><td width="33%"><%:Kernel Version%></td><td><%=luci.sys.exec("uname -r")%></td></tr>
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
<tr><td width="33%"><%:Update%></td><td ><input type="button" class="cbi-button cbi-button-apply" name="Update_Address" value="<%:Update Address%>" onclick="window.open('http://www.right.com.cn/forum/thread-102073-1-1.html')" /></td></tr>
<tr><td width="33%"><%:donate%></td><td ><input type="button" class="cbi-button cbi-button-apply" name="donate" value="<%:Friendship Donation%>" onclick="window.open('http://'+window.location.host+'/jz.png')" /></td></tr>
</table>
</fieldset>
修改 /usr/lib/lua/luci/view/themes/openwrt.org/header.htm (ssh上去vi 还是改好上传,看个人喜好了,记得改之前备份一下)
local hostname = sys.hostname()
local load1, load5, load15 = sys.loadavg()
local sys1, sys2, sys3, sys4, sys5, sys6, sys7 = sys.sysinfo()
<div class="hostinfo">
<%=hostname%> | <%=luci.version.distversion%> |
<%:Load%>: <%="%.2f" % load1%> <%="%.2f" % load5%> <%="%.2f" % load15%> |
<%:Processor%>: <%=sys1%> | <%:Memory%>: <%=sys3%> KB
这个只是修改 openwrt主题下 标题框的显示
<tr><td width="33%"><%:CPU Model%></td><td><%=pcdata(system or "?")%></td></tr>
<tr><td width="33%"><%:Cpu Clock%></td><td><%=print (luci.sys.exec("sed -n '1p' /tmp/log/inform"))%>MHz</td></tr>
<tr><td width="33%"><%:RAM Clock%></td><td><%=print (luci.sys.exec("sed -n '2p' /tmp/log/inform"))%>MHz</td></tr>
<tr><td width="33%"><%:Flash Size%></td><td><%=print (luci.sys.exec("sed -n '3p' /tmp/log/inform"))%>MB</td></tr>
\etc\init.d\boot
最下面倒数第二行(两个括号中间)先空一行 再添加:
/bin/inform
# create /dev/root if it doesn't exist
[ -e /dev/root -o -h /dev/root ] || {
rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline)
[ -n "$rootdev" ] && ln -s "$rootdev" /dev/root
}
3. inform 放到\bin下面 打上权限0755
#!/bin/sh
dmesg >/tmp/log/mesg && rm /tmp/log/inform
a1=`cat /proc/cpuinfo|grep -i -E 'cpu.*clock'|awk -F: '{print $2/1}'`
a2=`grep Clock /tmp/log/mesg|sed 's/^.*CPU//g'|sed 's/DDR.*//g'|awk -F'[:M]' '{print $2/1}'`
if [ ! $a1 > '0' ]; then
if [ ! $a2 > '0' ]; then
echo unknown >> /tmp/log/inform
else
echo $a2 >> /tmp/log/inform
fi
else
echo $a1 >> /tmp/log/inform
fi
b1=`grep 'DDR:' /tmp/log/mesg|sed 's/^.*DDR//g'|sed 's/AHB.*//g'|awk -F '[:.]' '{print $2/1}'`
b2=`grep memory.*@ /tmp/log/mesg|awk -F '[:@]' '{print $2/10000}'`
if [ ! $b1 > '0' ]; then
if [ ! $b2 > '0' ]; then
echo unknown >> /tmp/log/inform
else
echo $b2 >> /tmp/log/inform
fi
else
echo $b1 >> /tmp/log/inform
fi
c1=`cat /proc/cpuinfo |grep -i Flash /proc/cpuinfo | awk '{print $3/1}'`
c2=`grep -i Kbyte /tmp/log/mesg|cut -d '(' -f2|awk '{print $1/1024}'`
if [ ! $c1 > '0' ]; then
if [ ! $c2 > '0' ]; then
echo unknown >> /tmp/log/inform
else
echo $c2 >> /tmp/log/inform
fi
else
echo $c1 >> /tmp/log/inform
fi
rm /tmp/log/mesg && cat /tmp/log/inform
可以改第一部的代码比如:CPU Model 改成CPU 型号 Cpu Clock改成CPU频率)
重启动
CC版 CPU型号显示不正常
把这句<tr><td width="33%"><%:CPU Model%></td><td><%=pcdata(system or "?")%></td></tr>
改成:<tr><td width="33%"><%:CPU Model%></td><td><%=pcdata(boardinfo.system or boardinfo.system or "?")%></td></tr>


相关文章本文地址:https://blog.sxx1314.com/openwrt/156.html
版权声明:若无注明,本文皆为“unix 软硬件 技术宅 ”原创,转载请保留文章出处。百度已收录















