tazpanel rev 43
hardeare: display kernel module and link to modinfo
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Apr 07 03:12:38 2011 +0200 (2011-04-07) |
parents | a7b1d69663c3 |
children | 13b1019d68d8 |
files | index.cgi |
line diff
1.1 --- a/index.cgi Thu Apr 07 01:22:07 2011 +0200 1.2 +++ b/index.cgi Thu Apr 07 03:12:38 2011 +0200 1.3 @@ -29,6 +29,7 @@ 1.4 # 1.5 # Everything until user login 1.6 # 1.7 + . /etc/rcS.conf 1.8 TITLE="- Boot" 1.9 xhtml_header 1.10 cat << EOT 1.11 @@ -43,9 +44,15 @@ 1.12 <pre> 1.13 `cat /proc/cmdline` 1.14 </pre> 1.15 + 1.16 +<h3>`gettext "Local startup commands"`</h3> 1.17 +<pre> 1.18 +`cat /etc/init.d/local.sh` 1.19 +</pre> 1.20 + 1.21 EOT 1.22 ;; 1.23 - hardware) 1.24 + hardware|modinfo=*) 1.25 # 1.26 # Hardware drivers, devices, filesystem, screen 1.27 # 1.28 @@ -60,9 +67,45 @@ 1.29 echo '<pre>' 1.30 fdisk -l | fgrep Disk 1.31 echo '</pre>' 1.32 + echo '<h3>Filesystem usage statistics</h3>' 1.33 echo '<pre>' 1.34 df -h | grep ^/dev 1.35 echo '</pre>' 1.36 + echo '<h3>Loaded kernel modules</h3>' 1.37 + # We may want modinfi output 1.38 + 1.39 + case "$QUERY_STRING" in 1.40 + modinfo=*) 1.41 + mod=${QUERY_STRING#modinfo=} 1.42 + gettext "Detailled information for module:"; echo " $mod" 1.43 + echo '<pre>' 1.44 + modinfo $mod 1.45 + echo '</pre>' ;; 1.46 + rmmod=*) 1.47 + mod=${QUERY_STRING#rmmod=} 1.48 + modprobe -r $mod ;; 1.49 + esac 1.50 + table_start 1.51 + cat << EOT 1.52 +<tr class="thead"> 1.53 + <td>`gettext "Module"`</td> 1.54 + <td>`gettext "Size"`</td> 1.55 + <td>`gettext "Used"`</td> 1.56 + <td>`gettext "by"`</td> 1.57 +</tr> 1.58 +EOT 1.59 + # Get the list of modules and link to modinfo 1.60 + lsmod | grep ^[a-z] | while read line 1.61 + do 1.62 + mod=`echo "$line" | awk '{print $1}'` 1.63 + echo '<tr>' 1.64 + echo "<td><a href='$SCRIPT_NAME?modinfo=$mod'>$mod</a></td>" 1.65 + echo "$line" | awk '{print "<td>", $2, "</td>", 1.66 + "<td>", $3, "</td>", "<td>", $4, "</td>"}' 1.67 + echo '</tr>' 1.68 + done 1.69 + table_end 1.70 + echo '<h3>lspci</h3>' 1.71 echo '<pre>' 1.72 lspci 1.73 echo '</pre>'