# HG changeset patch # User Christophe Lincoln # Date 1302138758 -7200 # Node ID af4b1f0b31108081951c81a4f3480bb03feb4639 # Parent a7b1d69663c34fb497f0299275dbf8ff98feebf8 hardeare: display kernel module and link to modinfo diff -r a7b1d69663c3 -r af4b1f0b3110 index.cgi --- a/index.cgi Thu Apr 07 01:22:07 2011 +0200 +++ b/index.cgi Thu Apr 07 03:12:38 2011 +0200 @@ -29,6 +29,7 @@ # # Everything until user login # + . /etc/rcS.conf TITLE="- Boot" xhtml_header cat << EOT @@ -43,9 +44,15 @@
 `cat /proc/cmdline`
 
+ +

`gettext "Local startup commands"`

+
+`cat /etc/init.d/local.sh`
+
+ EOT ;; - hardware) + hardware|modinfo=*) # # Hardware drivers, devices, filesystem, screen # @@ -60,9 +67,45 @@ echo '
'
 			fdisk -l | fgrep Disk
 		echo '
' + echo '

Filesystem usage statistics

' echo '
'
 			df -h | grep ^/dev
 		echo '
' + echo '

Loaded kernel modules

' + # We may want modinfi output + + case "$QUERY_STRING" in + modinfo=*) + mod=${QUERY_STRING#modinfo=} + gettext "Detailled information for module:"; echo " $mod" + echo '
'
+				modinfo $mod
+				echo '
' ;; + rmmod=*) + mod=${QUERY_STRING#rmmod=} + modprobe -r $mod ;; + esac + table_start + cat << EOT + + `gettext "Module"` + `gettext "Size"` + `gettext "Used"` + `gettext "by"` + +EOT + # Get the list of modules and link to modinfo + lsmod | grep ^[a-z] | while read line + do + mod=`echo "$line" | awk '{print $1}'` + echo '' + echo "$mod" + echo "$line" | awk '{print "", $2, "", + "", $3, "", "", $4, ""}' + echo '' + done + table_end + echo '

lspci

' echo '
'
 			lspci
 		echo '
'