From: <abe...@us...> - 2011-12-23 00:17:58
|
Revision: 5332 http://astlinux.svn.sourceforge.net/astlinux/?rev=5332&view=rev Author: abelbeck Date: 2011-12-23 00:17:51 +0000 (Fri, 23 Dec 2011) Log Message: ----------- alert LED, alix and wrap, ide-disk trigger no longer supported, error still supported Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2011-12-22 16:48:48 UTC (rev 5331) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2011-12-23 00:17:51 UTC (rev 5332) @@ -47,7 +47,7 @@ if grep -q "astlinux=wrap" /proc/cmdline; then echo heartbeat > /sys/class/leds/wrap::power/trigger - echo ide-disk > /sys/class/leds/wrap::error/trigger + # echo ide-disk > /sys/class/leds/wrap::error/trigger if [ -n "$EXTIF" ]; then echo netdev > /sys/class/leds/wrap::extra/trigger echo "$EXTIF" > /sys/class/leds/wrap::extra/device_name @@ -60,7 +60,7 @@ if grep -q "astlinux=alix" /proc/cmdline; then echo heartbeat > /sys/class/leds/alix:1/trigger - echo ide-disk > /sys/class/leds/alix:2/trigger + # echo ide-disk > /sys/class/leds/alix:2/trigger if [ -n "$EXTIF" ]; then echo netdev > /sys/class/leds/alix:3/trigger echo "$EXTIF" > /sys/class/leds/alix:3/device_name @@ -93,7 +93,7 @@ echo none > /sys/class/leds/wrap::power/trigger echo 1 > /sys/class/leds/wrap::power/brightness - echo none > /sys/class/leds/wrap::error/trigger + # echo none > /sys/class/leds/wrap::error/trigger echo 1 > /sys/class/leds/wrap::error/brightness echo none > /sys/class/leds/wrap::extra/trigger echo 0 > /sys/class/leds/wrap::extra/brightness @@ -108,7 +108,7 @@ echo none > /sys/class/leds/alix:1/trigger echo 1 > /sys/class/leds/alix:1/brightness - echo none > /sys/class/leds/alix:2/trigger + # echo none > /sys/class/leds/alix:2/trigger echo 1 > /sys/class/leds/alix:2/brightness echo none > /sys/class/leds/alix:3/trigger echo 0 > /sys/class/leds/alix:3/brightness This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-12-08 04:48:35
|
Revision: 5792 http://astlinux.svn.sourceforge.net/astlinux/?rev=5792&view=rev Author: abelbeck Date: 2012-12-08 04:48:29 +0000 (Sat, 08 Dec 2012) Log Message: ----------- Add console welcome message at startup Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-07 01:03:32 UTC (rev 5791) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-08 04:48:29 UTC (rev 5792) @@ -2,6 +2,38 @@ . /etc/rc.conf +welcome_msg() +{ + local ext_ipv4="" asterisk="" + + if [ -n "$EXTIF" ]; then + ext_ipv4="$(ip -o addr show dev "$EXTIF" 2>/dev/null | awk '$3 == "inet" { split($4, field, "/"); print field[1]; }' | tr '\n' ' ')" + fi + + if [ -x /usr/sbin/asterisk ]; then + asterisk="$(/usr/sbin/asterisk -V)" + fi + + memtotal="$(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo 2>/dev/null)" + memfree="$(awk '/^MemFree:/ { print int(($2 + 512) / 1024) }' /proc/meminfo 2>/dev/null)" + + echo -e "\n\n\033[40m\033[1;32m Welcome to AstLinux, Release: $(cat /etc/astlinux-release)${asterisk:+ - $asterisk} \033[0m" + echo " + System information (as of $(date)) + + Hostname: $HOSTNAME + Domain: $DOMAIN + Linux: $(uname -r) + RAM Memory: $memtotal MB, Free $memfree MB + + Interface: $EXTIF (External) IPv4 Address: $ext_ipv4${INTIF:+ + Interface: $INTIF (1st LAN)}${INT2IF:+ + Interface: $INT2IF (2nd LAN)}${INT3IF:+ + Interface: $INT3IF (3rd LAN)}${DMZIF:+ + Interface: $DMZIF (The DMZ)} +" +} + is_alert_sound_type() { local sound_type="$1" sound IFS @@ -18,6 +50,8 @@ start () { + welcome_msg + # Turn OFF the errorled (after finshed booting) if grep -q "astlinux=net4801" /proc/cmdline; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-12-09 22:50:24
|
Revision: 5793 http://astlinux.svn.sourceforge.net/astlinux/?rev=5793&view=rev Author: abelbeck Date: 2012-12-09 22:50:15 +0000 (Sun, 09 Dec 2012) Log Message: ----------- welcome message, add a one second delay to allow the message to transmit since getty immediately follows the alert service and flushes any unsent serial data for a serial console Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-08 04:48:29 UTC (rev 5792) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-09 22:50:15 UTC (rev 5793) @@ -4,7 +4,7 @@ welcome_msg() { - local ext_ipv4="" asterisk="" + local ext_ipv4="" asterisk="" memtotal memfree release if [ -n "$EXTIF" ]; then ext_ipv4="$(ip -o addr show dev "$EXTIF" 2>/dev/null | awk '$3 == "inet" { split($4, field, "/"); print field[1]; }' | tr '\n' ' ')" @@ -14,10 +14,12 @@ asterisk="$(/usr/sbin/asterisk -V)" fi - memtotal="$(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo 2>/dev/null)" - memfree="$(awk '/^MemFree:/ { print int(($2 + 512) / 1024) }' /proc/meminfo 2>/dev/null)" + memtotal="$(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" + memfree="$(awk '/^MemFree:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" - echo -e "\n\n\033[40m\033[1;32m Welcome to AstLinux, Release: $(cat /etc/astlinux-release)${asterisk:+ - $asterisk} \033[0m" + release="$(cat /etc/astlinux-release)" + + echo -e "\n\n\033[40m\033[1;32m Welcome to AstLinux, Release: ${release}${asterisk:+ - $asterisk} \033[0m" echo " System information (as of $(date)) @@ -32,6 +34,9 @@ Interface: $INT3IF (3rd LAN)}${DMZIF:+ Interface: $DMZIF (The DMZ)} " + # Add a one second delay to allow the message to transmit since getty immediately + # follows this service and flushes any unsent serial data for a serial console. + sleep 1 } is_alert_sound_type() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-12-11 19:41:31
|
Revision: 5796 http://astlinux.svn.sourceforge.net/astlinux/?rev=5796&view=rev Author: abelbeck Date: 2012-12-11 19:41:24 +0000 (Tue, 11 Dec 2012) Log Message: ----------- console welcome message, display 'IPv4 Network:' value for internal interfaces Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-10 17:21:56 UTC (rev 5795) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2012-12-11 19:41:24 UTC (rev 5796) @@ -2,14 +2,24 @@ . /etc/rc.conf +dev_to_ipv4_addresses() +{ + ip -o addr show dev "$1" 2>/dev/null | \ + awk '$3 == "inet" { split($4, field, "/"); print field[1]; }' | \ + tr '\n' ' ' +} + +dev_to_ipv4_networks() +{ + ip -o addr show dev "$1" 2>/dev/null | \ + awk '$3 == "inet" { print $4; }' | \ + tr '\n' ' ' +} + welcome_msg() { - local ext_ipv4="" asterisk="" memtotal memfree release + local asterisk="" memtotal memfree release - if [ -n "$EXTIF" ]; then - ext_ipv4="$(ip -o addr show dev "$EXTIF" 2>/dev/null | awk '$3 == "inet" { split($4, field, "/"); print field[1]; }' | tr '\n' ' ')" - fi - if [ -x /usr/sbin/asterisk ]; then asterisk="$(/usr/sbin/asterisk -V)" fi @@ -28,11 +38,11 @@ Linux: $(uname -r) RAM Memory: $memtotal MB, Free $memfree MB - Interface: $EXTIF (External) IPv4 Address: $ext_ipv4${INTIF:+ - Interface: $INTIF (1st LAN)}${INT2IF:+ - Interface: $INT2IF (2nd LAN)}${INT3IF:+ - Interface: $INT3IF (3rd LAN)}${DMZIF:+ - Interface: $DMZIF (The DMZ)} + Interface: $EXTIF (External) IPv4 Address: $(dev_to_ipv4_addresses $EXTIF)${INTIF:+ + Interface: $INTIF (1st LAN) IPv4 Network: $(dev_to_ipv4_networks $INTIF)}${INT2IF:+ + Interface: $INT2IF (2nd LAN) IPv4 Network: $(dev_to_ipv4_networks $INT2IF)}${INT3IF:+ + Interface: $INT3IF (3rd LAN) IPv4 Network: $(dev_to_ipv4_networks $INT3IF)}${DMZIF:+ + Interface: $DMZIF (The DMZ) IPv4 Network: $(dev_to_ipv4_networks $DMZIF)} " # Add a one second delay to allow the message to transmit since getty immediately # follows this service and flushes any unsent serial data for a serial console. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-04-30 23:36:22
|
Revision: 6066 http://sourceforge.net/p/astlinux/code/6066 Author: abelbeck Date: 2013-04-30 23:36:18 +0000 (Tue, 30 Apr 2013) Log Message: ----------- alert, add new variable ALERT_SOUNDS_OCTAVE to increase the alert tones by 1, 2 or 3 octaves. Useful for boards with smaller high frequency piezo-speakers or noisy environments. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2013-04-30 04:33:47 UTC (rev 6065) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2013-04-30 23:36:18 UTC (rev 6066) @@ -63,6 +63,46 @@ return 1 } +set_tune_octave() +{ + local orig_tune="$1" octave="$2" dest_tune arg freq power IFS + + if [ "$octave" = "1" -o "$octave" = "2" -o "$octave" = "3" ]; then + power=$((2**octave)) + dest_tune="" + unset IFS + for arg in $orig_tune; do + if [ "${arg#-f}" != "$arg" ]; then + freq="${arg#-f}" + dest_tune="$dest_tune${dest_tune:+ }-f$((freq*power))" + else + dest_tune="$dest_tune${dest_tune:+ }$arg" + fi + done + else + dest_tune="$orig_tune" + fi + + echo "$dest_tune" +} + +play_alert_sound_type() +{ + local tune="" + + case $1 in + startup) tune="-f330 -l100 -d1 -n -f277 -l100 -d1 -n -f330 -l100 -d1 -n -f440 -l330" ;; + shutdown) tune="-f988 -l180 -d33 -n -f831 -l110" ;; + esac + + if [ -n "$tune" ]; then + if [ -n "$ALERT_SOUNDS_OCTAVE" ]; then + tune="$(set_tune_octave "$tune" "$ALERT_SOUNDS_OCTAVE")" + fi + beep $tune + fi +} + start () { welcome_msg @@ -125,7 +165,7 @@ if grep -q "astlinux=geni586" /proc/cmdline; then if is_alert_sound_type startup; then - beep -f 330 -l 100 -d1 -n -f 277 -l 100 -d1 -n -f 330 -l 100 -d 1 -n -f 440 -l 330 + play_alert_sound_type startup fi fi } @@ -167,7 +207,7 @@ if grep -q "astlinux=geni586" /proc/cmdline; then if is_alert_sound_type shutdown; then - beep -f 988 -l 180 -d 33 -n -f 831 -l 110 + play_alert_sound_type shutdown fi fi } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-11-23 16:30:25
|
Revision: 7346 http://sourceforge.net/p/astlinux/code/7346 Author: abelbeck Date: 2015-11-23 16:30:24 +0000 (Mon, 23 Nov 2015) Log Message: ----------- startup alert script, add -m to uname and prepare for genx86_64 board type Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2015-11-23 16:03:15 UTC (rev 7345) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2015-11-23 16:30:24 UTC (rev 7346) @@ -35,7 +35,7 @@ Hostname: $HOSTNAME Domain: $DOMAIN - Linux: $(uname -r) + Linux: $(uname -r -m) RAM Memory: $memtotal MB, Free $memfree MB Interface: $EXTIF (External) IPv4 Address: $(dev_to_ipv4_addresses $EXTIF)${INTIF:+ @@ -157,7 +157,7 @@ fi # Generate Alert Sounds (after finished booting) - if grep -q "astlinux=geni586" /proc/cmdline; then + if grep -q "astlinux=gen[ix][0-9]" /proc/cmdline; then if is_alert_sound_type startup; then play_alert_sound_type startup @@ -199,7 +199,7 @@ fi # Generate Alert Sounds (on reboot/shutdown) - if grep -q "astlinux=geni586" /proc/cmdline; then + if grep -q "astlinux=gen[ix][0-9]" /proc/cmdline; then if is_alert_sound_type shutdown; then play_alert_sound_type shutdown This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2016-03-12 21:20:46
|
Revision: 7586 http://sourceforge.net/p/astlinux/code/7586 Author: abelbeck Date: 2016-03-12 21:20:44 +0000 (Sat, 12 Mar 2016) Log Message: ----------- startup alert message, add 'Board Type:' entry Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2016-03-10 21:36:09 UTC (rev 7585) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2016-03-12 21:20:44 UTC (rev 7586) @@ -18,7 +18,7 @@ welcome_msg() { - local asterisk="" memtotal memfree release + local asterisk="" memtotal memfree board release if [ -x /usr/sbin/asterisk ]; then asterisk="$(/usr/sbin/asterisk -V)" @@ -27,6 +27,13 @@ memtotal="$(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" memfree="$(awk '/^MemFree:/ { print int(($2 + 512) / 1024) }' /proc/meminfo)" + board="$(cat /proc/cmdline | sed -n -r -e 's:^.* astlinux=([^ ]+).*$:\1:p')" + if [ "$board" = "geni586" -o "$board" = "genx86_64" ]; then + if grep -q ' console=' /proc/cmdline; then + board="${board}-serial" + fi + fi + release="$(cat /etc/astlinux-release)" echo -e "\n\n\033[40m\033[1;32m Welcome to AstLinux, Release: ${release}${asterisk:+ - $asterisk} \033[0m" @@ -37,6 +44,7 @@ Domain: $DOMAIN Linux: $(uname -r -m) RAM Memory: $memtotal MB, Free $memfree MB + Board Type: $board Interface: $EXTIF (External) IPv4 Address: $(dev_to_ipv4_addresses $EXTIF)${INTIF:+ Interface: $INTIF (1st LAN) IPv4 Network: $(dev_to_ipv4_networks $INTIF)}${INT2IF:+ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |