slitaz-arm rev 58

Bunch og new stuff: more doc, st fixes, tazberry
author Christophe Lincoln <pankso@slitaz.org>
date Sat Mar 15 14:54:17 2014 +0100 (2014-03-15)
parents ffd23dba61e3
children d3376f278818
files Makefile README rootfs/etc/init.d/rcS rpi/tazberry sat sat-rpi
line diff
     1.1 --- a/Makefile	Fri Mar 14 23:02:33 2014 +0100
     1.2 +++ b/Makefile	Sat Mar 15 14:54:17 2014 +0100
     1.3 @@ -10,6 +10,13 @@
     1.4  	install -m 0755 sat $(DESTDIR)$(PREFIX)/bin
     1.5  	install -m 0755 sat-rpi $(DESTDIR)$(PREFIX)/bin
     1.6  
     1.7 +install-cgi:
     1.8 +	install -m 0755 -d $(DESTDIR)/var/www/adm
     1.9 +	cp -a cgi-adm/* $(DESTDIR)/var/www/adm
    1.10 +
    1.11  uninstall:
    1.12  	rm -f $(DESTDIR)$(PREFIX)/bin/sat
    1.13  	rm -f $(DESTDIR)$(PREFIX)/bin/sat-rpi
    1.14 +
    1.15 +uninstall-cgi:
    1.16 +	rm -rf $(DESTDIR)/var/www/adm
     2.1 --- a/README	Fri Mar 14 23:02:33 2014 +0100
     2.2 +++ b/README	Sat Mar 15 14:54:17 2014 +0100
     2.3 @@ -5,20 +5,14 @@
     2.4  SliTaz ARM tools and files
     2.5  
     2.6  
     2.7 -Installation
     2.8 +Build tools installation
     2.9  --------------------------------------------------------------------------------
    2.10 -To install 'sat' and 'sat-rpi' you must have make installed:
    2.11 +To install 'sat' and 'sat-rpi' you need to have make installed or copy the 2
    2.12 +files to /usr/bin:
    2.13  
    2.14  # make install
    2.15  
    2.16  
    2.17 -rootfs/ directory
    2.18 ---------------------------------------------------------------------------------
    2.19 -Custom SliTaz ARM scripts and files used to generate a distro. These files
    2.20 -and any other system files can be erased or added via the flavors support. The
    2.21 -rootfs files can also be directly modified before generating a new distro. 
    2.22 -
    2.23 -
    2.24  Sat quickstart
    2.25  --------------
    2.26  Sat is a tool in the spirit of all SliTaz tools, all commands and options are
    2.27 @@ -38,7 +32,7 @@
    2.28  # sat emu
    2.29  
    2.30  
    2.31 -Mirror
    2.32 +ARM packages mirror
    2.33  --------------------------------------------------------------------------------
    2.34  Sat lets you clone the ARM cooking mirror to let you debug and try official ARM
    2.35  packages. Sat will create a mirror directory in the working path and download 
    2.36 @@ -46,6 +40,36 @@
    2.37  file and download any modified or new packages.
    2.38  
    2.39  
    2.40 +Custom SliTaz system files: rootfs/
    2.41 +--------------------------------------------------------------------------------
    2.42 +Custom SliTaz ARM scripts and files used to generate a distro. These files
    2.43 +and any other system files can be erased or added via the flavors support. The
    2.44 +rootfs files can also be directly modified before generating a new distro.
    2.45 +
    2.46 +
    2.47 +CGI Admin web interface: cgi-adm/ 
    2.48 +--------------------------------------------------------------------------------
    2.49 +Very small and fast CGI SHell admin/info web interface for ARM devices with
    2.50 +plugins support. The goal is not to rewrite TazPanel but to have a light CGI
    2.51 +toolkit to code specific ARM devices plugings such as boot configs for the
    2.52 +Raspberry Pi. In the plugins directory you will find the a skeleton to start
    2.53 +your custom plugin. You can also create general purpose or hardware specific
    2.54 +plugins.
    2.55 +
    2.56 +The root directory is: /var/www/adm and the default web server is Busyboy HTTPd.
    2.57 +So just start the web server and connect to the IP address of your machine:
    2.58 +
    2.59 +# stard httpd
    2.60 +
    2.61 +URL form: http://192.rpi.ip/adm/
    2.62 +
    2.63 +On SliTaz i486 you can also use Busybox HTTPd  and install the cgi-adm files
    2.64 +under /var/www and code directly then copy or upload you plugin to your ARM 
    2.65 +devices.
    2.66 +
    2.67 +# make install-cgi
    2.68 +
    2.69 +
    2.70  Bugs
    2.71  --------------------------------------------------------------------------------
    2.72  Please report bugs on the Slitaz Bug Tracker: http://bugs.slitaz.org/
     3.1 --- a/rootfs/etc/init.d/rcS	Fri Mar 14 23:02:33 2014 +0100
     3.2 +++ b/rootfs/etc/init.d/rcS	Sat Mar 15 14:54:17 2014 +0100
     3.3 @@ -36,22 +36,18 @@
     3.4  # Be quiet at boot
     3.5  echo "0 0 0 0" > /proc/sys/kernel/printk
     3.6  
     3.7 -# /dev devtmpfs
     3.8 -echo -n "Mounting devtmpfs filesystem on: /dev"
     3.9 -mount -t devtmpfs devtmpfs /dev
    3.10 -status
    3.11 -
    3.12  # Use udev and disable hotplug helper (udevd listen to netlink)
    3.13  if [ -x "/sbin/udevd" ]; then
    3.14  	echo "" > /proc/sys/kernel/hotplug
    3.15  	echo "Starting udevd & udevadm [trigger settle]..."
    3.16 -	udevd --daemon 2>/dev/null &&
    3.17 -	udevadm trigger && udevadm settle --timeout=120
    3.18 -	status
    3.19 +	udevd --daemon 2>/dev/null
    3.20 +	udevadm trigger
    3.21 +	udevadm settle --timeout=120
    3.22  else
    3.23  	# Fallback to Busybox mdev
    3.24 -	echo -n "Creating device nodes: /sbin/mdev -s"
    3.25 -	mdev -s && echo "/sbin/mdev" > /proc/sys/kernel/hotplug
    3.26 +	echo "Creating device nodes: /sbin/mdev -s"
    3.27 +	echo "/sbin/mdev" > /proc/sys/kernel/hotplug
    3.28 +	mdev -s
    3.29  	status
    3.30  fi
    3.31  
     4.1 --- a/rpi/tazberry	Fri Mar 14 23:02:33 2014 +0100
     4.2 +++ b/rpi/tazberry	Sat Mar 15 14:54:17 2014 +0100
     4.3 @@ -35,12 +35,20 @@
     4.4  # RPi functions
     4.5  #
     4.6  
     4.7 +# This could move to /usr/bin/slitaz-??? or some thing since it's not
     4.8 +# ARM specific
     4.9  rpi_stats() {
    4.10 +	ip=$(ifconfig | fgrep -A 1 "encap:Ethernet" | fgrep "inet" | cut -d ":" -f 2)
    4.11 +	mem_total=$(free -m | fgrep "Mem:" | awk '{print $2}')
    4.12 +	mem_used=$(free -m | fgrep "Mem:" | awk '{print $3}')
    4.13 +	mem_used_pct=$(( ( ${mem_used} * 100) / ${mem_total} ))
    4.14  	cat << EOT
    4.15 -$(gettext 'Kernel')   : $(uname -snrm)
    4.16 -$(gettext 'Uptime')   :$(uptime | cut -d "," -f 1,2)
    4.17 -$(gettext 'CPU heat') : $(awk '{printf "%3.1f C\n", $1/1000}' \
    4.18 -	/sys/class/thermal/thermal_zone0/temp)
    4.19 +$(gettext 'Kernel')     : $(uname -snrm)
    4.20 +$(gettext 'Uptime')     : $(uptime | awk '{print $3}' | sed s"/:/h /" | sed s"/,/min/")
    4.21 +$(gettext 'Network IP') : $(echo $ip | awk '{print $1}')
    4.22 +$(gettext 'CPU heat')   : $(awk '{printf "%3.1f C\n", $1/1000}' /sys/class/thermal/thermal_zone0/temp)
    4.23 +$(gettext 'Processes')  : $(ps | wc -l)
    4.24 +Memory usage : ${mem_used_pct}%
    4.25  EOT
    4.26  }
    4.27  
     5.1 --- a/sat	Fri Mar 14 23:02:33 2014 +0100
     5.2 +++ b/sat	Sat Mar 15 14:54:17 2014 +0100
     5.3 @@ -176,7 +176,8 @@
     5.4  		# CGI Admin
     5.5  		if [ -d "$work/cgi-adm" ]; then
     5.6  			echo -n "Installing SliTaz ARM CGI Admin interface..."
     5.7 -			cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm
     5.8 +			mkdir -p ${rootfs}/var/www/adm
     5.9 +			cp -a ${work}/cgi-adm/* ${rootfs}/var/www/adm
    5.10  			status
    5.11  		fi
    5.12  
     6.1 --- a/sat-rpi	Fri Mar 14 23:02:33 2014 +0100
     6.2 +++ b/sat-rpi	Sat Mar 15 14:54:17 2014 +0100
     6.3 @@ -173,8 +173,9 @@
     6.4  		fi
     6.5  		echo -n "Mounting: /dev/$dev partitions"
     6.6  		mkdir -p ${rpiboot} ${rpiroot}
     6.7 -		mount /dev/${dev}1 ${rpiboot}
     6.8 -		mount /dev/${dev}3 ${rpiroot}; status
     6.9 +		mount /dev/${dev}1 ${rpiboot} || exit 1
    6.10 +		mount /dev/${dev}3 ${rpiroot} || exit 1
    6.11 +		status
    6.12  		echo -n "Cleaning: filesystem directories"
    6.13  		for dir in bin dev etc lib media mnt proc sbin sys tmp usr var run
    6.14  		do
    6.15 @@ -187,8 +188,8 @@
    6.16  		
    6.17  		# Unmount
    6.18  		echo -n "Unmounting: RPi sdcard"
    6.19 -		umount ${rpiboot} || exit 1
    6.20 -		umount ${rpiroot} || exit 1
    6.21 +		umount ${rpiboot}
    6.22 +		umount ${rpiroot}
    6.23  		status
    6.24  		
    6.25  		rm -f ${data}/sdcard.part
    6.26 @@ -214,9 +215,12 @@
    6.27  		# We may want to simply regenerate the RPi distro
    6.28  		if [ ! "$nosat" ]; then
    6.29  			sat gen --work="$work" --flavor="$flavor" --noinit --nolinux
    6.30 +		else
    6.31 +			newline
    6.32  		fi
    6.33  		
    6.34 -		header "SliTaz Raspberry Pi distro"
    6.35 +		boldify "SliTaz Raspberry Pi distro"
    6.36 +		separator
    6.37  		
    6.38  		# Boot firmware
    6.39  		echo -n "Copying: firmware files..."
    6.40 @@ -227,16 +231,12 @@
    6.41  		done
    6.42  		status
    6.43  		
    6.44 -		# TazBerry
    6.45 -		echo -n "Installing TazBerry..."
    6.46 +		# TazBerry ncurses and CGI data/plugins
    6.47 +		echo -n "Copying: TazBerry..."
    6.48  		cp -f ${rpi}/tazberry ${rootfs}/usr/bin
    6.49 +		cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm
    6.50  		status
    6.51  		
    6.52 -		# CGI Admin
    6.53 -		#echo -n "Installing TazBerry CGI..."
    6.54 -		#cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm
    6.55 -		#status
    6.56 -		
    6.57  		# Overclocking
    6.58  		echo -n "Setting: Overclocking..."
    6.59  		set_oclock; status