From: <abe...@us...> - 2011-10-19 00:01:49
|
Revision: 5217 http://astlinux.svn.sourceforge.net/astlinux/?rev=5217&view=rev Author: abelbeck Date: 2011-10-19 00:01:42 +0000 (Wed, 19 Oct 2011) Log Message: ----------- ex-vi, add VI_EDITOR_OPTIONS variable to set default vi editor options and make defaults options similar the previous BusyBox vi Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/misc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/misc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/misc 2011-10-18 20:58:16 UTC (rev 5216) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/misc 2011-10-19 00:01:42 UTC (rev 5217) @@ -7,6 +7,10 @@ init () { + if [ -n "$VI_EDITOR_OPTIONS" ]; then + echo -e "$VI_EDITOR_OPTIONS" > /root/.exrc + fi + if [ -n "$ISSUE" ]; then echo "$ISSUE" > /tmp/etc/issue else Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-10-18 20:58:16 UTC (rev 5216) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-10-19 00:01:42 UTC (rev 5217) @@ -828,6 +828,12 @@ ##################################################################### +## VI_EDITOR_OPTIONS set default vi editor options +## a multi-line syntax, no blank lines or comments allowed. +VI_EDITOR_OPTIONS="set ignorecase +set showmode +map \x7f h" + ## ISSUE is what is presented on running gettys (console) ISSUE="This is \n\ (\s \m \r) \t" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-07 17:18:43
|
Revision: 5294 http://astlinux.svn.sourceforge.net/astlinux/?rev=5294&view=rev Author: abelbeck Date: 2011-12-07 17:18:32 +0000 (Wed, 07 Dec 2011) Log Message: ----------- add support for rc.conf variable ALERT_SOUNDS, startup and/or shutdown, rename errorled to alert Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K00alert branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99alert Removed Paths: ------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/errorled branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K99errorled branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99errorled Copied: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert (from rev 5293, branches/1.0/project/astlinux/target_skeleton/etc/init.d/errorled) =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2011-12-07 17:18:32 UTC (rev 5294) @@ -0,0 +1,150 @@ +#!/bin/sh + +. /etc/rc.conf + +is_alert_sound_type() +{ + local sound_type="$1" sound IFS + + unset IFS + for sound in $ALERT_SOUNDS; do + if [ "$sound" = "$sound_type" ]; then + return 0 + fi + done + + return 1 +} + +start () { + + # Turn OFF the errorled (after finshed booting) + if grep -q "astlinux=net4801" /proc/cmdline; then + + echo 0 > /sys/class/leds/net48xx::error/brightness + fi + + if grep -q "astlinux=wrap" /proc/cmdline; then + + echo 0 > /sys/class/leds/wrap::error/brightness + fi + + if grep -q "astlinux=net5501" /proc/cmdline; then + + /usr/sbin/functions errorled_net5501 off + fi + + if grep -q "astlinux=alix" /proc/cmdline; then + + echo 0 > /sys/class/leds/alix:2/brightness + fi + + # LED control for Alix and WRAP boards (after finished booting) + # "/mnt/kd/rc.ledcontrol" can override these settings + if [ -x /mnt/kd/rc.ledcontrol ]; then + /mnt/kd/rc.ledcontrol + else + 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 + if [ -n "$EXTIF" ]; then + echo netdev > /sys/class/leds/wrap::extra/trigger + echo "$EXTIF" > /sys/class/leds/wrap::extra/device_name + echo "enabled" > /sys/class/leds/wrap::extra/link + echo "enabled" > /sys/class/leds/wrap::extra/transmit + echo "enabled" > /sys/class/leds/wrap::extra/receive + fi + fi + + 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 + if [ -n "$EXTIF" ]; then + echo netdev > /sys/class/leds/alix:3/trigger + echo "$EXTIF" > /sys/class/leds/alix:3/device_name + echo "enabled" > /sys/class/leds/alix:3/link + echo "enabled" > /sys/class/leds/alix:3/transmit + echo "enabled" > /sys/class/leds/alix:3/receive + + fi + fi + fi + + # Generate Alert Sounds (after finished booting) + 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 + fi + fi +} + +stop () { + + # Turn on the errorled (on reboot/shutdown) + if grep -q "astlinux=net4801" /proc/cmdline; then + + echo 1 > /sys/class/leds/net48xx::error/brightness + fi + + if grep -q "astlinux=wrap" /proc/cmdline; then + + 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 1 > /sys/class/leds/wrap::error/brightness + echo none > /sys/class/leds/wrap::extra/trigger + echo 0 > /sys/class/leds/wrap::extra/brightness + fi + + if grep -q "astlinux=net5501" /proc/cmdline; then + + /usr/sbin/functions errorled_net5501 on + fi + + if grep -q "astlinux=alix" /proc/cmdline; then + + 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 1 > /sys/class/leds/alix:2/brightness + echo none > /sys/class/leds/alix:3/trigger + echo 0 > /sys/class/leds/alix:3/brightness + fi + + # Generate Alert Sounds (on reboot/shutdown) + 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 + fi + fi +} + +case $1 in + + start) + start + ;; + + stop) + stop + ;; + + init) + start + ;; + + restart) + stop + sleep 2 + start + ;; + + *) + echo "Usage: start|stop|restart" + ;; + +esac Deleted: branches/1.0/project/astlinux/target_skeleton/etc/init.d/errorled =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/errorled 2011-12-07 00:55:44 UTC (rev 5293) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/errorled 2011-12-07 17:18:32 UTC (rev 5294) @@ -1,122 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -start () { - - # Turn OFF the errorled (after finshed booting) - if grep -q "astlinux=net4801" /proc/cmdline; then - - echo 0 > /sys/class/leds/net48xx::error/brightness - fi - - if grep -q "astlinux=wrap" /proc/cmdline; then - - echo 0 > /sys/class/leds/wrap::error/brightness - fi - - if grep -q "astlinux=net5501" /proc/cmdline; then - - /usr/sbin/functions errorled_net5501 off - fi - - if grep -q "astlinux=alix" /proc/cmdline; then - - echo 0 > /sys/class/leds/alix:2/brightness - fi - - # LED control for Alix and WRAP boards (after finished booting) - # "/mnt/kd/rc.ledcontrol" can override these settings - if [ -x /mnt/kd/rc.ledcontrol ]; then - /mnt/kd/rc.ledcontrol - else - 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 - if [ -n "$EXTIF" ]; then - echo netdev > /sys/class/leds/wrap::extra/trigger - echo "$EXTIF" > /sys/class/leds/wrap::extra/device_name - echo "enabled" > /sys/class/leds/wrap::extra/link - echo "enabled" > /sys/class/leds/wrap::extra/transmit - echo "enabled" > /sys/class/leds/wrap::extra/receive - fi - fi - - 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 - if [ -n "$EXTIF" ]; then - echo netdev > /sys/class/leds/alix:3/trigger - echo "$EXTIF" > /sys/class/leds/alix:3/device_name - echo "enabled" > /sys/class/leds/alix:3/link - echo "enabled" > /sys/class/leds/alix:3/transmit - echo "enabled" > /sys/class/leds/alix:3/receive - - fi - fi - fi - -} - -stop () { - - # Turn on the errorled (on reboot/shutdown) - if grep -q "astlinux=net4801" /proc/cmdline; then - - echo 1 > /sys/class/leds/net48xx::error/brightness - fi - - if grep -q "astlinux=wrap" /proc/cmdline; then - - 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 1 > /sys/class/leds/wrap::error/brightness - echo none > /sys/class/leds/wrap::extra/trigger - echo 0 > /sys/class/leds/wrap::extra/brightness - fi - - if grep -q "astlinux=net5501" /proc/cmdline; then - - /usr/sbin/functions errorled_net5501 on - fi - - if grep -q "astlinux=alix" /proc/cmdline; then - - 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 1 > /sys/class/leds/alix:2/brightness - echo none > /sys/class/leds/alix:3/trigger - echo 0 > /sys/class/leds/alix:3/brightness - fi - -} - -case $1 in - - start|off) - start - ;; - - stop|on) - stop - ;; - - init) - start - ;; - - restart) - stop - sleep 2 - start - ;; - - *) - echo "Usage: start|stop|restart" - ;; - -esac Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K00alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K00alert (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K00alert 2011-12-07 17:18:32 UTC (rev 5294) @@ -0,0 +1 @@ +link ../../init.d/alert \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K00alert ___________________________________________________________________ Added: svn:special + * Deleted: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K99errorled =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K99errorled 2011-12-07 00:55:44 UTC (rev 5293) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K99errorled 2011-12-07 17:18:32 UTC (rev 5294) @@ -1 +0,0 @@ -link ../../init.d/errorled \ No newline at end of file Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99alert (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99alert 2011-12-07 17:18:32 UTC (rev 5294) @@ -0,0 +1 @@ +link ../../init.d/alert \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99alert ___________________________________________________________________ Added: svn:special + * Deleted: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99errorled =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99errorled 2011-12-07 00:55:44 UTC (rev 5293) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S99errorled 2011-12-07 17:18:32 UTC (rev 5294) @@ -1 +0,0 @@ -link ../../init.d/errorled \ No newline at end of file Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-07 00:55:44 UTC (rev 5293) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-07 17:18:32 UTC (rev 5294) @@ -673,6 +673,11 @@ ## Watchdog update period (less than 60 seconds) #WDTIME=30 +## Alert Sounds +## For geni586 and geni586-serial board types, sounds can be generated at startup and shutdown. +## Define which sounds should be generated, space separated, disabled by default. +#ALERT_SOUNDS="startup shutdown" + ## ISDN Configuration ## If this variable exists I will try to load the proper modules, but you ## need to tell me how you want to setup your card. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-08 15:57:08
|
Revision: 5297 http://astlinux.svn.sourceforge.net/astlinux/?rev=5297&view=rev Author: abelbeck Date: 2011-12-08 15:57:02 +0000 (Thu, 08 Dec 2011) Log Message: ----------- cleanup, remove old blights script and configs Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Removed Paths: ------------- branches/1.0/project/astlinux/target_skeleton/usr/sbin/blights Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 15:52:15 UTC (rev 5296) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 15:57:02 UTC (rev 5297) @@ -691,15 +691,6 @@ ## AstLinux lets you use this variable to change the I/O scheduler per device #IOSCHED="hda:noop" -## Blinkenlights -## I have a simple script to make the lights on Soekris/WRAP boards blink. -## It supports a few options. LED_NUM is the number to blink. -## WRAP supports 2 (error), or 3 (extra) - default -## Soekris supports 2 (error) -## LED_TIME is the number of seconds to wait between blinking cycles. 1 is the default. -#LED_NUM=3 -#LED_TIME=1 - ## APC UPS Support via apcupsd ## Monitor and safely shut down the system (as well as perform other actions) upon the ## loss of power when connected to a UPS that AstLinux monitors. Deleted: branches/1.0/project/astlinux/target_skeleton/usr/sbin/blights =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/blights 2011-12-08 15:52:15 UTC (rev 5296) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/blights 2011-12-08 15:57:02 UTC (rev 5297) @@ -1,42 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -if `grep -q "astlinux=net4801" /proc/cmdline` -then -LED_PATH="/sys/class/leds/net48xx:error/brightness" -LED_NUM=1 -fi - -if `grep -q "astlinux=wrap" /proc/cmdline` -if [ "$LED_NUM" = "1" ] -then -echo "Controlling the power led on WRAP is no longer supported" -exit 1 -fi - -if [ "$LED_NUM" = "2" ] -then -LED_PATH="/sys/class/leds/wrap:error/brightness" -fi - -if [ "$LED_NUM" = "3" ] -then -LED_PATH="/sys/class/leds/wrap:extra/brightness" -fi - -fi - -if [ "$LED_NUM" -a "$LED_TIME" ] -then -while true -do -echo 1 > $LED_PATH -sleep $LED_TIME -echo 0 > $LED_PATH -sleep $LED_TIME -done -else -exit 1 -fi - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-08 16:04:15
|
Revision: 5298 http://astlinux.svn.sourceforge.net/astlinux/?rev=5298&view=rev Author: abelbeck Date: 2011-12-08 16:04:09 +0000 (Thu, 08 Dec 2011) Log Message: ----------- cleanup, remove old netmon script and configs Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Removed Paths: ------------- branches/1.0/project/astlinux/target_skeleton/usr/sbin/netmon Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 15:57:02 UTC (rev 5297) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 16:04:09 UTC (rev 5298) @@ -783,18 +783,6 @@ ## I attempt to bring up the WAN interface. #WANDELAY=60 -## Netmon Support -## Netmon is a daemon that may run to monitor your internet connection. By default, -## it will try to ping the default gateway of the system. If the gateway cannot -## be reached, netmon will take the action you have defined in your action script. -## /etc/netmon.script and /mnt/kd/netmon.script - if they are executable. -## AND attempt to restart the connection, based on the connection type. -## You can also set the destination address manually, if you wish. -#NETMON=yes -#CHKHOST="www.google.com" -#CHKMETH="ICMP" # ICMP ping -#CHKMETH="ARP" #arping (remember uses ARP - layer 2) - ## ATM Interface ## Variables ATM_CIRCUIT[0-3] and ATM_PARAMS[0-3] correspond to nas[0-3] interface references ## For example, if nas0 is defined as an interface, ATM_CIRCUIT0 and ATM_PARAMS0 will Deleted: branches/1.0/project/astlinux/target_skeleton/usr/sbin/netmon =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/netmon 2011-12-08 15:57:02 UTC (rev 5297) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/netmon 2011-12-08 16:04:09 UTC (rev 5298) @@ -1,108 +0,0 @@ -#!/bin/sh - -PATH=/opt/bin:/opt/sbin:/usr/sbin:/bin:/usr/bin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin - -. /etc/rc.conf - -IP=`which ip` - -if [ ! -x $IP ]; then - echo "You don't have iproute2 installed" 1>&2 - exit 1 -fi - -if [ -z "$NETMON" ]; then - exit -fi - -if [ -n "$CHKMETH" ]; then - METHOD="$CHKMETH" -else - METHOD=ICMP -fi - -if [ -n "$EXTIP" ]; then - CONTYPE=STATIC -else - CONTYPE=DHCP -fi - -if [ -n "$PPPOEIF" ]; then - CONTYPE=PPPOE - #force ICMP for PPPoE - METHOD=ICMP -fi - -#get default route -DEFAULT="`ip route | grep default`" -if [ -n "$DEFAULT" ]; then - DEST=`echo $DEFAULT | cut -d' ' -f3` -fi - -if [ -n "$CHKHOST" ]; then - DEST="$CHKHOST" -fi - -case $METHOD in - -ICMP) - ping -c 5 -q $DEST >/dev/null - ;; - -ARP) - arping -fq -c 5 $DEST - ;; - -esac - -STATUS=$? - -case $STATUS in - -0) - if [ -x /etc/netmon.script ]; then - /etc/netmon.script UP - fi - - if [ -x /mnt/kd/netmon.script ]; then - /mnt/kd/netmon.script UP - fi - ;; - -*) - # restart net connection - logger "netmon reports connection down - restarting" - - if [ -x /etc/netmon.script ]; then - /etc/netmon.script DOWN - fi - - if [ -x /mnt/kd/netmon.script ]; then - /mnt/kd/netmon.script DOWN - fi - - case $CONTYPE in - - DHCP) - killall udhcpc 2>/dev/null - sleep 2 - udhcpc -b -s /etc/udhcpc.script -i $EXTIF >/dev/null - ;; - - PPPOE) - killall pppd 2>/dev/null - sleep 2 - pppoe-start >/dev/null - ;; - - STATIC) - ;; - - *) - ;; - - esac - ;; - -esac - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-08 16:18:53
|
Revision: 5299 http://astlinux.svn.sourceforge.net/astlinux/?rev=5299&view=rev Author: abelbeck Date: 2011-12-08 16:18:44 +0000 (Thu, 08 Dec 2011) Log Message: ----------- cleanup, deprecate variable TZ_TIMEZONE, but continue automatically generating /etc/TZ as some apps may still reference it. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-08 16:04:09 UTC (rev 5298) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-08 16:18:44 UTC (rev 5299) @@ -315,7 +315,7 @@ ln -sf /stat/etc/localtime /tmp/etc/localtime fi - #uclibc style TZ support + # /etc/TZ Timezone support if [ -z "$TZ_TIMEZONE" -a -f /etc/localtime ]; then TZ_TIMEZONE=$(tail -n1 /etc/localtime) fi Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 16:04:09 UTC (rev 5298) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-08 16:18:44 UTC (rev 5299) @@ -34,11 +34,6 @@ ## GMT (UTC) is the default #TIMEZONE=America/Chicago -## uClibc Timezone -## See http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html -## Note: automatically generated from /etc/localtime if not defined. -#TZ_TIMEZONE="CST6CDT,M3.2.0/2,M11.1.0/2" - ## Time Server ## Define the NTP server that AstLinux will sync against upon bootup. ## It is also the server that the running ntpd process will use This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-23 17:49:51
|
Revision: 5334 http://astlinux.svn.sourceforge.net/astlinux/?rev=5334&view=rev Author: abelbeck Date: 2011-12-23 17:49:44 +0000 (Fri, 23 Dec 2011) Log Message: ----------- cleanup, remove old autosupport script and show drive examples as 'sda' Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Removed Paths: ------------- branches/1.0/project/astlinux/target_skeleton/usr/sbin/autosupport Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-23 00:42:26 UTC (rev 5333) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-23 17:49:44 UTC (rev 5334) @@ -284,7 +284,7 @@ echo "Runnix vfat partition re-mounted read-only" fi else - echo "Runnix vfat partition label not found, use: dosfslabel /dev/hda1 RUNNIX" 1>&2 + echo "Runnix vfat partition label not found, use: dosfslabel /dev/sda1 RUNNIX" 1>&2 fi fi fi Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-23 00:42:26 UTC (rev 5333) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-23 17:49:44 UTC (rev 5334) @@ -650,7 +650,7 @@ ## The Linux kernel has several I/O schedulers available. ## It is important to optimize everything you can in an embedded system ## AstLinux lets you use this variable to change the I/O scheduler per device -#IOSCHED="hda:noop" +#IOSCHED="sda:noop" ## APC UPS Support via apcupsd ## Monitor and safely shut down the system (as well as perform other actions) upon the Deleted: branches/1.0/project/astlinux/target_skeleton/usr/sbin/autosupport =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/autosupport 2011-12-23 00:42:26 UTC (rev 5333) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/autosupport 2011-12-23 17:49:44 UTC (rev 5334) @@ -1,155 +0,0 @@ -#!/bin/sh -# -# Collect support information -# -# Copyright (C) 2005, Digium, Inc. -# -# Written by John Bigelow (su...@di...) -# -# Distributed under the terms of the GNU General Public -# License -# - -OUTPUT=$HOME/digiuminfo - -if [ $UID -ne 0 ]; then - - echo "You must be root to run this." - -exit 1 -fi - -echo -echo "This will gather information about your system such as:" -echo "pci listing, dmesg, running processes, and kernel version" -echo "To continue press 'y', to quit press any other key" -read ans - -if [ "$ans" = "y" ]; then - - rm -f $OUTPUT - - echo "------------------" >> $OUTPUT; - echo "PCI LIST " >> $OUTPUT; - echo "------------------" >> $OUTPUT; - lspci -vb >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "INTERRUPTS" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - cat /proc/interrupts >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "DMESG OUTPUT" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - dmesg >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "RUNNING PROCESSES" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - ps aux >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "KERNEL VERSION" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - uname -a >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "CPU INFO" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - cat /proc/cpuinfo >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "HDPARM STATUS" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - hdparm /dev/hda >> $OUTPUT; - hdparm -i /dev/hda >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "ZAPTEL CONFIG" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - grep -v '^#' /etc/zaptel.conf >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "ZAPATA CONFIG" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - grep -v '^;' /etc/asterisk/zapata.conf >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - - echo "------------------" >> $OUTPUT; - echo "EXTENSIONS CONFIG" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - grep -v '^;' /etc/asterisk/extensions.conf >> $OUTPUT; - echo >> $OUTPUT; - echo >> $OUTPUT; - -else - echo "terminated"; -exit -fi - -echo -echo "Digium may require root level access to the system to help debug"; -echo "the problem you are experiencing. Do you want to provide login"; -echo "information at this time?"; -echo "Press 'y' for yes and any other key to exit and save the previous info collected" -read login - -if [ "$login" = "y" ]; then - - echo "------------------" >> $OUTPUT; - echo "LOGIN INFORMATION" >> $OUTPUT; - echo "------------------" >> $OUTPUT; - - echo - echo "What is your root password?" - read rootpass - - echo - echo "Root pass: "$rootpass >> $OUTPUT - - echo - echo "What is your PUBLIC IP address?" - read ip - - echo "IP address: "$ip >> $OUTPUT - - echo - echo "Please provide any other login information that the technician" - echo "may need to know to login to the system'(press enter if not)'" - read adinfo - - echo "Additional login info: "$adinfo >> $OUTPUT - - echo - echo "All information has been stored in $OUTPUT," - echo "Please attach this file to an email ticket you already" - echo "have open with Digium Tech Support." - -else - echo - echo "All information except login info has been stored in $OUTPUT," - echo "Please send this file to an email ticket you already" - echo "have open with Digium Tech Support." -exit -fi - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2011-12-24 00:01:34
|
Revision: 5336 http://astlinux.svn.sourceforge.net/astlinux/?rev=5336&view=rev Author: abelbeck Date: 2011-12-24 00:01:28 +0000 (Sat, 24 Dec 2011) Log Message: ----------- remove DMA_DEV rc.conf variable support, the default libata.dma=3 should work for most cases, and the new 'set-kcmd libata.dma=N' command will cover the remaining. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-23 23:46:11 UTC (rev 5335) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2011-12-24 00:01:28 UTC (rev 5336) @@ -350,12 +350,6 @@ mount -o remount,size=$TMP_SIZE /tmp fi - if [ -n "$DMA_DEV" ]; then - for i in $DMA_DEV; do - hdparm -q -d1 $i - done - fi - # Not needed anymore ? #ldconfig -C /tmp/etc/ld.so.cache /lib /usr/lib Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-23 23:46:11 UTC (rev 5335) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-24 00:01:28 UTC (rev 5336) @@ -641,11 +641,6 @@ ## Define which sounds should be generated, space separated, disabled by default. #ALERT_SOUNDS="startup shutdown" -## IDE Drive configuration -## Some CF cards are not detected properly if DMA is enabled. -## For IDE drives, DMA is disabled except for the devices listed below. -#DMA_DEV="/dev/hdc" - ## I/O Scheduler configuration ## The Linux kernel has several I/O schedulers available. ## It is important to optimize everything you can in an embedded system This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-01-21 22:14:05
|
Revision: 5400 http://astlinux.svn.sourceforge.net/astlinux/?rev=5400&view=rev Author: abelbeck Date: 2012-01-21 22:13:59 +0000 (Sat, 21 Jan 2012) Log Message: ----------- support ENV variables, http_proxy, https_proxy and ftp_proxy via rc.conf variables using HTTP_PROXY, HTTPS_PROXY and FTP_PROXY respectively Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/profile branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/profile =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/profile 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/etc/profile 2012-01-21 22:13:59 UTC (rev 5400) @@ -1,5 +1,22 @@ export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin" +# Define and export xxx_proxy environmental variables +# This is also done in /etc/rc for startup services +if [ -f /etc/rc.conf ] && grep -q '^[A-Z]*_PROXY=' /etc/rc.conf; then + eval $( + . /etc/rc.conf + if [ -n "$HTTP_PROXY" ]; then + echo "export http_proxy=\"$HTTP_PROXY\"" + fi + if [ -n "$HTTPS_PROXY" ]; then + echo "export https_proxy=\"$HTTPS_PROXY\"" + fi + if [ -n "$FTP_PROXY" ]; then + echo "export ftp_proxy=\"$FTP_PROXY\"" + fi + ) +fi + # This fixes the backspace when telnetting in. if [ "$TERM" != "linux" ]; then stty erase ^? Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2012-01-21 22:13:59 UTC (rev 5400) @@ -341,7 +341,19 @@ touch /var/log/wtmp fi - #Resize filesystems if we need to... + # Define and export xxx_proxy environmental variables + # This is also done in /etc/profile for new logins + if [ -n "$HTTP_PROXY" ]; then + export http_proxy="$HTTP_PROXY" + fi + if [ -n "$HTTPS_PROXY" ]; then + export https_proxy="$HTTPS_PROXY" + fi + if [ -n "$FTP_PROXY" ]; then + export ftp_proxy="$FTP_PROXY" + fi + + # Resize filesystems if we need to... if [ -n "$VAR_SIZE" ]; then mount -o remount,size=$VAR_SIZE /var fi @@ -350,9 +362,6 @@ mount -o remount,size=$TMP_SIZE /tmp fi - # Not needed anymore ? - #ldconfig -C /tmp/etc/ld.so.cache /lib /usr/lib - dmesg > /var/run/dmesg.boot echo "going to runlevel $ASTRLEVEL..." Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-01-20 16:50:06 UTC (rev 5399) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-01-21 22:13:59 UTC (rev 5400) @@ -400,7 +400,15 @@ ## ADNAME is automatically (always) disabled whenever the web interface Network Tab is saved. ADNAME="AstLinux PBX" +## Proxy ENV variables (http_proxy, ftp_proxy, etc.) for curl, wget, etc. +## Format: http://user:pass@proxyhost:proxyport" +## The "user" and "pass" are optional +## Note: A reboot is required after changes to the XXX_PROXY variables. +#HTTP_PROXY="http://proxyhost:8080" +#HTTPS_PROXY="https://proxyhost:8080" +#FTP_PROXY="http://user:pass@proxyhost:8080" + ##################################################################### ### VPN Services ### ##################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2012-04-11 00:09:29
|
Revision: 5510 http://astlinux.svn.sourceforge.net/astlinux/?rev=5510&view=rev Author: abelbeck Date: 2012-04-11 00:09:23 +0000 (Wed, 11 Apr 2012) Log Message: ----------- network, add rc.conf variables EXTIP_ALIAS and EXT2IP_ALIAS, when defined with a 'static' EXTIP (or EXT2IP), alias interfaces for the IPv4 addresses in the variable are created. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/functions branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/functions =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/functions 2012-04-10 17:47:56 UTC (rev 5509) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/functions 2012-04-11 00:09:23 UTC (rev 5510) @@ -265,7 +265,7 @@ find_ip_from_if() { ip -o addr show dev "$1" \ - | awk '$3 == "inet" { split($4, field, "/"); print field[1]; }' + | awk '$3 == "inet" { split($4, field, "/"); print field[1]; nextfile; }' } nthfield() Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2012-04-10 17:47:56 UTC (rev 5509) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2012-04-11 00:09:23 UTC (rev 5510) @@ -102,6 +102,31 @@ esac } +alias_interface() +{ + local action="$1" interface="$2" alias_list="$3" cnt alias IFS + + case $action in + + add) + cnt=1 + unset IFS + for alias in $alias_list; do + ip addr add $alias/32 dev $interface label ${interface}:${cnt} + cnt=$((cnt+1)) + done + ;; + + delete) + unset IFS + for alias in $alias_list; do + ip addr delete $alias/32 dev $interface + done + ;; + + esac +} + init () { if [ -n "$IFRENAME" ]; then @@ -405,6 +430,9 @@ ;; *) ifconfig $EXTIF $EXTIP netmask $EXTNM + if [ -n "$EXTIP_ALIAS" ]; then + alias_interface add $EXTIF "$EXTIP_ALIAS" + fi if [ "$IPV6" = "yes" -a -n "$EXTIPV6" ]; then ip -6 addr add $EXTIPV6 dev $EXTIF fi @@ -431,6 +459,9 @@ ;; *) ifconfig $EXT2IF $EXT2IP netmask $EXT2NM + if [ -n "$EXT2IP_ALIAS" ]; then + alias_interface add $EXT2IF "$EXT2IP_ALIAS" + fi if [ "$IPV6" = "yes" -a -n "$EXT2IPV6" ]; then ip -6 addr add $EXT2IPV6 dev $EXT2IF fi @@ -497,11 +528,17 @@ if [ -n "$EXTIF" -a "$EXTIF" != "none" ]; then echo "Bringing down $EXTIF..." + if [ -n "$EXTIP_ALIAS" ]; then + alias_interface delete $EXTIF "$EXTIP_ALIAS" + fi ifconfig $EXTIF down fi if [ -n "$EXT2IF" -a "$EXT2IF" != "none" ]; then echo "Bringing down $EXT2IF..." + if [ -n "$EXT2IP_ALIAS" ]; then + alias_interface delete $EXT2IF "$EXT2IP_ALIAS" + fi ifconfig $EXT2IF down fi Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-04-10 17:47:56 UTC (rev 5509) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-04-11 00:09:23 UTC (rev 5510) @@ -703,6 +703,13 @@ ## If you are using PPPoE don't worry. We automatically handle those MTU issues #IFMTU="eth2.41:1496 eth0:1492" +## External Interface Alias (Virtual) IPv4 Addresses +## If EXTIP (or EXT2IP) is set, using a 'static' configuration, alias interfaces +## on EXTIF (or EXT2IF) may be defined creating $EXTIF:1, $EXTIF:2, etc. . +## Multiple IPv4 addresses are space separated. +#EXTIP_ALIAS="192.168.25.3 192.168.25.4" +#EXT2IP_ALIAS="192.168.25.3 192.168.25.4" + ## IFRENAME Support ## If for some reason you need to move your interfaces around before ## they are configured, you can do that here if you built your system This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-02-27 17:12:55
|
Revision: 5971 http://astlinux.svn.sourceforge.net/astlinux/?rev=5971&view=rev Author: abelbeck Date: 2013-02-27 17:12:48 +0000 (Wed, 27 Feb 2013) Log Message: ----------- Add Debian style /etc/timezone file defined as validated TIMEZONE variable - required for PHP 5.4 at a later time. Display an error if the TIMEZONE variable is invalid, and remove old unused /mnt/kd and /stat TZ fallback methods. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/project/astlinux/target_skeleton/etc/timezone Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2013-02-25 17:46:56 UTC (rev 5970) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2013-02-27 17:12:48 UTC (rev 5971) @@ -322,12 +322,14 @@ fi # glibc/zoneinfo style TZ support - if [ -n "$TIMEZONE" -a -f "/usr/share/zoneinfo/$TIMEZONE" ]; then + if [ -z "$TIMEZONE" ]; then + TIMEZONE="UTC" + fi + if [ -f "/usr/share/zoneinfo/$TIMEZONE" ]; then ln -sf "/usr/share/zoneinfo/$TIMEZONE" /tmp/etc/localtime - elif [ -f /mnt/kd/localtime ]; then - ln -sf /mnt/kd/localtime /tmp/etc/localtime - elif [ -f /stat/etc/localtime ]; then - ln -sf /stat/etc/localtime /tmp/etc/localtime + echo "$TIMEZONE" > /tmp/etc/timezone + else + echo "Invalid Timezone: $TIMEZONE" >&2 fi # /etc/TZ Timezone support @@ -336,10 +338,6 @@ fi if [ -n "$TZ_TIMEZONE" ]; then echo "$TZ_TIMEZONE" > /tmp/etc/TZ - elif [ -f /mnt/kd/TZ ]; then - cp /mnt/kd/TZ /tmp/etc/TZ - elif [ -f /stat/etc/TZ ]; then - cp /stat/etc/TZ /tmp/etc/TZ fi if [ "$PERSISTLOG" = "yes" ]; then Added: branches/1.0/project/astlinux/target_skeleton/etc/timezone =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/timezone (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/timezone 2013-02-27 17:12:48 UTC (rev 5971) @@ -0,0 +1 @@ +link /tmp/etc/timezone \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/timezone ___________________________________________________________________ Added: svn:special + * Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-25 17:46:56 UTC (rev 5970) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-27 17:12:48 UTC (rev 5971) @@ -29,10 +29,12 @@ HOSTNAME=pbx ## Timezone -## If you define this variable, AstLinux will link this file from -## /usr/share/zoneinfo/$TIMEZONE to /etc/localtime on startup -## GMT (UTC) is the default -#TIMEZONE=America/Chicago +## Set the Timezone using the zoneinfo database. Defining TIMEZONE will: +## 1) symlink /usr/share/zoneinfo/$TIMEZONE to /etc/localtime +## 2) define /etc/timezone with string $TIMEZONE (Debian style) +## 3) define /etc/TZ with trailing string from /etc/localtime +## "UTC" is the default TIMEZONE +#TIMEZONE="America/Chicago" ## Time Server ## Define the NTP server that AstLinux will sync against upon bootup. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-08-16 17:56:42
|
Revision: 6629 http://sourceforge.net/p/astlinux/code/6629 Author: abelbeck Date: 2014-08-16 17:56:34 +0000 (Sat, 16 Aug 2014) Log Message: ----------- LED tweaks for new kernel Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/usr/sbin/functions Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2014-08-16 02:54:20 UTC (rev 6628) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/alert 2014-08-16 17:56:34 UTC (rev 6629) @@ -120,7 +120,7 @@ if grep -q "astlinux=net5501" /proc/cmdline; then - /usr/sbin/functions errorled_net5501 off + echo 0 >/sys/class/leds/error/brightness fi if grep -q "astlinux=alix" /proc/cmdline; then @@ -140,9 +140,7 @@ if [ -n "$EXTIF" ]; then echo netdev > /sys/class/leds/wrap::extra/trigger echo "$EXTIF" > /sys/class/leds/wrap::extra/device_name - echo "enabled" > /sys/class/leds/wrap::extra/link - echo "enabled" > /sys/class/leds/wrap::extra/transmit - echo "enabled" > /sys/class/leds/wrap::extra/receive + echo "link tx rx" > /sys/class/leds/wrap::extra/mode fi fi @@ -153,10 +151,7 @@ if [ -n "$EXTIF" ]; then echo netdev > /sys/class/leds/alix:3/trigger echo "$EXTIF" > /sys/class/leds/alix:3/device_name - echo "enabled" > /sys/class/leds/alix:3/link - echo "enabled" > /sys/class/leds/alix:3/transmit - echo "enabled" > /sys/class/leds/alix:3/receive - + echo "link tx rx" > /sys/class/leds/alix:3/mode fi fi fi @@ -189,8 +184,8 @@ fi if grep -q "astlinux=net5501" /proc/cmdline; then - - /usr/sbin/functions errorled_net5501 on + + echo 1 >/sys/class/leds/error/brightness fi if grep -q "astlinux=alix" /proc/cmdline; then Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2014-08-16 02:54:20 UTC (rev 6628) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2014-08-16 17:56:34 UTC (rev 6629) @@ -182,6 +182,7 @@ net4801) modprobe leds_net48xx + sleep 1 echo 1 >/sys/class/leds/net48xx::error/brightness ;; @@ -190,24 +191,26 @@ modprobe leds_wrap modprobe ledtrig-heartbeat modprobe ledtrig-netdev + sleep 1 echo 1 >/sys/class/leds/wrap::error/brightness ;; net5501) - # CS5535/CS5536 high-res timer (MFGPT) events - #modprobe cs5535-clockevt irq=6 - + modprobe cs5535_mfd modprobe gpio_cs5535 - /usr/sbin/functions errorled_net5501 on + modprobe leds_net5501 + sleep 1 + echo 1 >/sys/class/leds/error/brightness ;; alix) - # CS5535/CS5536 high-res timer (MFGPT) events - #modprobe cs5535-clockevt irq=5 - + modprobe cs5535_mfd modprobe gpio_cs5535 + modprobe leds_gpio modprobe ledtrig-heartbeat modprobe ledtrig-netdev + sleep 1 + echo 1 >/sys/class/leds/alix:1/brightness echo 1 >/sys/class/leds/alix:2/brightness ;; Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/functions =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/functions 2014-08-16 02:54:20 UTC (rev 6628) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/functions 2014-08-16 17:56:34 UTC (rev 6629) @@ -61,25 +61,6 @@ fi } -errorled_net5501() -{ - local GPIO=6 sys_gpio="/sys/class/gpio" value - - case $1 in - off|low|0) value=0 ;; - *) value=1 ;; - esac - - if [ -e "${sys_gpio}/export" ]; then - echo $GPIO > "${sys_gpio}/export" - echo "out" > "${sys_gpio}/GPIO${GPIO}/direction" - echo $value > "${sys_gpio}/GPIO${GPIO}/value" - echo $GPIO > "${sys_gpio}/unexport" - else - echo "errorled_net5501: No '${sys_gpio}/export' exixts." >&2 - fi -} - # main case $1 in @@ -91,15 +72,7 @@ fi gen_kd_files "$2" ;; - -errorled_net5501) - if [ -z "$2" ]; then - echo "Usage: /usr/sbin/functions errorled_net5501 on|off" - exit 1 - fi - errorled_net5501 "$2" - ;; - + *) echo "Usage: /usr/sbin/functions function_selector [args]" exit 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-03 03:48:12
|
Revision: 6792 http://sourceforge.net/p/astlinux/code/6792 Author: abelbeck Date: 2014-11-03 03:48:00 +0000 (Mon, 03 Nov 2014) Log Message: ----------- failover, new service 'failover', using wan-failover background script, disabled by default, enabled with WAN_FAILOVER_TARGETS Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K06failover branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S90failover branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover Added: branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-03 03:48:00 UTC (rev 6792) @@ -0,0 +1,81 @@ +#!/bin/sh + +. /etc/rc.conf + +WAN_LOCKFILE="/var/lock/wan-failover.lock" +WAN_PIDFILE="/var/run/wan-failover.pid" + +init() +{ + : +} + +start() +{ + if [ -n "$WAN_FAILOVER_TARGETS" ] && [ ! -f "$WAN_LOCKFILE" ]; then + echo "Starting WAN Failover..." + + # Start the background process + wan-failover + fi +} + +stop() +{ + if [ -f "$WAN_PIDFILE" ]; then + echo "Stopping WAN Failover..." + + # + # kill $(cat $WAN_PIDFILE) + # is not necessary. Removing the PID file is sufficient + # because the background process monitors its PID file. + # + rm -f "$WAN_PIDFILE" + + # Wait for the background process to exit + cnt=10 + while [ $cnt -gt 0 -a -f "$WAN_LOCKFILE" ]; do + cnt=$((cnt - 1)) + sleep 1 + done + fi +} + +dotest() +{ + if [ -f "$WAN_PIDFILE" ]; then + echo "Testing WAN Failover..." + kill -HUP $(cat "$WAN_PIDFILE") + fi +} + +case $1 in + +start) + start + ;; + +stop) + stop + ;; + +init) + init + start + ;; + +restart) + stop + start + ;; + +test) + dotest + ;; + +*) + echo "Usage: start|stop|restart|test" + ;; + +esac + Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K06failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K06failover (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K06failover 2014-11-03 03:48:00 UTC (rev 6792) @@ -0,0 +1 @@ +link ../../init.d/failover \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K06failover ___________________________________________________________________ Added: svn:special ## -0,0 +1 ## +* \ No newline at end of property Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S90failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S90failover (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S90failover 2014-11-03 03:48:00 UTC (rev 6792) @@ -0,0 +1 @@ +link ../../init.d/failover \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S90failover ___________________________________________________________________ Added: svn:special ## -0,0 +1 ## +* \ No newline at end of property Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-02 21:52:07 UTC (rev 6791) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-03 03:48:00 UTC (rev 6792) @@ -126,25 +126,6 @@ ## 192.168.0.100 - 192.168.0.220 #DHCPRANGE="100:220" -## Backup External Interface -## The backup external interface will be used as a backup default route -## in case the primary becomes unavailable. The firewall rules, routing, etc -## apply identically to both interfaces. THIS CURRENTLY ONLY WORKS IF BOTH -## EXTIF AND EXT2IF HAVE STATIC IP ADDRESSES. -#EXT2IF=eth1 -## -## These variables are required for internet failover. They will do nothing -## if either EXTIF or EXT2IF are set to dhcp. They will use the same DNS -## servers as above. -#EXT2IP="192.168.25.2" -#EXT2NM="255.255.255.0" -#EXT2GW="192.168.25.1" -## -## Internet failover timeout. How long to wait before switching default routes. -## If failover is otherwise setup - EXTIP, EXT2IP, EXT2IF, EXT2GW the default -## will be 10 seconds. You can change that here. -#FAILTIME=10 - ## VLANS ## Configure vlans here. These will be created on boot BEFORE INTIF, etc are ## brought up. You can then use these values for INTIF, EXTIF, etc. @@ -163,6 +144,41 @@ #BRIDGE1="ap1 eth0" #BRIDGE2="ath0 eth1" +## Backup External Interface +## The backup external interface will be used as a backup default route +## in case the primary becomes unavailable. The firewall rules, routing, etc +## apply identically to both interfaces. +#EXT2IF="eth1" +#EXT2IP="192.168.25.2" +#EXT2NM="255.255.255.0" +#EXT2GW="192.168.25.1" +## +## Internet failover timeout. How long to wait before switching default routes. +## If failover is otherwise setup - EXTIP, EXT2IP, EXT2IF, EXT2GW the default +## will be 10 seconds. You can change that here. +#FAILTIME=10 + +## WAN Failover +## Monitor external "targets" to switch between primary and secondary default gateways +## Primary gateway is on: EXTIF +## Secondary gateway is on: EXT2IF or via WAN_FAILOVER_SECONDARY_GW +## Note: WAN_FAILOVER_TARGETS will continue to not be reachable when the primary fails and on secondary. +## +#WAN_FAILOVER_TARGETS="8.8.4.4 4.2.2.3" # Test targets, space separated list of IPv4 addresses +#WAN_FAILOVER_SECONDARY_GW="" # (optional) Only needed if the gateway is not off EXT2IF +#WAN_FAILOVER_SECONDARY_GWIPV6="" # (optional) IPv6 gateway if WAN_FAILOVER_SECONDARY_GW is defined +#WAN_FAILOVER_TEST_INTERVAL="20" # Test target(s) interval in seconds +#WAN_FAILOVER_MAX_LATENCY="1000" # Max latency in millisec +#WAN_FAILOVER_THRESHOLD="3" # Failed target threshold before failover +#WAN_FAILOVER_SECONDARY_DELAY="900" # Hysteresis delay in seconds after switch to secondary +#WAN_FAILOVER_PRIMARY_DELAY="60" # Hysteresis delay in seconds after switch to primary +#WAN_FAILOVER_VERBOSITY="6" # Syslog logging: "3" Error, "6" Info, "9" Debug, defaults to "3" +## Notifications +#WAN_FAILOVER_NOTIFY="no...@my..." # Notify via email, space separate multiple email addresses +#WAN_FAILOVER_NOTIFY_FROM="wan...@my..." # Optional, From: email address +## Note: The optional executable script /mnt/kd/wan-failover.script, if it exists, will be called on +## after failover and failback with the first argument of: SECONDARY or PRIMARY + ## PPPoE support from Roaring Penguin. If you define PPPOEUSER below, AstLinux ## will run rp-pppoe on your $PPPOEIF. You will also need to set EXTIF to "ppp0". ## PPPoE kernel support Added: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-03 03:48:00 UTC (rev 6792) @@ -0,0 +1,370 @@ +#!/bin/bash +## +## Linux WAN failover script. +## +## Original: http://code.google.com/p/wanfailoverscript/ +## Copyright 2010 Louwrentius +## +## Copyright 2014 Modified for AstLinux +## +## Licence = GNU GPL +## + +. /etc/rc.conf + +LOCKFILE="/var/lock/wan-failover.lock" +PIDFILE="/var/run/wan-failover.pid" +SCRIPTFILE="/mnt/kd/wan-failover.script" + +TARGETS="$WAN_FAILOVER_TARGETS" +INTERVAL="${WAN_FAILOVER_TEST_INTERVAL:-20}" +MAX_LATENCY="${WAN_FAILOVER_MAX_LATENCY:-1000}" +THRESHOLD="${WAN_FAILOVER_THRESHOLD:-3}" +SECONDARY_DELAY="${WAN_FAILOVER_SECONDARY_DELAY:-900}" +PRIMARY_DELAY="${WAN_FAILOVER_PRIMARY_DELAY:-60}" +VERBOSITY="${WAN_FAILOVER_VERBOSITY:-6}" +NOTIFY="$WAN_FAILOVER_NOTIFY" # Who to notify with email alerts, space separate +NOTIFY_FROM="$WAN_FAILOVER_NOTIFY_FROM" # From email header (optional) + +TARGETS_FAILED=0 +TEST_INTERVAL=$INTERVAL +NO_OF_TARGETS=0 + +log() { + local TYPE="$1" MESG="$2" + + case $TYPE in + + ERROR) + log2syslog "$TYPE" "$TYPE $MESG" + ;; + + DEBUG) + if [ "$VERBOSITY" = "9" ]; then + log2syslog "$TYPE" "$TYPE $MESG" + fi + ;; + + INFO) + if [ "$VERBOSITY" != "3" ]; then + log2syslog "$TYPE" "$TYPE $MESG" + fi + ;; + + esac +} + +log_all() { + + log "$@" + echo "wan-failover: $2" >&2 +} + +log2mail() { + local TO subject="$1" body="$2" IFS + + unset IFS + for TO in $NOTIFY; do + echo "To: ${TO}${NOTIFY_FROM:+ +From: $NOTIFY_FROM} +Subject: $subject + +$body + +[Generated at $(date "+%H:%M:%S on %B %d, %Y")]" | \ + sendmail -t + done +} + +log2syslog() { + local TYPE="$1" MESG="$2" + + TYPE="$(echo "$TYPE" | tr '[:upper:]' '[:lower:]')" + + logger -t wan-failover -p "daemon.$TYPE" "$MESG" +} + +idle_wait() +{ + local time="$1" cnt=0 + + while [ -f "$PIDFILE" -a $cnt -lt $time ]; do + cnt=$((cnt+1)) + sleep 1 + done +} + +add_target_static_routes() { + local x IFS + + NO_OF_TARGETS=0 + unset IFS + for x in $TARGETS; do + NO_OF_TARGETS=$((NO_OF_TARGETS+1)) + log DEBUG "Adding static route for host $x" + ip route add $x via $PRIMARY_GW dev $EXTIF + done +} + +remove_target_static_routes() { + local x IFS + + unset IFS + for x in $TARGETS; do + ip route delete $x via $PRIMARY_GW dev $EXTIF + done +} + +display_header() { + + log INFO "WAN Link: $ACTIVE_CONNECTION" + log INFO "Primary gateway: $PRIMARY_GW" + log INFO "Secondary gateway: $SECONDARY_GW" + if [ -n "$SECONDARY_GWIPV6" ]; then + log INFO "Secondary IPv6 gateway: $SECONDARY_GWIPV6" + fi + log INFO "Max latency in millisec: $MAX_LATENCY" + log INFO "Threshold before failover: $THRESHOLD" + log INFO "Number of target hosts: $NO_OF_TARGETS" +} + +targets_ok() { + local cnt + + ## Check if the static routes need refreshing + if ! ip route list dev $EXTIF | grep -q "^${FIRST_TARGET//./[.]} "; then + add_target_static_routes + fi + + cnt="$(fping -a -t $MAX_LATENCY $TARGETS 2>/dev/null | wc -l)" + + return $cnt +} + +test_targets() { + local cnt err + + log DEBUG "Test interval between hosts are $TEST_INTERVAL" + + targets_ok + cnt=$? + + if [ $cnt -gt 0 ]; then + if [ $TARGETS_FAILED -gt 0 ] ; then + TARGETS_FAILED=$((TARGETS_FAILED-1)) + fi + if [ "$ACTIVE_CONNECTION" = "PRIMARY" ]; then + TEST_INTERVAL=$INTERVAL + err="DEBUG" + else + TEST_INTERVAL=2 + err="INFO" + fi + log $err "($cnt of $NO_OF_TARGETS) Host Targets OK" + else + if [ $TARGETS_FAILED -lt $THRESHOLD ]; then + TARGETS_FAILED=$((TARGETS_FAILED+1)) + fi + if [ "$ACTIVE_CONNECTION" = "PRIMARY" ]; then + TEST_INTERVAL=2 + err="INFO" + else + TEST_INTERVAL=$INTERVAL + err="DEBUG" + fi + log $err "($((NO_OF_TARGETS-cnt)) of $NO_OF_TARGETS) Host Targets UNREACHABLE" + fi +} + +test_wan_status() { + + test_targets + if [ $TARGETS_FAILED -gt 0 ]; then + log DEBUG "Failed targets is $TARGETS_FAILED, threshold is $THRESHOLD." + fi + check_wan_status + idle_wait $TEST_INTERVAL +} + +switch_to_primary() { + + ip route delete 128.0.0.0/1 via $SECONDARY_GW dev $EXT2IF + ip route delete 0.0.0.0/1 via $SECONDARY_GW dev $EXT2IF + if [ -n "$SECONDARY_GWIPV6" ]; then + ip -6 route delete 2000::/3 via $SECONDARY_GWIPV6 dev $EXT2IF metric 1 + fi + ACTIVE_CONNECTION="PRIMARY" +} + +switch_to_secondary() { + + ip route add 0.0.0.0/1 via $SECONDARY_GW dev $EXT2IF + ip route add 128.0.0.0/1 via $SECONDARY_GW dev $EXT2IF + if [ -n "$SECONDARY_GWIPV6" ]; then + ip -6 route add 2000::/3 via $SECONDARY_GWIPV6 dev $EXT2IF metric 1 + fi + ACTIVE_CONNECTION="SECONDARY" +} + +check_wan_status() { + + if [ $TARGETS_FAILED -ge $THRESHOLD -a "$ACTIVE_CONNECTION" = "PRIMARY" ]; then + switch + elif [ $TARGETS_FAILED -eq 0 -a "$ACTIVE_CONNECTION" = "SECONDARY" ]; then + switch + else + log DEBUG "WAN Link: $ACTIVE_CONNECTION" + fi +} + +gen_body_text() { + + echo "-- Primary '$EXTIF' routes --" + ip route list dev $EXTIF + if [ -n "$SECONDARY_GWIPV6" ]; then + echo "-- IPv6 --" + ip -6 route list dev $EXTIF + fi + echo "--" + echo "-- Secondary '$EXT2IF' routes --" + ip route list dev $EXT2IF + if [ -n "$SECONDARY_GWIPV6" ]; then + echo "-- IPv6 --" + ip -6 route list dev $EXT2IF + fi + echo "--" +} + +switch() { + local MESG BODY + + if [ "$ACTIVE_CONNECTION" = "PRIMARY" ]; then + switch_to_secondary + if [ -x $SCRIPTFILE ]; then + $SCRIPTFILE "SECONDARY" "$EXTIF" "$PRIMARY_GW" "$EXT2IF" "$SECONDARY_GW" "$SECONDARY_GWIPV6" + fi + idle_wait 10 + MESG="Primary WAN link failed on '$HOSTNAME'. Switched to secondary link." + BODY="$(gen_body_text)" + log2mail "$MESG" "$BODY" + log INFO "$MESG" + log DEBUG "Failover Hysteresis started, sleeping for $SECONDARY_DELAY seconds." + idle_wait $SECONDARY_DELAY + + elif [ "$ACTIVE_CONNECTION" = "SECONDARY" ]; then + switch_to_primary + if [ -x $SCRIPTFILE ]; then + $SCRIPTFILE "PRIMARY" "$EXTIF" "$PRIMARY_GW" "$EXT2IF" "$SECONDARY_GW" "$SECONDARY_GWIPV6" + fi + idle_wait 10 + MESG="Primary WAN link OK on '$HOSTNAME'. Switched back to primary link." + BODY="$(gen_body_text)" + log2mail "$MESG" "$BODY" + log INFO "$MESG" + log DEBUG "Failback Hysteresis started, sleeping for $PRIMARY_DELAY seconds." + idle_wait $PRIMARY_DELAY + fi +} + +test_switch() { + + if [ "$ACTIVE_CONNECTION" = "PRIMARY" ]; then + log INFO "Testing failover link, switching to secondary link." + TARGETS_FAILED=$((THRESHOLD+1)) + else + log INFO "Testing ignored, currently using secondary link." + fi +} + +start_monitor() { + + # Robust 'bash' method of creating/testing for a lockfile + if ! ( set -o noclobber; echo "$$" > "$LOCKFILE" ) 2>/dev/null; then + log ERROR "wan-failover: already running, lockfile \"$LOCKFILE\" exists, process id: $(cat "$LOCKFILE")." + return 9 + fi + + trap 'test_switch' HUP + + trap 'remove_target_static_routes; rm -f "$LOCKFILE" "$PIDFILE"; exit $?' INT TERM EXIT + + echo "$BASHPID" > "$PIDFILE" + + log INFO "Starting monitoring of WAN link." + + add_target_static_routes + display_header + + while [ -f "$PIDFILE" ]; do + test_wan_status + done + + remove_target_static_routes + + log INFO "Stopping monitoring of WAN link." + + rm -f "$LOCKFILE" "$PIDFILE" + trap - HUP INT TERM EXIT + + return 0 +} + +## Override the 2nd external interface if WAN_FAILOVER_SECONDARY_GW is defined +if [ -n "$WAN_FAILOVER_SECONDARY_GW" ]; then + EXT2IF="$(ip -o route get $WAN_FAILOVER_SECONDARY_GW | sed -n -r -e 's/^.* dev +([^ ]+).*$/\1/p')" + EXT2GW="$WAN_FAILOVER_SECONDARY_GW" + if [ "$IPV6" = "yes" -a -n "$WAN_FAILOVER_SECONDARY_GWIPV6" ]; then + EXT2GWIPV6="$WAN_FAILOVER_SECONDARY_GWIPV6" + fi +fi + +if [ -z "$EXTIF" ]; then + log_all ERROR "Primary interface is not set, define: EXTIF" + exit 1 +fi +if [ -z "$EXT2IF" ]; then + log_all ERROR "Secondary interface is not set, define: EXT2IF" + exit 1 +fi + +PRIMARY_GW="$(ip route list dev $EXTIF 2>/dev/null | sed -n -r -e 's/^default .*via +([^ ]+).*$/\1/p')" +if [ -z "$PRIMARY_GW" ]; then + log_all ERROR "Primary interface gateway not found, exiting." + exit 1 +fi + +if [ -n "$EXT2GW" ]; then + SECONDARY_GW="$EXT2GW" +elif [ -f "/tmp/udhcpc-${EXT2IF}.conf" ]; then + SECONDARY_GW="$(sed -n -r -e 's/^GW=([0-9.]+).*$/\1/p' "/tmp/udhcpc-${EXT2IF}.conf" | head -n1)" +fi +if [ -z "$SECONDARY_GW" ]; then + log_all ERROR "Secondary interface gateway not found, exiting." + exit 1 +fi + +if [ "$IPV6" = "yes" -a -n "$EXT2GWIPV6" ]; then + SECONDARY_GWIPV6="$EXT2GWIPV6" +else + SECONDARY_GWIPV6="" +fi + +if ! which fping >/dev/null 2>&1; then + log_all ERROR "The command 'fping' is not available, exiting." + exit 1 +fi + +FIRST_TARGET="$(echo $TARGETS | awk '{ print $1; nextfile; }')" +if [ -z "$FIRST_TARGET" ]; then + log_all ERROR "No targets to test availability, define: WAN_FAILOVER_TARGETS" + exit 1 +fi + +if [ "$SECONDARY_GW" = "$(ip route list dev $EXT2IF 2>/dev/null | sed -n -r -e 's|^0.0.0.0/1 .*via +([^ ]+).*$|\1|p')" ]; then + ACTIVE_CONNECTION="SECONDARY" +else + ACTIVE_CONNECTION="PRIMARY" +fi + +start_monitor >/dev/null 2>&1 & + Property changes on: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-03 17:19:30
|
Revision: 6795 http://sourceforge.net/p/astlinux/code/6795 Author: abelbeck Date: 2014-11-03 17:19:26 +0000 (Mon, 03 Nov 2014) Log Message: ----------- network, remove the old FAILTIME variable, superseded by the more configurable WAN_FAILOVER_* options Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-03 17:11:29 UTC (rev 6794) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-03 17:19:26 UTC (rev 6795) @@ -491,15 +491,6 @@ #end static ip on 2nd if fi - if [ -n "$EXTGW" -a -n "$EXT2GW" ]; then - if [ -n "$FAILTIME" ]; then - TIME=$FAILTIME - else - TIME=10 - fi - echo $TIME > /proc/sys/net/ipv4/route/gc_timeout - fi - #DHCP if [ -n "$EXTIF" -a -z "$EXTIP" ] && ! isextppp extif; then udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXTIF.pid -i $EXTIF Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-03 17:11:29 UTC (rev 6794) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-03 17:19:26 UTC (rev 6795) @@ -152,11 +152,6 @@ #EXT2IP="192.168.25.2" #EXT2NM="255.255.255.0" #EXT2GW="192.168.25.1" -## -## Internet failover timeout. How long to wait before switching default routes. -## If failover is otherwise setup - EXTIP, EXT2IP, EXT2IF, EXT2GW the default -## will be 10 seconds. You can change that here. -#FAILTIME=10 ## WAN Failover ## Monitor external "targets" to switch between primary and secondary default gateways This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-04 03:39:21
|
Revision: 6796 http://sourceforge.net/p/astlinux/code/6796 Author: abelbeck Date: 2014-11-04 03:39:14 +0000 (Tue, 04 Nov 2014) Log Message: ----------- wan-failover, add WAN_FAILOVER_ENABLE variable so the feature can be enabled/disabled without clearing WAN_FAILOVER_TARGETS Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-04 03:39:14 UTC (rev 6796) @@ -12,7 +12,7 @@ start() { - if [ -n "$WAN_FAILOVER_TARGETS" ] && [ ! -f "$WAN_LOCKFILE" ]; then + if [ "$WAN_FAILOVER_ENABLE" = "yes" ] && [ ! -f "$WAN_LOCKFILE" ]; then echo "Starting WAN Failover..." # Start the background process Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-04 03:39:14 UTC (rev 6796) @@ -159,6 +159,7 @@ ## Secondary gateway is on: EXT2IF or via WAN_FAILOVER_SECONDARY_GW ## Note: WAN_FAILOVER_TARGETS will continue to not be reachable when the primary fails and on secondary. ## +#WAN_FAILOVER_ENABLE="yes" # Enable with "yes", defaults to "no" #WAN_FAILOVER_TARGETS="8.8.4.4 4.2.2.3" # Test targets, space separated list of IPv4 addresses #WAN_FAILOVER_SECONDARY_GW="" # (optional) Only needed if the gateway is not off EXT2IF #WAN_FAILOVER_SECONDARY_GWIPV6="" # (optional) IPv6 gateway if WAN_FAILOVER_SECONDARY_GW is defined Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-03 17:19:26 UTC (rev 6795) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-04 03:39:14 UTC (rev 6796) @@ -342,6 +342,8 @@ SECONDARY_GW="$EXT2GW" elif [ -f "/tmp/udhcpc-${EXT2IF}.conf" ]; then SECONDARY_GW="$(sed -n -r -e 's/^GW=([0-9.]+).*$/\1/p' "/tmp/udhcpc-${EXT2IF}.conf" | head -n1)" +else + SECONDARY_GW="$PRIMARY_GW" fi if [ -z "$SECONDARY_GW" ]; then log_all ERROR "Secondary interface gateway not found, exiting." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-04 20:33:18
|
Revision: 6798 http://sourceforge.net/p/astlinux/code/6798 Author: abelbeck Date: 2014-11-04 20:33:14 +0000 (Tue, 04 Nov 2014) Log Message: ----------- network, fix long term issues with dual-WAN's, with dual-DHCP only EXTIF updates /tmp/mydhcpip and DNS files, with DHCP and Static addressing only EXTIF sets the default route, two new variables: EXT2ROUTES and EXT2ROUTESIPV6 allow setting EXT2IF static routes via Static and DHCP Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-04 03:45:02 UTC (rev 6797) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-04 20:33:14 UTC (rev 6798) @@ -483,10 +483,14 @@ esac if [ -n "$EXT2GW" ]; then - ip route add default via $EXT2GW dev $EXT2IF + for x in $EXT2ROUTES; do + ip route add $x via $EXT2GW dev $EXT2IF + done fi if [ "$IPV6" = "yes" -a -n "$EXT2GWIPV6" ]; then - ip -6 route add default via $EXT2GWIPV6 dev $EXT2IF metric 1 + for x in $EXT2ROUTESIPV6; do + ip -6 route add $x via $EXT2GWIPV6 dev $EXT2IF metric 1 + done fi #end static ip on 2nd if fi @@ -511,7 +515,9 @@ # No DHCPv6 - Static IPv6 if defined if [ "$IPV6" = "yes" -a -n "$EXT2IPV6" -a -n "$EXT2GWIPV6" ]; then ip -6 addr add $EXT2IPV6 dev $EXT2IF - ip -6 route add default via $EXT2GWIPV6 dev $EXT2IF metric 1 + for x in $EXT2ROUTESIPV6; do + ip -6 route add $x via $EXT2GWIPV6 dev $EXT2IF metric 1 + done fi fi Modified: branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-04 03:45:02 UTC (rev 6797) +++ branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-04 20:33:14 UTC (rev 6798) @@ -5,6 +5,8 @@ [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 +. /etc/rc.conf + resolv_conf="/tmp/etc/resolv-up.conf" udhcpc_conf="/tmp/udhcpc-${interface}.conf" @@ -13,7 +15,10 @@ deconfig) /sbin/ip link set dev ${interface} up /sbin/ip -4 addr flush dev ${interface} scope global - rm -f /tmp/mydhcpip "$udhcpc_conf" + if [ "$EXTIF" = "${interface}" ]; then + rm -f /tmp/mydhcpip + fi + rm -f "$udhcpc_conf" ;; renew|bound) @@ -26,27 +31,46 @@ else OLDGW="" fi - echo "${ip}" > /tmp/mydhcpip + if [ "$EXTIF" = "${interface}" ]; then + echo "${ip}" > /tmp/mydhcpip + fi echo "IP=${ip} BCAST=${broadcast} NETMASK=${subnet}" > "$udhcpc_conf" if [ -n "${router}" ]; then - # Delete existing default route(s) - while /sbin/ip route del default dev ${interface} >/dev/null 2>&1; do - : - done + if [ "$EXTIF" = "${interface}" ]; then + # Delete existing default route(s) + /sbin/ip route list dev ${interface} | grep '^default .*via ' | while read x; do + /sbin/ip route delete ${x} dev ${interface} >/dev/null 2>&1 + done + else + # Delete optional route(s) + /sbin/ip route list dev ${interface} | grep ' via ' | while read x; do + /sbin/ip route delete ${x} dev ${interface} >/dev/null 2>&1 + done + fi NEWGW="" metric=0 for i in ${router}; do - echo "udhcpc: adding route via ${i}" - /sbin/ip route add default via ${i} dev ${interface} metric $((metric++)) + if [ "$EXTIF" = "${interface}" ]; then + echo "udhcpc: adding default route via ${i}" + /sbin/ip route add default via ${i} dev ${interface} metric $metric + else + for x in $EXT2ROUTES; do + echo "udhcpc: adding ${x} route via ${i}" + /sbin/ip route add ${x} via ${i} dev ${interface} metric $metric + done + fi + metric=$((metric+1)) echo "GW=${i}" >> "$udhcpc_conf" if [ -z "$NEWGW" ]; then NEWGW="${i}" fi done + + # Restart Failover script if running and if the gateway changed if [ -f /var/run/wan-failover.pid ]; then if [ "$OLDGW" != "$NEWGW" ]; then /etc/init.d/failover restart @@ -54,13 +78,21 @@ fi fi - echo -n "" > "$resolv_conf" + if [ "$EXTIF" = "${interface}" ]; then + : > "$resolv_conf" + if [ -n "${domain}" ]; then + echo "search ${domain}" >> "$resolv_conf" + fi + for i in ${dns}; do + echo "udhcpc: adding resolver ${i}" + echo "nameserver ${i}" >> "$resolv_conf" + done + fi + if [ -n "${domain}" ]; then - echo "search ${domain}" >> "$resolv_conf" + echo "DOMAIN=${domain}" >> "$udhcpc_conf" fi for i in ${dns}; do - echo "udhcpc: adding resolver ${i}" - echo "nameserver ${i}" >> "$resolv_conf" echo "DNS=${i}" >> "$udhcpc_conf" done ;; Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-04 03:45:02 UTC (rev 6797) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-11-04 20:33:14 UTC (rev 6798) @@ -152,6 +152,8 @@ #EXT2IP="192.168.25.2" #EXT2NM="255.255.255.0" #EXT2GW="192.168.25.1" +## Optionally add static destination routes via EXT2GW or via DHCP +#EXT2ROUTES="1.2.3.4 9.9.9.0/30" ## WAN Failover ## Monitor external "targets" to switch between primary and secondary default gateways @@ -221,6 +223,8 @@ #EXTGWIPV6="2001:db8:100::1" #EXT2IPV6="2001:db8:2::1/64" #EXT2GWIPV6="2001:db8:200::1" +## Optionally add static destination routes via EXT2GWIPV6 +#EXT2ROUTESIPV6="2001:db8:f::1 2001:db8::1/96" ## ## Internal IPv6 addresses #INTIPV6="2001:db8:10::1/64" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-08 22:34:40
|
Revision: 6809 http://sourceforge.net/p/astlinux/code/6809 Author: abelbeck Date: 2014-11-08 22:34:37 +0000 (Sat, 08 Nov 2014) Log Message: ----------- wan-failover, more tweaks Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover Modified: branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-08 14:37:01 UTC (rev 6808) +++ branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-08 22:34:37 UTC (rev 6809) @@ -70,8 +70,8 @@ fi done - # Restart Failover script if running and if the gateway changed - if [ -f /var/run/wan-failover.pid ]; then + # Restart Failover script if running or enabled and if the gateway changed + if [ -f /var/run/wan-failover.pid -o "$WAN_FAILOVER_ENABLE" = "yes" ]; then if [ "$OLDGW" != "$NEWGW" ]; then /etc/init.d/failover restart >/dev/null 2>&1 & fi Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-08 14:37:01 UTC (rev 6808) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-08 22:34:37 UTC (rev 6809) @@ -110,7 +110,7 @@ for x in $TARGETS; do NO_OF_TARGETS=$((NO_OF_TARGETS+1)) log DEBUG "Adding static route for host $x" - ip route add $x via $PRIMARY_GW dev $EXTIF + ip route add $x ${PRIMARY_GW:+via $PRIMARY_GW} dev $EXTIF done } @@ -119,7 +119,7 @@ unset IFS for x in $TARGETS; do - ip route delete $x via $PRIMARY_GW dev $EXTIF + ip route delete $x ${PRIMARY_GW:+via $PRIMARY_GW} dev $EXTIF done } @@ -357,18 +357,13 @@ exit 1 fi +## PPPoE results in an empty PRIMARY_GW PRIMARY_GW="$(ip route list dev $EXTIF 2>/dev/null | sed -n -r -e 's/^default .*via +([^ ]+).*$/\1/p')" -if [ -z "$PRIMARY_GW" ]; then - log_all ERROR "Primary interface gateway not found, exiting." - exit 1 -fi if [ -n "$EXT2GW" ]; then SECONDARY_GW="$EXT2GW" elif [ -f "/tmp/udhcpc-${EXT2IF}.conf" ]; then SECONDARY_GW="$(sed -n -r -e 's/^GW=([0-9.]+).*$/\1/p' "/tmp/udhcpc-${EXT2IF}.conf" | head -n1)" -else - SECONDARY_GW="$PRIMARY_GW" fi if [ -z "$SECONDARY_GW" ]; then log_all ERROR "Secondary interface gateway not found, exiting." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-11-09 00:42:13
|
Revision: 6810 http://sourceforge.net/p/astlinux/code/6810 Author: abelbeck Date: 2014-11-09 00:42:08 +0000 (Sun, 09 Nov 2014) Log Message: ----------- wan-failover, more tweaks Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-08 22:34:37 UTC (rev 6809) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/failover 2014-11-09 00:42:08 UTC (rev 6810) @@ -4,6 +4,7 @@ WAN_LOCKFILE="/var/lock/wan-failover.lock" WAN_PIDFILE="/var/run/wan-failover.pid" +WAN_STARTFILE="/var/run/wan-failover.start" init() { @@ -17,6 +18,8 @@ # Start the background process wan-failover + elif [ -f "$WAN_STARTFILE" ]; then + rm "$WAN_STARTFILE" fi } Modified: branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-08 22:34:37 UTC (rev 6809) +++ branches/1.0/project/astlinux/target_skeleton/etc/udhcpc.script 2014-11-09 00:42:08 UTC (rev 6810) @@ -71,7 +71,7 @@ done # Restart Failover script if running or enabled and if the gateway changed - if [ -f /var/run/wan-failover.pid -o "$WAN_FAILOVER_ENABLE" = "yes" ]; then + if [ -f /var/run/wan-failover.pid -o -f /var/run/wan-failover.start ]; then if [ "$OLDGW" != "$NEWGW" ]; then /etc/init.d/failover restart >/dev/null 2>&1 & fi Modified: branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover =================================================================== --- branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-08 22:34:37 UTC (rev 6809) +++ branches/1.0/project/astlinux/target_skeleton/usr/sbin/wan-failover 2014-11-09 00:42:08 UTC (rev 6810) @@ -14,6 +14,7 @@ LOCKFILE="/var/lock/wan-failover.lock" PIDFILE="/var/run/wan-failover.pid" +STARTFILE="/var/run/wan-failover.start" STATUSFILE="/var/log/wan-failover-status.log" SCRIPTFILE="/mnt/kd/wan-failover.script" @@ -341,6 +342,9 @@ return 0 } +## Reset flag, when set, on a network change wan-failover should be started if not already running +rm -f "$STARTFILE" + ## Override the 2nd external interface if WAN_FAILOVER_SECONDARY_GW is defined if [ -n "$WAN_FAILOVER_SECONDARY_GW" ]; then EXT2IF="$(ip -o route get $WAN_FAILOVER_SECONDARY_GW | sed -n -r -e 's/^.* dev +([^ ]+).*$/\1/p')" @@ -357,6 +361,28 @@ exit 1 fi +FIRST_TARGET="" +TARGETS="" +unset IFS +for x in $WAN_FAILOVER_TARGETS; do + # Sanitize for manual IPv4 addresses + if [ -z "$(echo "$x" | tr -d '0-9.')" ]; then + TARGETS="$TARGETS${TARGETS:+ }$x" + if [ -z "$FIRST_TARGET" ]; then + FIRST_TARGET="$x" + fi + fi +done +if [ -z "$FIRST_TARGET" ]; then + log_all ERROR "No IPv4 targets to test availability, define: WAN_FAILOVER_TARGETS" + exit 1 +fi + +if ! which fping >/dev/null 2>&1; then + log_all ERROR "The command 'fping' is not available, exiting." + exit 1 +fi + ## PPPoE results in an empty PRIMARY_GW PRIMARY_GW="$(ip route list dev $EXTIF 2>/dev/null | sed -n -r -e 's/^default .*via +([^ ]+).*$/\1/p')" @@ -366,7 +392,8 @@ SECONDARY_GW="$(sed -n -r -e 's/^GW=([0-9.]+).*$/\1/p' "/tmp/udhcpc-${EXT2IF}.conf" | head -n1)" fi if [ -z "$SECONDARY_GW" ]; then - log_all ERROR "Secondary interface gateway not found, exiting." + echo "1" > "$STARTFILE" + log_all ERROR "Secondary interface gateway not found, will restart on a network change." exit 1 fi @@ -376,28 +403,6 @@ SECONDARY_GWIPV6="" fi -if ! which fping >/dev/null 2>&1; then - log_all ERROR "The command 'fping' is not available, exiting." - exit 1 -fi - -FIRST_TARGET="" -TARGETS="" -unset IFS -for x in $WAN_FAILOVER_TARGETS; do - # Sanitize for manual IPv4 addresses - if [ -z "$(echo "$x" | tr -d '0-9.')" ]; then - TARGETS="$TARGETS${TARGETS:+ }$x" - if [ -z "$FIRST_TARGET" ]; then - FIRST_TARGET="$x" - fi - fi -done -if [ -z "$FIRST_TARGET" ]; then - log_all ERROR "No IPv4 targets to test availability, define: WAN_FAILOVER_TARGETS" - exit 1 -fi - if [ "$SECONDARY_GW" = "$(ip route list dev $EXT2IF 2>/dev/null | sed -n -r -e 's|^0.0.0.0/1 .*via +([^ ]+).*$|\1|p')" ]; then ACTIVE_CONNECTION="$SECONDARY_STR" else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-02-19 15:34:31
|
Revision: 6976 http://sourceforge.net/p/astlinux/code/6976 Author: abelbeck Date: 2015-02-19 15:34:29 +0000 (Thu, 19 Feb 2015) Log Message: ----------- kernel runtime params, add support for /etc/sysctl.conf via either /mnt/kd/sysctl.conf or the rc.conf variable KERNEL_SYSCTL, disabled by default Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/sysctl branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S97sysctl branches/1.0/project/astlinux/target_skeleton/etc/sysctl.conf Added: branches/1.0/project/astlinux/target_skeleton/etc/init.d/sysctl =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/sysctl (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/sysctl 2015-02-19 15:34:29 UTC (rev 6976) @@ -0,0 +1,73 @@ +#!/bin/sh + +. /etc/rc.conf + +gen_sysctl_conf() +{ + local i param value IFS + + unset IFS + for i in $KERNEL_SYSCTL; do + param="$(echo "$i" | cut -s -d'=' -f1)" + value="$(echo "$i" | cut -s -d'=' -f2)" + if [ -n "$param" -a -n "$value" ]; then + echo "$param = $value" + fi + done +} + +init () { + + if [ -f /mnt/kd/sysctl.conf ]; then + echo "# Autogenerated. Edit /mnt/kd/sysctl.conf file. +" > /tmp/etc/sysctl.conf + cat /mnt/kd/sysctl.conf >>/tmp/etc/sysctl.conf + elif [ -n "$KERNEL_SYSCTL" ]; then + echo "# Autogenerated. Do not edit. +# A manually generated sysctl config will use /mnt/kd/sysctl.conf if it exists. +" > /tmp/etc/sysctl.conf + gen_sysctl_conf >>/tmp/etc/sysctl.conf + elif [ -f /etc/sysctl.conf ]; then + rm -f /tmp/etc/sysctl.conf + fi +} + +start () { + + if [ -f /etc/sysctl.conf ]; then + echo "Setting kernel runtime parameters..." + sysctl -p /etc/sysctl.conf >/dev/null + fi +} + +stop () { + : +} + +case $1 in + +start) + start + ;; + +stop) + stop + ;; + +init) + init + start + ;; + +restart) + stop + sleep 2 + start + ;; + +*) + echo "Usage: start|stop|restart" + ;; + +esac + Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/init.d/sysctl ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S97sysctl =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S97sysctl (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S97sysctl 2015-02-19 15:34:29 UTC (rev 6976) @@ -0,0 +1 @@ +link ../../init.d/sysctl \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S97sysctl ___________________________________________________________________ Added: svn:special ## -0,0 +1 ## +* \ No newline at end of property Added: branches/1.0/project/astlinux/target_skeleton/etc/sysctl.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/sysctl.conf (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/sysctl.conf 2015-02-19 15:34:29 UTC (rev 6976) @@ -0,0 +1 @@ +link /tmp/etc/sysctl.conf \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/sysctl.conf ___________________________________________________________________ Added: svn:special ## -0,0 +1 ## +* \ No newline at end of property Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-02-12 18:06:38 UTC (rev 6975) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-02-19 15:34:29 UTC (rev 6976) @@ -802,6 +802,11 @@ ## Module options ## Edit /etc/modprobe.d/options.conf if you need to pass any options. +## Kernel runtime parameters +## List of kernel sysctl 'param=value' entries, space or newline separated. +## Note: If /mnt/kd/sysctl.conf exists, it will be used instead. +#KERNEL_SYSCTL="kernel.panic=3 vm.min_free_kbytes=8192" + ## LMSensors Modules ## List your hardware modules, seperated by spaces ## You will also need to create a sensors.conf This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-11-01 15:26:51
|
Revision: 7298 http://sourceforge.net/p/astlinux/code/7298 Author: abelbeck Date: 2015-11-01 15:26:48 +0000 (Sun, 01 Nov 2015) Log Message: ----------- dhcpv6, add support for the Failover Interface, no Prefix Delegation, only Request IPv6 Address Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2015-10-31 02:54:00 UTC (rev 7297) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2015-11-01 15:26:48 UTC (rev 7298) @@ -54,6 +54,20 @@ return 0 } +gen_nopd_dhcp6c_conf() +{ + local interface="$1" + + echo "# Autogenerated. Do not edit. +interface $interface { + send ia-na 1; + send rapid-commit; +}; + +id-assoc na 1 { };" + +} + gen_dhcp6c_conf() { local interface="$1" len id iname int IFS @@ -135,14 +149,18 @@ init_dhcp6c() { - local interface="$1" + local iname="$1" interface="$2" sysctl -w net/ipv6/conf/${interface}/accept_ra=2 >/dev/null # Make DUID persistant ln -sf /mnt/kd/dhcp6c_duid /var/db/dhcp6c_duid - gen_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + if [ "$iname" = "ext2if" ]; then + gen_nopd_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + else + gen_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + fi } ipv6_tunnel() @@ -590,12 +608,15 @@ #DHCP Failover Interface if [ -n "$EXT2IF" -a -z "$EXT2IP" ] && ! isextppp ext2if; then + if [ "$IPV6" = "yes" -a "$EXT2DHCPV6_CLIENT_ENABLE" = "yes" ]; then + init_dhcp6c ext2if $EXT2IF + fi ifplugd -apq -t2 -u3 -d3 -i $EXT2IF -r /etc/ifplugd/udhcpc.action ip link set dev $EXT2IF up sleep 4 # No DHCPv6 - Static IPv6 if defined - if [ "$IPV6" = "yes" -a -n "$EXT2IPV6" -a -n "$EXT2GWIPV6" ]; then + if [ "$IPV6" = "yes" -a "$EXT2DHCPV6_CLIENT_ENABLE" != "yes" -a -n "$EXT2IPV6" -a -n "$EXT2GWIPV6" ]; then ip -6 addr add $EXT2IPV6 dev $EXT2IF for x in $EXT2ROUTESIPV6; do ip -6 route add $x via $EXT2GWIPV6 dev $EXT2IF metric 1 @@ -608,7 +629,7 @@ ip link set dev $EXTIF up sleep 4 if [ "$IPV6" = "yes" -a "$DHCPV6_CLIENT_ENABLE" = "yes" ]; then - init_dhcp6c $EXTIF + init_dhcp6c extif $EXTIF dhcp6c -c /etc/wide-dhcpv6/dhcp6c-$EXTIF.conf -p /var/run/dhcp6c-$EXTIF.pid $EXTIF fi udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXTIF.pid -i $EXTIF Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-10-31 02:54:00 UTC (rev 7297) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-11-01 15:26:48 UTC (rev 7298) @@ -242,12 +242,16 @@ #IPV6_AUTOCONF="INTIF" ## DHCPv6 Client -## Enable DHCPv6 client by setting DHCPV6_CLIENT_ENABLE="yes" +## Enable DHCPv6 client on EXTIF by setting DHCPV6_CLIENT_ENABLE="yes" #DHCPV6_CLIENT_ENABLE="yes" #DHCPV6_CLIENT_REQUEST_ADDRESS="yes" # Request IPv6 Address, disable with "no", defaults to "yes" #DHCPV6_CLIENT_REQUEST_PREFIX="yes" # Request Prefix Delegation, disable with "no", defaults to "yes" #DHCPV6_CLIENT_PREFIX_LEN="60" # Prefix Delegation Length, defaults to "60" #DHCPV6_CLIENT_PREFIX_HINT="yes" # Request the Prefix Delegation Length, disable with "no", defaults to "yes" +## +## Enable DHCPv6 client on EXT2IF by setting EXT2DHCPV6_CLIENT_ENABLE="yes" +## Note: No Prefix Delegation, only Request IPv6 Address +#EXT2DHCPV6_CLIENT_ENABLE="yes" ## Configure IPv6 tunnel gateway for 6in4 and 6to4 ## Supported Types: "6in4-static" "6to4-relay" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-04 04:25:37
|
Revision: 7366 http://sourceforge.net/p/astlinux/code/7366 Author: abelbeck Date: 2015-12-04 04:25:35 +0000 (Fri, 04 Dec 2015) Log Message: ----------- Rewrite the 'sreboot' script to perform a reboot via kexec just as RUNNIX does, changes to images are honored. The goal would be to allow the web interface use 'sreboot' instead of 'reboot' and save about 40 seconds on each reboot. Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/rc branches/1.0/project/astlinux/target_skeleton/sbin/sreboot Modified: branches/1.0/project/astlinux/target_skeleton/etc/rc =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/rc 2015-12-03 13:44:45 UTC (rev 7365) +++ branches/1.0/project/astlinux/target_skeleton/etc/rc 2015-12-04 04:25:35 UTC (rev 7366) @@ -394,7 +394,6 @@ } shutdown() { - # args: sreboot_flag CMDLINE="`cat /proc/cmdline`" @@ -420,11 +419,7 @@ hwclock -wu 2>/dev/null fi - if [ "$1" = "sreboot" ]; then - echo "shutdown sreboot..." - else - umount -a -r 2>/dev/null - fi + umount -a -r 2>/dev/null } @@ -436,7 +431,7 @@ ;; shutdown) - shutdown "$2" + shutdown ;; esac Modified: branches/1.0/project/astlinux/target_skeleton/sbin/sreboot =================================================================== --- branches/1.0/project/astlinux/target_skeleton/sbin/sreboot 2015-12-03 13:44:45 UTC (rev 7365) +++ branches/1.0/project/astlinux/target_skeleton/sbin/sreboot 2015-12-04 04:25:35 UTC (rev 7366) @@ -1,27 +1,157 @@ #!/bin/sh -# kexec based quick reboot for AstLinux -KERN="/boot/bzImage" -INITRD="/oldroot/cdrom/os/initrd.img" +## kexec based quick reboot for AstLinux +## Replicate the basic functionality of the RUNNIX script +## +## If anything fails, do a normal reboot -if [ ! -f "$INITRD" -o ! -f "$KERN" ]; then - echo "You don't have your drives mounted - exiting" +do_failure() +{ + reboot -f exit 1 -fi +} +do_reboot() +{ + # Stop services and unmount all file systems or remount 'ro' if busy + /etc/rc shutdown + + # Stop udevd since /dev is now 'ro' + echo "Stopping udevd..." + udevadm control --timeout=121 --exit + killall udevd 2>/dev/null + + ROOT="/tmp/mnt/root" + + KEXEC_BASE="/tmp/mnt/kexec" + + mount -t tmpfs none /tmp + + mkdir -p "$ROOT" + mkdir -p "$KEXEC_BASE" + + BASE="/oldroot/cdrom" + + if ! mount | grep -q "$BASE"; then + LABEL="$(/sbin/findfs LABEL=RUNNIX)" + if [ -n "$LABEL" ]; then + mount -t vfat -o ro "$LABEL" $BASE + fi + if ! mount | grep -q "$BASE"; then + echo "Unable to find Runnix partition." + do_failure + fi + fi + + if [ -f $BASE/os/default.conf ]; then + . $BASE/os/default.conf + fi + + # Get the latest good one + cd $BASE/os + RUNIMG="$(ls *.run | tail -n1)" + + # If we have a ver file, override auto/default.conf value + if [ -f $BASE/os/ver ]; then + RUNIMG="$(cat $BASE/os/ver).run" + fi + + if [ "$VERIFY_LOCAL" = "yes" ]; then + echo "Verifying $RUNIMG..." + + if sha1sum -cs $RUNIMG.sha1; then + echo "$RUNIMG verified" + IMGVER=1 + else + echo "$RUNIMG not verified" + fi + else + echo "Skip Verifying $RUNIMG" + fi + + if [ -f $BASE/os/$RUNIMG.conf ]; then + . $BASE/os/$RUNIMG.conf + fi + + # Fixup RUNNIX -> Astlinux paths + INITRD="${BASE}${INITRD#/mnt/base}" + KERN="${ROOT}${KERN#/mnt/root}" + + if [ -z "$OFFSET" ]; then + losetup /dev/loop0 $BASE/os/$RUNIMG + else + losetup -o "$OFFSET" /dev/loop0 $BASE/os/$RUNIMG + fi + + if [ -z "$FSTYPE" ]; then + FSTYPE="ext2" + fi + + if mount -t $FSTYPE -o ro /dev/loop0 $ROOT; then + echo "Root mounted" + else + echo "Error mounting $RUNIMG root fs" + do_failure + fi + + if [ -n "$INITRD" ]; then + if [ -f "$INITRD" ]; then + echo "Custom initrd $INITRD found" + else + INITRD="$BASE/os/initrd.img" + echo "Custom initrd not found - using $INITRD" + fi + else + echo "Using default initrd" + INITRD="$BASE/os/initrd.img" + fi + + if [ -n "$KERN" ]; then + if [ -f "$KERN" ]; then + echo "Custom kernel $KERN found" + else + KERN="$ROOT/boot/bzImage" + echo "Custom kernel not found - using $KERN" + fi + else + echo "Using default kernel" + KERN="$ROOT/boot/bzImage" + fi + + if [ -f "$INITRD" -a -f "$KERN" ]; then + echo "Copying kernel and initrd to ramdisk..." + mount -t tmpfs none "$KEXEC_BASE" + cp "$INITRD" "$KEXEC_BASE/initrd.img" + cp "$KERN" "$KEXEC_BASE/bzImage" + echo "Unmounting image..." + umount $ROOT + else + echo "I couldn't find your kernel and/or initrd" + do_failure + fi + + if [ -z "$KCMD" ]; then + echo "You need to specify a kernel command line. + I can't guess that" + do_failure + fi + + echo "Trying kexec..." + /sbin/kexec --command-line="$KCMD" --initrd="$KEXEC_BASE/initrd.img" -f "$KEXEC_BASE/bzImage" + + do_failure +} + if [ ! -x /sbin/kexec ]; then - echo "You don't have kexec-tools installed - exiting" + echo "You don't have kexec-tools installed - rebooting" + reboot exit 1 fi -echo "Calling AstLinux Shutdown..." -/etc/rc shutdown sreboot +if [ ! -x /sbin/findfs ]; then + echo "You don't have findfs installed - rebooting" + reboot + exit 1 +fi -echo "Loading kernel..." -/sbin/kexec -l --command-line="`cat /proc/cmdline`" --initrd="$INITRD" "$KERN" - -sync -umount -a -r 2>/dev/null - -echo "Rebooting system..." -/sbin/kexec -e +do_reboot >/dev/console 2>&1 & This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2017-03-20 23:58:24
|
Revision: 8218 http://sourceforge.net/p/astlinux/code/8218 Author: abelbeck Date: 2017-03-20 23:58:21 +0000 (Mon, 20 Mar 2017) Log Message: ----------- network, If a Static IPv6 external interface is defined with an undefined IPv6 Gateway entry, automatically it will use Router Advertisements to set the default route Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-03-18 18:04:21 UTC (rev 8217) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-03-20 23:58:21 UTC (rev 8218) @@ -610,9 +610,10 @@ if [ -n "$EXTIP_ALIAS" ]; then alias_interface add $EXTIF "$EXTIP_ALIAS" fi - if [ "$IPV6" = "yes" -a -n "$EXTIPV6" ] && \ - [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then - ip -6 addr add $EXTIPV6 dev $EXTIF + if [ "$IPV6" = "yes" ] && [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then + if [ -n "$EXTIPV6" ]; then + ip -6 addr add $EXTIPV6 dev $EXTIF + fi fi ip link set dev $EXTIF up if [ "$IPV6" = "yes" -a "$DHCPV6_CLIENT_ENABLE" = "yes" ]; then @@ -628,9 +629,15 @@ if [ -n "$EXTGW" ]; then ip route add default via $EXTGW dev $EXTIF fi - if [ "$IPV6" = "yes" -a -n "$EXTGWIPV6" ] && \ - [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then - ip -6 route add default via $EXTGWIPV6 dev $EXTIF metric 1 + if [ "$IPV6" = "yes" ] && [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then + if [ -n "$EXTIPV6" ]; then + if [ -n "$EXTGWIPV6" ]; then + ip -6 route add default via $EXTGWIPV6 dev $EXTIF metric 1 + else + # Use Router Advertisements to set the default route + sysctl -w net/ipv6/conf/${EXTIF}/accept_ra=2 >/dev/null + fi + fi fi #end static IP fi @@ -669,10 +676,16 @@ ifplugd -apq -t2 -u3 -d3 -i $EXTIF -r /etc/ifplugd/udhcpc.action # No DHCPv6 - Static IPv6 if defined - if [ "$IPV6" = "yes" -a -n "$EXTIPV6" -a -n "$EXTGWIPV6" ] && \ - [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then - ip -6 addr add $EXTIPV6 dev $EXTIF - ip -6 route add default via $EXTGWIPV6 dev $EXTIF metric 1 + if [ "$IPV6" = "yes" ] && [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then + if [ -n "$EXTIPV6" ]; then + ip -6 addr add $EXTIPV6 dev $EXTIF + if [ -n "$EXTGWIPV6" ]; then + ip -6 route add default via $EXTGWIPV6 dev $EXTIF metric 1 + else + # Use Router Advertisements to set the default route + sysctl -w net/ipv6/conf/${EXTIF}/accept_ra=2 >/dev/null + fi + fi fi fi Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-03-18 18:04:21 UTC (rev 8217) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-03-20 23:58:21 UTC (rev 8218) @@ -232,6 +232,7 @@ ## Do not use the example addresses shown, they are for documentation use only! ## ## Static External IPv6 address and gateway address +## Note: If EXTIPV6 is defined but EXTGWIPV6 is not, Router Advertisements will set the default route #EXTIPV6="2001:db8:1::1/64" #EXTGWIPV6="2001:db8:100::1" #EXT2IPV6="2001:db8:2::1/64" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2017-05-01 19:15:06
|
Revision: 8285 http://sourceforge.net/p/astlinux/code/8285 Author: abelbeck Date: 2017-05-01 19:15:04 +0000 (Mon, 01 May 2017) Log Message: ----------- network, add new PHYETH_DISABLE_OFFLOAD rc.conf variable to disable hardware network interface offloading, disabled by default Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-04-29 16:30:20 UTC (rev 8284) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-05-01 19:15:04 UTC (rev 8285) @@ -247,6 +247,24 @@ esac } +phyeth_disable_offload() +{ + local eth off off_list="$1" IFS + + logger -s -t network -p kern.info "Disabling \"$off_list\" offload on all configured ethernet interfaces." + + unset IFS + for eth in $EXTIF $EXT2IF $PPPOEIF $INTIF $INT2IF $INT3IF $INT4IF $DMZIF $BRIDGE0 $BRIDGE1 $BRIDGE2; do + case $eth in + eth*) + for off in $off_list; do + ethtool -K $eth $off off 2>/dev/null + done + ;; + esac + done +} + init () { mkdir -p /tmp/etc/wide-dhcpv6 @@ -436,6 +454,10 @@ done fi + if [ -n "$PHYETH_DISABLE_OFFLOAD" ]; then + phyeth_disable_offload "$PHYETH_DISABLE_OFFLOAD" + fi + if [ -n "$INTIF" -a -n "$INTIP" -a -n "$INTNM" -a "$INTIF" != "none" ]; then ip addr add $INTIP/$INTNM brd + dev $INTIF if [ "$IPV6" = "yes" -a -n "$INTIPV6" ]; then Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-04-29 16:30:20 UTC (rev 8284) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-05-01 19:15:04 UTC (rev 8285) @@ -958,16 +958,18 @@ ## IFRENAME Support ## If for some reason you need to move your interfaces around before ## they are configured, you can do that here if you built your system -## with wireless-tools enabled (it's included by default. +## with wireless-tools enabled (not included by default). #IFRENAME="eth0:8139too:i10 eth1:8139too:i12 eth2:8139too:i11" ## Physical Ethernet Configuration ## If you need to manually specify any speed and duplex settings, you can ## do that here NOTE: This will disable auto-negotiation for any devices -## you enable it for. You CANNOT use variables like $EXTIF, $INTIF, etc. -## Note that this code runs AFTER the ifrename support above. +## you enable it for. ## INTERFACE:speed:duplex #PHYETH="eth0:10:half eth1:100:half" +## Disable hardware network interface offloading for the specified offload types. +## Note: This applies to all configured ethernet interfaces and VLAN's. +#PHYETH_DISABLE_OFFLOAD="tso gso gro" ## Change EXTIF's MAC address here (for some cable connections) #EXTIFMAC="01:02:03:04:05:06" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |