Author: titmuss
Date: Sun Jan 27 02:47:53 2008
New Revision: 1636
URL: http://svn.slimdevices.com?rev=1636&root=Jive&view=rev
Log:
[EMAIL PROTECTED] (orig r1631): titmuss | 2008-01-25 18:19:28 +0000
Bug: 6580
Description:
Modified the wlan script to allow the wlan to be started and stopped.
Added a suspend script, this will stop the wlan and suspend the system until a
specific time or other wake up event
(e.g. key press), and restart the wlan.
Allow logging to /log on an SD card.
Added klogd to capture kernel messages in the syslog.
Added:
trunk/squeezeboxJive/src/system/filesystem/etc/init.d/suspend
trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan
Removed:
trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan-start
Modified:
trunk/ (props changed)
trunk/squeezeboxJive/src/system/filesystem/Makefile
trunk/squeezeboxJive/src/system/filesystem/etc/init.d/rcS
Propchange: trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Sun Jan 27 02:47:53 2008
@@ -1,3 +1,3 @@
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1630
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1631
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Modified: trunk/squeezeboxJive/src/system/filesystem/Makefile
URL:
http://svn.slimdevices.com/trunk/squeezeboxJive/src/system/filesystem/Makefile?rev=1636&root=Jive&r1=1635&r2=1636&view=diff
==============================================================================
--- trunk/squeezeboxJive/src/system/filesystem/Makefile (original)
+++ trunk/squeezeboxJive/src/system/filesystem/Makefile Sun Jan 27 02:47:53 2008
@@ -10,7 +10,8 @@
install etc/inetd.conf ${PREFIX}/etc
install etc/inittab ${PREFIX}/etc
install etc/init.d/rcS ${PREFIX}/etc/init.d
- install etc/init.d/wlan-start ${PREFIX}/etc/init.d
+ install etc/init.d/wlan ${PREFIX}/etc/init.d
+ install etc/init.d/suspend ${PREFIX}/etc/init.d
-install etc/init.d/rcS.local ${PREFIX}/etc/init.d
install etc/issue ${PREFIX}/etc
install etc/protocols ${PREFIX}/etc
Modified: trunk/squeezeboxJive/src/system/filesystem/etc/init.d/rcS
URL:
http://svn.slimdevices.com/trunk/squeezeboxJive/src/system/filesystem/etc/init.d/rcS?rev=1636&root=Jive&r1=1635&r2=1636&view=diff
==============================================================================
--- trunk/squeezeboxJive/src/system/filesystem/etc/init.d/rcS (original)
+++ trunk/squeezeboxJive/src/system/filesystem/etc/init.d/rcS Sun Jan 27
02:47:53 2008
@@ -8,6 +8,7 @@
mkdir /var/shm /var/log /var/run
+# Mount SD card
if [ -b /dev/mmcblk0p1 ]; then
echo "Mounting MMC/SD card (partition 1)"
mount -t vfat /dev/mmcblk0p1 /mnt/mmc
@@ -17,13 +18,23 @@
fi
+# Start syslogd
grep /mnt/mmc /proc/mounts | cut -d' ' -f 4 | grep -q rw
-if [ $? = 0 -a -e /mnt/mmc/var ]; then
+if [ $? = 0 -a -e /mnt/mmc/log ]; then
+ # log and core files to mmc
+
+ echo "Starting syslogd (to mmc)"
+ /sbin/syslogd -s500 -O /mnt/mmc/log/messages
+
+ echo "Enabling core files (to mmc)"
+ echo "/mnt/mmc/log/core-%e" > /proc/sys/kernel/core_pattern
+ ulimit -c unlimited
+elif [ $? = 0 -a -e /mnt/mmc/var ]; then
# log and core files to mmc
/bin/mkdir -p /mnt/mmc/var/log /mnt/mmc/var/core
echo "Starting syslogd (to mmc)"
- /sbin/syslogd -O /mnt/mmc/var/log/messages
+ /sbin/syslogd -s500 -O /mnt/mmc/var/log/messages
echo "Enabling core files (to mmc)"
echo "/mnt/mmc/var/core/core-%e" > /proc/sys/kernel/core_pattern
@@ -35,6 +46,11 @@
fi
+# Start kernel logger
+/sbin/klogd
+
+
+# Execute firstboot script?
if ! [ -f /etc/firstboot ]; then
echo "First boot"
touch /etc/firstboot
@@ -44,6 +60,8 @@
fi
fi
+
+# Create ssh keys
if ! [ -f /etc/dropbear/dropbear_rsa_host_key ] ; then
echo "Creating dropbear rsa host key"
/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
@@ -54,6 +72,8 @@
/usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
fi
+
+# Start network
echo "Starting lo"
/sbin/ifconfig lo up 127.0.0.1
@@ -62,7 +82,7 @@
# Start wlan
-/etc/init.d/wlan-start
+/etc/init.d/wlan start
if [ -x /etc/init.d/rcS.local ]; then
Added: trunk/squeezeboxJive/src/system/filesystem/etc/init.d/suspend
URL:
http://svn.slimdevices.com/trunk/squeezeboxJive/src/system/filesystem/etc/init.d/suspend?rev=1636&root=Jive&view=auto
==============================================================================
--- trunk/squeezeboxJive/src/system/filesystem/etc/init.d/suspend (added)
+++ trunk/squeezeboxJive/src/system/filesystem/etc/init.d/suspend Sun Jan 27
02:47:53 2008
@@ -1,0 +1,25 @@
+#!/bin/sh
+
+
+# (Optional) number of seconds before wakeup
+SECONDS=$1
+
+if [ "x$SECONDS" != "x" ]
+then
+ NOW=`cat /sys/devices/platform/s3c2410-rtc/rtc\:rtc0/since_epoch`
+ WAKEAT=$(($NOW + $SECONDS))
+
+ echo "Wakeat $WAKEAT"
+ echo $WAKEAT > /sys/devices/platform/s3c2410-rtc/rtc\:rtc0/wakealarm
+fi
+
+
+# Stop wlan
+/etc/init.d/wlan stop
+
+# Suspend
+echo 'mem' > /sys/power/state
+
+# Start wlan
+/etc/init.d/wlan start
+
Added: trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan
URL:
http://svn.slimdevices.com/trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan?rev=1636&root=Jive&view=auto
==============================================================================
--- trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan (added)
+++ trunk/squeezeboxJive/src/system/filesystem/etc/init.d/wlan Sun Jan 27
02:47:53 2008
@@ -1,0 +1,61 @@
+#!/bin/sh
+
+
+# Read network config
+if [ -r /etc/network/config ]
+then
+ . /etc/network/config
+fi
+
+
+case "$1" in
+ start)
+ echo "Starting wlan"
+
+ # Load wlan drivers
+ /sbin/insmod gspi.ko
+ /sbin/insmod gspi8xxx.ko helper_name=/lib/firmware/helper_gspi.bin
fw_name=/lib/firmware/gspi8686.bin
+
+
+ # Set MAC address using ethaddr parameter on kernel command line
+ ethaddr=`/usr/sbin/fw_printenv ethaddr | cut -d= -f2`
+ if [ "x${ethaddr}" != "x" ]
+ then
+ echo "Setting ethaddr: ${ethaddr}"
+ /sbin/ifconfig eth0 hw ether ${ethaddr}
+ fi
+
+
+ # Set region code
+ if [ "x${REGIONCODE}" != "x" ]
+ then
+ echo "Setting region: ${REGIONCODE}"
+ /usr/sbin/iwpriv eth0 setregioncode ${REGIONCODE}
+ fi
+
+ # Start wpa supplicant
+ /usr/sbin/wpa_supplicant -B -Dmarvell -ieth0 -c/etc/wpa_supplicant.conf
+ /usr/sbin/wpa_cli -B -a/etc/network/wpa_action
+ ;;
+
+ stop)
+ echo "Stopping wlan"
+
+ # Stop wpa supplicant
+ killall wpa_supplicant
+ killall wpa_cli
+
+ # Down the interface
+ ifconfig eth0 down
+ /bin/rm -rf /var/run/ifstate
+
+ # Remove wlan drivers
+ rmmod gspi8xxx gspi
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 1
+esac
+
+exit 0
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins