slitaz-arm rev 87

Improve CGI admin and rename 2 plugins
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 01 23:09:04 2014 +0200 (2014-04-01)
parents ad712df5e748
children ba52d096f50f
files cgi-adm/data/header.html cgi-adm/plugins/config/config.cgi cgi-adm/plugins/config/config.conf cgi-adm/plugins/status/status.cgi cgi-adm/plugins/status/status.conf rpi/cgi-adm/data/header.html rpi/cgi-adm/plugins/rpi_boot/rpi_boot.cgi rpi/cgi-adm/plugins/rpi_boot/rpi_boot.conf rpi/cgi-adm/plugins/rpi_config/rpi_config.cgi rpi/cgi-adm/plugins/rpi_config/rpi_config.conf rpi/rootfs/boot/config.txt
line diff
     1.1 --- a/cgi-adm/data/header.html	Tue Apr 01 16:34:16 2014 +0200
     1.2 +++ b/cgi-adm/data/header.html	Tue Apr 01 23:09:04 2014 +0200
     1.3 @@ -13,7 +13,7 @@
     1.4  	<nav id="nav">
     1.5  		<a href="tools.cgi">System</a>
     1.6  		<a href="tools.cgi?plugins">Plugins</a>
     1.7 -		<a href="tools.cgi?config">Config</a>
     1.8 +		<a href="tools.cgi?status">Status</a>
     1.9  	</nav>
    1.10  </header>
    1.11  
     2.1 --- a/cgi-adm/plugins/config/config.cgi	Tue Apr 01 16:34:16 2014 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,35 +0,0 @@
     2.4 -#!/bin/sh
     2.5 -#
     2.6 -# SliTaz ARM CGI Plugin - System configs and options
     2.7 -#
     2.8 -
     2.9 -case " $(GET) " in
    2.10 -	
    2.11 -	*\ rdate\ *)
    2.12 -		html_header "System time"
    2.13 -		echo "<h1>System time</h1>"
    2.14 -		echo "<pre>"
    2.15 -		echo -n "Old date:"; date
    2.16 -		rdate -s tick.greyware.com
    2.17 -		echo -n "New date:"; date 
    2.18 -		echo "</pre>" 
    2.19 -		html_footer && exit 0 ;;
    2.20 -	
    2.21 -	*\ config\ *)
    2.22 -		html_header "Configuration"
    2.23 -		cat << EOT
    2.24 -<h1>System Config</h1>
    2.25 -
    2.26 -<p>
    2.27 -	Remotely configure your SliTaz ARM device.
    2.28 -</p>
    2.29 -
    2.30 -<div id="actions">
    2.31 -	<form method="get" action="$script">
    2.32 -		<input type="submit" name="rdate" value="Set system time" />
    2.33 -	</form>
    2.34 -</div>
    2.35 -
    2.36 -EOT
    2.37 -		html_footer && exit 0
    2.38 -esac
     3.1 --- a/cgi-adm/plugins/config/config.conf	Tue Apr 01 16:34:16 2014 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,6 +0,0 @@
     3.4 -# TazBerry CGI Plugin configuration
     3.5 -
     3.6 -PLUGIN="System configuration"
     3.7 -SHORT_DESC="SliTaz ARM system configuration"
     3.8 -MAINTAINER="pankso@slitaz.org"
     3.9 -WEB_SITE="http://arm.slitaz.org/"
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/cgi-adm/plugins/status/status.cgi	Tue Apr 01 23:09:04 2014 +0200
     4.3 @@ -0,0 +1,51 @@
     4.4 +#!/bin/sh
     4.5 +#
     4.6 +# SliTaz ARM CGI Plugin - System configs and options
     4.7 +#
     4.8 +
     4.9 +if [ "$(GET status)" ]; then
    4.10 +	html_header "Status"
    4.11 +	cat << EOT
    4.12 +<h1>System Status</h1>
    4.13 +<p>
    4.14 +	Uptime: $(uptime)
    4.15 +</p>
    4.16 +
    4.17 +<h2>Disk usage</h2>
    4.18 +<pre>
    4.19 +Filesystem                Size      Used Available Use% Mounted on
    4.20 +--------------------------------------------------------------------------------
    4.21 +$(df -h | grep ^/dev)
    4.22 +</pre>
    4.23 +
    4.24 +<h2>Memory usage</h2>
    4.25 +<pre>
    4.26 +Type         total         used         free       shared      buffers
    4.27 +--------------------------------------------------------------------------------
    4.28 +$(free -m | sed "/total/d")
    4.29 +</pre>
    4.30 +
    4.31 +<h2>Routing table</h2>
    4.32 +<pre>
    4.33 +Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    4.34 +--------------------------------------------------------------------------------
    4.35 +$(route | grep [0-9])
    4.36 +</pre>
    4.37 +
    4.38 +<h2>Kernel messages</h2>
    4.39 +<pre>
    4.40 +Last dmesg output
    4.41 +--------------------------------------------------------------------------------
    4.42 +$(dmesg | tail -n 15)
    4.43 +</pre>
    4.44 +
    4.45 +<h2>Kernel modules</h2>
    4.46 +<pre>
    4.47 +Module                  Size  Used by    Tainted: G
    4.48 +--------------------------------------------------------------------------------
    4.49 +$(lsmod | sed "/^Module/d")
    4.50 +</pre>
    4.51 +
    4.52 +EOT
    4.53 +	html_footer && exit 0
    4.54 +fi
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/cgi-adm/plugins/status/status.conf	Tue Apr 01 23:09:04 2014 +0200
     5.3 @@ -0,0 +1,6 @@
     5.4 +# TazBerry CGI Plugin configuration
     5.5 +
     5.6 +PLUGIN="System status"
     5.7 +SHORT_DESC="SliTaz ARM system status"
     5.8 +MAINTAINER="pankso@slitaz.org"
     5.9 +WEB_SITE="http://arm.slitaz.org/"
     6.1 --- a/rpi/cgi-adm/data/header.html	Tue Apr 01 16:34:16 2014 +0200
     6.2 +++ b/rpi/cgi-adm/data/header.html	Tue Apr 01 23:09:04 2014 +0200
     6.3 @@ -5,15 +5,15 @@
     6.4  	<title>TazBerry - _TITLE_</title>
     6.5  	<link rel="stylesheet" type="text/css" href="data/style.css" />
     6.6  </head>
     6.7 -<body>
     6.8 +<body bgcolor="#ffffff">
     6.9  
    6.10  <header>
    6.11  	<div id="logo"></div>
    6.12  	<nav id="nav">
    6.13  		<a href="tools.cgi">TazBerry</a>
    6.14  		<a href="tools.cgi?plugins">Plugins</a>
    6.15 -		<a href="tools.cgi?config">Config</a>
    6.16 -		<a href="tools.cgi?rpi_boot">Boot</a>
    6.17 +		<a href="tools.cgi?status">Status</a>
    6.18 +		<a href="tools.cgi?rpi_config">Config</a>
    6.19  	</nav>
    6.20  </header>
    6.21  
     7.1 --- a/rpi/cgi-adm/plugins/rpi_boot/rpi_boot.cgi	Tue Apr 01 16:34:16 2014 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,30 +0,0 @@
     7.4 -#!/bin/sh
     7.5 -#
     7.6 -# TazBerry CGI Plugin - Boot configs and options
     7.7 -#
     7.8 -
     7.9 -if [ "$(GET rpi_boot)" ]; then
    7.10 -	html_header "Boot"
    7.11 -	echo "<h1>SliTaz Raspberry Pi Boot</h1>"
    7.12 -	
    7.13 -	cat << EOT
    7.14 -<p>
    7.15 -	The Raspberry Pi uses 2 config files to boot: cmdline.txt, config.txt
    7.16 -</p>
    7.17 -
    7.18 -<pre>
    7.19 -
    7.20 -Kernel boot parameters [ <a href="$script?editor&amp;file=/boot/cmdline.txt">Edit</a> ]
    7.21 ---------------------------------------------------------------------------------
    7.22 -$(cat /boot/cmdline.txt 2>/dev/null)
    7.23 -
    7.24 -
    7.25 -RPi configuration file [ <a href="$script?editor&amp;file=/boot/config.txt">Edit</a> ]
    7.26 ---------------------------------------------------------------------------------
    7.27 -$(cat /boot/config.txt 2>/dev/null)
    7.28 -
    7.29 -EOT
    7.30 -	
    7.31 -	html_footer
    7.32 -	exit 0
    7.33 -fi
     8.1 --- a/rpi/cgi-adm/plugins/rpi_boot/rpi_boot.conf	Tue Apr 01 16:34:16 2014 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,6 +0,0 @@
     8.4 -# TazBerry CGI Plugin configuration
     8.5 -
     8.6 -PLUGIN="RPi Boot"
     8.7 -SHORT_DESC="Raspberry Pi boot time configs"
     8.8 -MAINTAINER="pankso@slitaz.org"
     8.9 -WEB_SITE="http://arm.slitaz.org/rpi/"
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/rpi/cgi-adm/plugins/rpi_config/rpi_config.cgi	Tue Apr 01 23:09:04 2014 +0200
     9.3 @@ -0,0 +1,75 @@
     9.4 +#!/bin/sh
     9.5 +#
     9.6 +# TazBerry CGI Plugin - Boot configs and options
     9.7 +#
     9.8 +
     9.9 +case " $(GET) " in
    9.10 +
    9.11 +	*\ rdate\ *)
    9.12 +		html_header "System time"
    9.13 +		echo "<h1>System time</h1>"
    9.14 +		echo "<pre>"
    9.15 +		echo -n "Old date:"; date
    9.16 +		rdate -s tick.greyware.com
    9.17 +		echo -n "New date:"; date 
    9.18 +		echo "</pre>" 
    9.19 +		html_footer && exit 0 ;;
    9.20 +	
    9.21 +	*\ oclock\ *)
    9.22 +		html_header "Overclocking"
    9.23 +		cat << EOT
    9.24 +<h1>RPi Overclocking</h1>
    9.25 +
    9.26 +<pre>
    9.27 +$(/home/pankso/Projects/slitaz-arm/rpi/tazberry rpi_oclock)
    9.28 +</pre>
    9.29 +
    9.30 +<h2>Current settings:</h2>
    9.31 +<pre>
    9.32 +$(fgrep _freq /boot/config.txt)
    9.33 +$(fgrep over_voltage /boot/config.txt)
    9.34 +</pre>
    9.35 +
    9.36 +<a href='$script?editor&amp;file=/boot/config.txt'>Edit boot configuration</a>
    9.37 +EOT
    9.38 +		html_footer && exit 0 ;;
    9.39 +	
    9.40 +	*\ rpi_config\ *)
    9.41 +		html_header "Raspberry Pi"
    9.42 +		echo "<h1>SliTaz Raspberry Pi</h1>"
    9.43 +	
    9.44 +		cat << EOT
    9.45 +
    9.46 +<p>
    9.47 +	Remotely configure your SliTaz Raspberry Pi device.
    9.48 +</p>
    9.49 +
    9.50 +<div id="actions">
    9.51 +	<form method="get" action="$script">
    9.52 +		<input type="submit" name="rdate" value="Set system time" />
    9.53 +		<input type="submit" name="oclock" value="Overclocking" />
    9.54 +	</form>
    9.55 +</div>
    9.56 +
    9.57 +<h2>Kernel boot parameters</h2>
    9.58 +<p>
    9.59 +	File path: /boot/cmdline.txt 
    9.60 +	[ <a href="$script?editor&amp;file=/boot/cmdline.txt">Edit</a> ]
    9.61 +</p>
    9.62 +<pre>
    9.63 +$(cat /boot/cmdline.txt 2>/dev/null)
    9.64 +</pre>
    9.65 +
    9.66 +<h2>Boot configuration file</h2>
    9.67 +<p>
    9.68 +	File path: /boot/config.txt 
    9.69 +	[ <a href="$script?editor&amp;file=/boot/config.txt">Edit</a> ]
    9.70 +</p>
    9.71 +<pre>
    9.72 +$(cat /boot/config.txt 2>/dev/null)
    9.73 +</pre>
    9.74 +
    9.75 +EOT
    9.76 +	
    9.77 +		html_footer && exit 0 ;;
    9.78 +esac
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/rpi/cgi-adm/plugins/rpi_config/rpi_config.conf	Tue Apr 01 23:09:04 2014 +0200
    10.3 @@ -0,0 +1,6 @@
    10.4 +# TazBerry CGI Plugin configuration
    10.5 +
    10.6 +PLUGIN="Raspberry Pi config"
    10.7 +SHORT_DESC="Raspberry Pi hardware/boot configuration"
    10.8 +MAINTAINER="pankso@slitaz.org"
    10.9 +WEB_SITE="http://arm.slitaz.org/rpi/"
    11.1 --- a/rpi/rootfs/boot/config.txt	Tue Apr 01 16:34:16 2014 +0200
    11.2 +++ b/rpi/rootfs/boot/config.txt	Tue Apr 01 23:09:04 2014 +0200
    11.3 @@ -1,1 +1,24 @@
    11.4 +# /boot/config.txt: SliTaz Raspberry Pi boot configuration
    11.5 +#
    11.6 +
    11.7 +# Linux kernel image
    11.8  kernel=kernel.img
    11.9 +
   11.10 +# Overclocking Settings
   11.11 +arm_freq=700
   11.12 +core_freq=250
   11.13 +sdram_freq=400
   11.14 +over_voltage=0
   11.15 +
   11.16 +#GPU memory allocation in MB. Default: 64
   11.17 +#gpu_mem=128
   11.18 +
   11.19 +# Framebuffer Video. Depths: 8, 16, 24, 32
   11.20 +#framebuffer_depth=32
   11.21 +
   11.22 +# Overscan Video Settings
   11.23 +disable_overscan=0
   11.24 +overscan_left=0
   11.25 +overscan_right=0
   11.26 +overscan_top=0
   11.27 +overscan_bottom=0