# HG changeset patch # User Christophe Lincoln # Date 1394891657 -3600 # Node ID 2d1f132ea8bfa6c22af90d8e3d02d2705fe46731 # Parent ffd23dba61e3aa35d1d7440bfe36f48d02c1b00a Bunch og new stuff: more doc, st fixes, tazberry diff -r ffd23dba61e3 -r 2d1f132ea8bf Makefile --- a/Makefile Fri Mar 14 23:02:33 2014 +0100 +++ b/Makefile Sat Mar 15 14:54:17 2014 +0100 @@ -10,6 +10,13 @@ install -m 0755 sat $(DESTDIR)$(PREFIX)/bin install -m 0755 sat-rpi $(DESTDIR)$(PREFIX)/bin +install-cgi: + install -m 0755 -d $(DESTDIR)/var/www/adm + cp -a cgi-adm/* $(DESTDIR)/var/www/adm + uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/sat rm -f $(DESTDIR)$(PREFIX)/bin/sat-rpi + +uninstall-cgi: + rm -rf $(DESTDIR)/var/www/adm diff -r ffd23dba61e3 -r 2d1f132ea8bf README --- a/README Fri Mar 14 23:02:33 2014 +0100 +++ b/README Sat Mar 15 14:54:17 2014 +0100 @@ -5,20 +5,14 @@ SliTaz ARM tools and files -Installation +Build tools installation -------------------------------------------------------------------------------- -To install 'sat' and 'sat-rpi' you must have make installed: +To install 'sat' and 'sat-rpi' you need to have make installed or copy the 2 +files to /usr/bin: # make install -rootfs/ directory --------------------------------------------------------------------------------- -Custom SliTaz ARM scripts and files used to generate a distro. These files -and any other system files can be erased or added via the flavors support. The -rootfs files can also be directly modified before generating a new distro. - - Sat quickstart -------------- Sat is a tool in the spirit of all SliTaz tools, all commands and options are @@ -38,7 +32,7 @@ # sat emu -Mirror +ARM packages mirror -------------------------------------------------------------------------------- Sat lets you clone the ARM cooking mirror to let you debug and try official ARM packages. Sat will create a mirror directory in the working path and download @@ -46,6 +40,36 @@ file and download any modified or new packages. +Custom SliTaz system files: rootfs/ +-------------------------------------------------------------------------------- +Custom SliTaz ARM scripts and files used to generate a distro. These files +and any other system files can be erased or added via the flavors support. The +rootfs files can also be directly modified before generating a new distro. + + +CGI Admin web interface: cgi-adm/ +-------------------------------------------------------------------------------- +Very small and fast CGI SHell admin/info web interface for ARM devices with +plugins support. The goal is not to rewrite TazPanel but to have a light CGI +toolkit to code specific ARM devices plugings such as boot configs for the +Raspberry Pi. In the plugins directory you will find the a skeleton to start +your custom plugin. You can also create general purpose or hardware specific +plugins. + +The root directory is: /var/www/adm and the default web server is Busyboy HTTPd. +So just start the web server and connect to the IP address of your machine: + +# stard httpd + +URL form: http://192.rpi.ip/adm/ + +On SliTaz i486 you can also use Busybox HTTPd and install the cgi-adm files +under /var/www and code directly then copy or upload you plugin to your ARM +devices. + +# make install-cgi + + Bugs -------------------------------------------------------------------------------- Please report bugs on the Slitaz Bug Tracker: http://bugs.slitaz.org/ diff -r ffd23dba61e3 -r 2d1f132ea8bf rootfs/etc/init.d/rcS --- a/rootfs/etc/init.d/rcS Fri Mar 14 23:02:33 2014 +0100 +++ b/rootfs/etc/init.d/rcS Sat Mar 15 14:54:17 2014 +0100 @@ -36,22 +36,18 @@ # Be quiet at boot echo "0 0 0 0" > /proc/sys/kernel/printk -# /dev devtmpfs -echo -n "Mounting devtmpfs filesystem on: /dev" -mount -t devtmpfs devtmpfs /dev -status - # Use udev and disable hotplug helper (udevd listen to netlink) if [ -x "/sbin/udevd" ]; then echo "" > /proc/sys/kernel/hotplug echo "Starting udevd & udevadm [trigger settle]..." - udevd --daemon 2>/dev/null && - udevadm trigger && udevadm settle --timeout=120 - status + udevd --daemon 2>/dev/null + udevadm trigger + udevadm settle --timeout=120 else # Fallback to Busybox mdev - echo -n "Creating device nodes: /sbin/mdev -s" - mdev -s && echo "/sbin/mdev" > /proc/sys/kernel/hotplug + echo "Creating device nodes: /sbin/mdev -s" + echo "/sbin/mdev" > /proc/sys/kernel/hotplug + mdev -s status fi diff -r ffd23dba61e3 -r 2d1f132ea8bf rpi/tazberry --- a/rpi/tazberry Fri Mar 14 23:02:33 2014 +0100 +++ b/rpi/tazberry Sat Mar 15 14:54:17 2014 +0100 @@ -35,12 +35,20 @@ # RPi functions # +# This could move to /usr/bin/slitaz-??? or some thing since it's not +# ARM specific rpi_stats() { + ip=$(ifconfig | fgrep -A 1 "encap:Ethernet" | fgrep "inet" | cut -d ":" -f 2) + mem_total=$(free -m | fgrep "Mem:" | awk '{print $2}') + mem_used=$(free -m | fgrep "Mem:" | awk '{print $3}') + mem_used_pct=$(( ( ${mem_used} * 100) / ${mem_total} )) cat << EOT -$(gettext 'Kernel') : $(uname -snrm) -$(gettext 'Uptime') :$(uptime | cut -d "," -f 1,2) -$(gettext 'CPU heat') : $(awk '{printf "%3.1f C\n", $1/1000}' \ - /sys/class/thermal/thermal_zone0/temp) +$(gettext 'Kernel') : $(uname -snrm) +$(gettext 'Uptime') : $(uptime | awk '{print $3}' | sed s"/:/h /" | sed s"/,/min/") +$(gettext 'Network IP') : $(echo $ip | awk '{print $1}') +$(gettext 'CPU heat') : $(awk '{printf "%3.1f C\n", $1/1000}' /sys/class/thermal/thermal_zone0/temp) +$(gettext 'Processes') : $(ps | wc -l) +Memory usage : ${mem_used_pct}% EOT } diff -r ffd23dba61e3 -r 2d1f132ea8bf sat --- a/sat Fri Mar 14 23:02:33 2014 +0100 +++ b/sat Sat Mar 15 14:54:17 2014 +0100 @@ -176,7 +176,8 @@ # CGI Admin if [ -d "$work/cgi-adm" ]; then echo -n "Installing SliTaz ARM CGI Admin interface..." - cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm + mkdir -p ${rootfs}/var/www/adm + cp -a ${work}/cgi-adm/* ${rootfs}/var/www/adm status fi diff -r ffd23dba61e3 -r 2d1f132ea8bf sat-rpi --- a/sat-rpi Fri Mar 14 23:02:33 2014 +0100 +++ b/sat-rpi Sat Mar 15 14:54:17 2014 +0100 @@ -173,8 +173,9 @@ fi echo -n "Mounting: /dev/$dev partitions" mkdir -p ${rpiboot} ${rpiroot} - mount /dev/${dev}1 ${rpiboot} - mount /dev/${dev}3 ${rpiroot}; status + mount /dev/${dev}1 ${rpiboot} || exit 1 + mount /dev/${dev}3 ${rpiroot} || exit 1 + status echo -n "Cleaning: filesystem directories" for dir in bin dev etc lib media mnt proc sbin sys tmp usr var run do @@ -187,8 +188,8 @@ # Unmount echo -n "Unmounting: RPi sdcard" - umount ${rpiboot} || exit 1 - umount ${rpiroot} || exit 1 + umount ${rpiboot} + umount ${rpiroot} status rm -f ${data}/sdcard.part @@ -214,9 +215,12 @@ # We may want to simply regenerate the RPi distro if [ ! "$nosat" ]; then sat gen --work="$work" --flavor="$flavor" --noinit --nolinux + else + newline fi - header "SliTaz Raspberry Pi distro" + boldify "SliTaz Raspberry Pi distro" + separator # Boot firmware echo -n "Copying: firmware files..." @@ -227,16 +231,12 @@ done status - # TazBerry - echo -n "Installing TazBerry..." + # TazBerry ncurses and CGI data/plugins + echo -n "Copying: TazBerry..." cp -f ${rpi}/tazberry ${rootfs}/usr/bin + cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm status - # CGI Admin - #echo -n "Installing TazBerry CGI..." - #cp -a ${rpi}/cgi-adm/* ${rootfs}/var/www/adm - #status - # Overclocking echo -n "Setting: Overclocking..." set_oclock; status