[oe-commits] org.oe.dev slugos-init: Updated leds handling to match latest kernel patches

rwhitby commit openembedded-commits at lists.openembedded.org
Fri Jan 25 07:43:41 UTC 2008


slugos-init: Updated leds handling to match latest kernel patches

Author: rwhitby at nslu2-linux.org
Branch: org.openembedded.dev
Revision: 874c99507b738b67097dfa5e692d49108a46e0b1
ViewMTN: http://monotone.openembedded.org/revision/info/874c99507b738b67097dfa5e692d49108a46e0b1
Files:
1
packages/slugos-init/files/leds
packages/slugos-init/slugos-init_4.8.bb
Diffs:

#
# mt diff -r137c597e5635e94070a8b4e425094f828c7ad56a -r874c99507b738b67097dfa5e692d49108a46e0b1
#
# 
# 
# patch "packages/slugos-init/files/leds"
#  from [63b01ecea3103c9684caafa354921e6049dd7c3e]
#    to [24aa798d8ca8877e75d2307dff73aedb6e7d107a]
# 
# patch "packages/slugos-init/slugos-init_4.8.bb"
#  from [2343c97474f1173c4de03888133aaca41007bb13]
#    to [7d37c835b985898966ead2e619fbeceac97eddde]
# 
============================================================
--- packages/slugos-init/files/leds	63b01ecea3103c9684caafa354921e6049dd7c3e
+++ packages/slugos-init/files/leds	24aa798d8ca8877e75d2307dff73aedb6e7d107a
@@ -12,17 +12,9 @@ esac
 esac
 
 #
-# led_set led-dir off|on|slow|fast|panic|blink|flash|user|*
+# led_set led-dir off|on|slow|fast|panic|blink|flash|*
 #  set the given LED (expressed as a directory) to the 
-#  given status.  USER_LED may be set to indicate how to
-#  handle the 'user' setting.
-led_user_default(){
-	case "$(machine)" in
-	    nslu2)	echo -n "cpu-idle";;
-	    nas100d)	echo -n "on";;
-	    *)		echo -n "cpu";;
-	esac
-}
+#  given status.
 #
 led_set(){
 	local setting
@@ -31,15 +23,6 @@ led_set(){
 	then
 		setting="$2"
 		case "$setting" in
-		user)	if test -n "$USER_LED"
-			then
-				setting="$USER_LED"
-			else
-				setting="$(led_user_default)"
-			fi;;
-		esac
-
-		case "$setting" in
 		off|on)		echo -n none
 
 				case "$setting" in
@@ -66,11 +49,6 @@ led_set(){
 				panic)	echo -n 3000;;
 				esac >"$1/delay_off";;
 
-		cpu-idle)	echo -n cpu
-				# these settings work well on NSLU2
-				echo -n on >"$1/idle"
-				echo -n flash >"$1/active";;
-
 		*)		echo -n "$setting";;
 		esac >"$1/trigger"
 	else
@@ -129,6 +107,28 @@ sysled_ready(){
 	led_set "$1/ready" "$ready"
 }
 #
+# the cases for one blue flashing LED (just power)
+sysled_power(){
+	local power
+	# expect dir [boot](system|user) [error|panic]
+	case "$3" in
+	error)	power=off;;
+	panic)	power=off;;
+	*)	case "$2" in
+		bootsystem)	power=off;; # blinking
+		system)		power=off;; # blinking
+		bootuser)	power=on;;
+		user)		power=on;;
+		bootsingleuser)	power=off;; # blinking
+		singleuser)	power=off;; # blinking
+		bootshutdown)	power=off;; # blinking
+		shutdown)	power=off;; # blinking
+		esac;;
+	esac
+
+	led_set "$1/power" "$power"
+}
+#
 sysled(){
 	local mp st boot isst
 	mp=/sys
@@ -153,7 +153,7 @@ sysled(){
 		mp=/mnt
 	fi
 	#
-	# check for the 'ready' LED - otherwise do nothing
+	# check for the 'ready' LED - otherwise check for a 'power' LED
 	if test -d "$mp/class/leds/ready"
 	then
 		if test -d "$mp/class/leds/status"
@@ -162,6 +162,11 @@ sysled(){
 		else
 			sysled_ready "$mp/class/leds" $boot"$@"
 		fi
+	else
+		if test -d "$mp/class/leds/power"
+		then
+			sysled_power "$mp/class/leds" $boot"$@"
+		fi
 	fi
 	#
 	# clean up
@@ -200,11 +205,8 @@ leds_help(){
 	echo "    the new state.  'error' or 'panic' means a (potentially)" >&2
 	echo "    recoverable error or an unrecoverable error ('panic') has" >&2
 	echo "    occured." >&2
-	echo "  <led> off|on|slow|fast|panic|blink|flash|user|cpu|cpu-idle" >&2
-	echo "    set the named led to the given display, an arbitrary led" >&2
-	echo "    trigger may be given.  'user' will use the default specified" >&2
-	echo "    in USER_LED from /etc/default/rcS, if not specified a cpu" >&2
-	echo "    activity setting appropriate to the machine is selected" >&2
+	echo "  <led> off|on|slow|fast|panic|blink|flash" >&2
+	echo "    set the named led to the given display." >&2
 	echo "  beep {args}" >&2
 	echo "    if possible cause the machine to emit a beep" >&2
 }
============================================================
--- packages/slugos-init/slugos-init_4.8.bb	2343c97474f1173c4de03888133aaca41007bb13
+++ packages/slugos-init/slugos-init_4.8.bb	7d37c835b985898966ead2e619fbeceac97eddde
@@ -1,10 +1,10 @@ RDEPENDS = "busybox devio"
 DESCRIPTION = "SlugOS initial network config via sysconf"
 SECTION = "base"
 PRIORITY = "required"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "file://boot/flash \
 	   file://boot/disk \






More information about the Openembedded-commits mailing list