slitaz-arm rev 53

Use joe, udev support in rcS
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 13 22:28:54 2014 +0100 (2014-03-13)
parents bc8365a12dc7
children f02931a2c41f
files flavors/base/packages.list flavors/rpi/flavor.conf flavors/rpi/packages.list rootfs/etc/init.d/rcS tools/example.cgi tools/rpi-example.cgi
line diff
     1.1 --- a/flavors/base/packages.list	Tue Mar 11 22:12:16 2014 +0100
     1.2 +++ b/flavors/base/packages.list	Thu Mar 13 22:28:54 2014 +0100
     1.3 @@ -18,3 +18,4 @@
     1.4  dialog
     1.5  zlib
     1.6  dropbear
     1.7 +joe
     2.1 --- a/flavors/rpi/flavor.conf	Tue Mar 11 22:12:16 2014 +0100
     2.2 +++ b/flavors/rpi/flavor.conf	Thu Mar 13 22:28:54 2014 +0100
     2.3 @@ -2,7 +2,7 @@
     2.4  #
     2.5  
     2.6  FLAVOR="rpi"
     2.7 -VERSION="20140304"
     2.8 +VERSION="20140313"
     2.9  MAINTAINER="pankso@slitaz.org"
    2.10  SHORT_DESC="SliTaz ARM Raspberry Pi flavor"
    2.11  WEB_SITE="http://arm.slitaz.org"
     3.1 --- a/flavors/rpi/packages.list	Tue Mar 11 22:12:16 2014 +0100
     3.2 +++ b/flavors/rpi/packages.list	Thu Mar 13 22:28:54 2014 +0100
     3.3 @@ -17,9 +17,5 @@
     3.4  dialog
     3.5  zlib
     3.6  dropbear
     3.7 -nano
     3.8 +joe
     3.9  clex
    3.10 -wireless_tools
    3.11 -wpa_supplicant
    3.12 -libssl
    3.13 -libcrypto
     4.1 --- a/rootfs/etc/init.d/rcS	Tue Mar 11 22:12:16 2014 +0100
     4.2 +++ b/rootfs/etc/init.d/rcS	Thu Mar 13 22:28:54 2014 +0100
     4.3 @@ -5,7 +5,7 @@
     4.4  #
     4.5  # rcS is the main initialization script used to check fs, mount, clean,
     4.6  # run scripts and start daemons. This is a custom script for ARM to get
     4.7 -# a faster boot under Qemu and skip things like handling cdrom.
     4.8 +# a faster boot and skip things like handling cdrom.
     4.9  #
    4.10  # Copyright (C) 2012-2014 SliTaz ARM - BSD License
    4.11  #
    4.12 @@ -18,22 +18,31 @@
    4.13  echo $(colorize 34 "Processing: /etc/init.d/rcS")
    4.14  
    4.15  # Mount all from: /etc/fstab
    4.16 +mkdir -p /dev/pts /dev/shm
    4.17  echo "Mounting filesystems in fstab..."
    4.18  mount -a
    4.19  
    4.20 -# Be quiet
    4.21 -echo "0 0 0 0" > /proc/sys/kernel/printk
    4.22 -
    4.23  # Mount /run as tmpfs so runtime data are not written to disk
    4.24  echo -n "Mounting tmpfs filesystem on: /run"
    4.25  mount -t tmpfs tmpfs /run
    4.26  status
    4.27  
    4.28 -# Populate /dev
    4.29 -echo -n "Creating device nodes..."
    4.30 -mdev -s
    4.31 -echo "/sbin/mdev" > /proc/sys/kernel/hotplug
    4.32 -status
    4.33 +# Be quiet at boot
    4.34 +echo "0 0 0 0" > /proc/sys/kernel/printk
    4.35 +
    4.36 +# Use udev and disable hotplug helper (udevd listen to netlink)
    4.37 +if [ -x "/sbin/udevd" ]; then
    4.38 +	echo "" > /proc/sys/kernel/hotplug
    4.39 +	echo "Starting udevd & udevadm [trigger settle]..."
    4.40 +	udevd --daemon 2>/dev/null &&
    4.41 +	udevadm trigger && udevadm settle --timeout=120
    4.42 +	status
    4.43 +else
    4.44 +	# Fallback to Busybox mdev
    4.45 +	echo -n "Creating device nodes: /sbin/mdev -s"
    4.46 +	mdev -s && echo "/sbin/mdev" > /proc/sys/kernel/hotplug
    4.47 +	status
    4.48 +fi
    4.49  
    4.50  # Clean up
    4.51  echo -n "Cleaning up the system..."
    4.52 @@ -56,7 +65,7 @@
    4.53  
    4.54  # Start all init scripts
    4.55  for script in $RUN_SCRIPTS; do
    4.56 -	echo $(colorize 34 "Processing: /etc/init.d/$script")
    4.57 +	colorize 34 "Processing: /etc/init.d/$script"
    4.58  	/etc/init.d/$script
    4.59  done
    4.60  
    4.61 @@ -68,7 +77,7 @@
    4.62  	done
    4.63  fi
    4.64  
    4.65 -# System time
    4.66 +# System time option
    4.67  if fgrep -q 'rdate' /proc/cmdline; then
    4.68  	echo -n "Setting system date..."
    4.69  	rdate -s 203.129.68.14 2>/dev/null
    4.70 @@ -78,5 +87,5 @@
    4.71  newline
    4.72  colorize 32 "$MESSAGE"
    4.73  
    4.74 -# Back to a verbose mode.
    4.75 -echo "7 4 1 7" > /proc/sys/kernel/printk
    4.76 +# Back to a verbose mode but wait ti finish with a clean boot
    4.77 +(sleep 4; echo "7 4 1 7" > /proc/sys/kernel/printk) &
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/example.cgi	Thu Mar 13 22:28:54 2014 +0100
     5.3 @@ -0,0 +1,37 @@
     5.4 +#!/bin/sh
     5.5 +#
     5.6 +# Tiny CGI SHell example for SliTaz ARM
     5.7 +#
     5.8 +# $ startd httpd
     5.9 +# URL: http://rpi.ip/adm/
    5.10 +#
    5.11 +echo "Content type: text/plain"
    5.12 +echo ""
    5.13 +
    5.14 +# Only for root
    5.15 +[ $(id -u) == 0 ] || exit 1
    5.16 +
    5.17 +cpu_temp() {
    5.18 +	awk '{printf "%3.1f C", $1/1000}' \
    5.19 +		/sys/class/thermal/thermal_zone0/temp
    5.20 +}
    5.21 +
    5.22 +# tazberry rpi_stats
    5.23 +cat << EOT
    5.24 +SliTaz Raspberry Pi Stats
    5.25 +-------------------------
    5.26 +
    5.27 +Kernel   : $(uname -snrm)
    5.28 +Uptime   :$(uptime | cut -d "," -f 1,2)
    5.29 +CPU Temp : $(cpu_temp)
    5.30 +
    5.31 +Memory and filesystem usages
    5.32 +----------------------------
    5.33 +$(free -m)
    5.34 +
    5.35 +$(df -h)
    5.36 +
    5.37 +Network interfaces
    5.38 +------------------
    5.39 +$(ifconfig)
    5.40 +EOT
     6.1 --- a/tools/rpi-example.cgi	Tue Mar 11 22:12:16 2014 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,37 +0,0 @@
     6.4 -#!/bin/sh
     6.5 -#
     6.6 -# Tiny CGI SHell example for SliTaz RPi
     6.7 -#
     6.8 -# $ startd httpd
     6.9 -# URL: http://rpi.ip/adm/
    6.10 -#
    6.11 -echo "Content type: text/plain"
    6.12 -echo ""
    6.13 -
    6.14 -# Only for root
    6.15 -[ $(id -u) == 0 ] || exit 1
    6.16 -
    6.17 -cpu_temp() {
    6.18 -	awk '{printf "%3.1f C", $1/1000}' \
    6.19 -		/sys/class/thermal/thermal_zone0/temp
    6.20 -}
    6.21 -
    6.22 -# tazberry rpi_stats
    6.23 -cat << EOT
    6.24 -SliTaz Raspberry Pi Stats
    6.25 --------------------------
    6.26 -
    6.27 -Kernel   : $(uname -snrm)
    6.28 -Uptime   :$(uptime | cut -d "," -f 1,2)
    6.29 -CPU Temp : $(cpu_temp)
    6.30 -
    6.31 -Memory and filesystem usages
    6.32 -----------------------------
    6.33 -$(free -m)
    6.34 -
    6.35 -$(df -h)
    6.36 -
    6.37 -Network interfaces
    6.38 -------------------
    6.39 -$(ifconfig)
    6.40 -EOT