diff options
-rwxr-xr-x | package/base-files/extra/etc/network/if-post-down.d/01-bridge (renamed from package/base-files/extra/etc/network/if-post-down.d/bridge) | 0 | ||||
-rw-r--r-- | package/base-files/extra/etc/network/if-pre-up.d/01-atm | 43 | ||||
-rwxr-xr-x | package/base-files/extra/etc/network/if-pre-up.d/02-bridge (renamed from package/base-files/extra/etc/network/if-pre-up.d/bridge) | 0 | ||||
-rw-r--r-- | package/mpd/files/mpd.conf | 14 | ||||
-rw-r--r-- | package/mtd/src/mtd.c | 20 | ||||
-rwxr-xr-x | package/ppp/files/ppp.pre-up | 2 | ||||
-rw-r--r-- | target/ag241/TODO | 4 | ||||
-rw-r--r-- | target/ag241/files/etc/network/interfaces | 9 |
8 files changed, 84 insertions, 8 deletions
diff --git a/package/base-files/extra/etc/network/if-post-down.d/bridge b/package/base-files/extra/etc/network/if-post-down.d/01-bridge index eda1fe3bf..eda1fe3bf 100755 --- a/package/base-files/extra/etc/network/if-post-down.d/bridge +++ b/package/base-files/extra/etc/network/if-post-down.d/01-bridge diff --git a/package/base-files/extra/etc/network/if-pre-up.d/01-atm b/package/base-files/extra/etc/network/if-pre-up.d/01-atm new file mode 100644 index 000000000..08baf73c7 --- /dev/null +++ b/package/base-files/extra/etc/network/if-pre-up.d/01-atm @@ -0,0 +1,43 @@ +#!/bin/sh + +if [ ! -x /usr/sbin/br2684ctl ] +then + exit 0 +fi + +[ "$METHOD" == "atm" ] || exit 0 + +[ "$IF_ATM_ENCAPS" ] || encap=0 +[ "$IF_ATM_PAYLOAD" ] || payload=1 +[ "$IF_ATM_VPI" ] || $IF_ATM_VPI=1 +[ "$IF_ATM_VCI" ] || $IF_ATM_VCI=32 + +case "$IF_ATM_PAYLOAD" in +bridged) + payload=1 + ;; +routed) + payload=0 + ;; +*) + echo "Wrong payload, use either bridged or routed" + exit 1 + ;; +esac + +case "$IF_ATM_ENCAPS" in +llc) + encap=0 + ;; +vc) + encap=1 + ;; +*) + echo "Wrong Encapsulation use either llc or vc" + exit 1 + ;; +esac + +br2684ctl -b -c 0 -e $encap -p $payload -a $IF_ATM_VPI.$IF_ATM_VCI +ifconfig nas0 up +exit 0 diff --git a/package/base-files/extra/etc/network/if-pre-up.d/bridge b/package/base-files/extra/etc/network/if-pre-up.d/02-bridge index 766084de1..766084de1 100755 --- a/package/base-files/extra/etc/network/if-pre-up.d/bridge +++ b/package/base-files/extra/etc/network/if-pre-up.d/02-bridge diff --git a/package/mpd/files/mpd.conf b/package/mpd/files/mpd.conf index 6c23d582d..6e5309e86 100644 --- a/package/mpd/files/mpd.conf +++ b/package/mpd/files/mpd.conf @@ -15,3 +15,17 @@ audio_output { } # Volume control mixer mixer_type "alsa" + +# shout example +#audio_output { +# type "shout" +# name "personal mpd stream" +# host "127.0.0.1" +# port "8000" +# mount "/mpd" +# quality "5.0" +# format "44100:16:2" +# user "source" +# password "musicrockz" +#} + diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c index 6812c5e31..1230688b1 100644 --- a/package/mtd/src/mtd.c +++ b/package/mtd/src/mtd.c @@ -43,6 +43,7 @@ #include <string.h> #include <mtd/mtd-user.h> +#include <linux/reboot.h> #define BUFSIZE (16 * 1024) #define MAX_ARGS 8 @@ -253,15 +254,16 @@ usage(void) " -q quiet mode (once: no [w] on writing,\n" " twice: no status messages)\n" " -e <device> erase <device> before executing the command\n\n" - "Example: To write linux.trx to mtd1 labeled as linux\n" - " mtd write linux.trx linux\n\n"); + " -r reboot after successful command\n" + "Example: To write linux.img to mtd partition labeled as linux\n" + " mtd write linux.img linux\n\n"); exit(1); } int main(int argc, char **argv) { - int ch, i, imagefd = -1, quiet, unlocked; + int ch, i, imagefd = -1, quiet, unlocked, boot; char *erase[MAX_ARGS], *device; const char *imagefile = NULL; enum { @@ -271,6 +273,7 @@ main(int argc, char **argv) } cmd; erase[0] = NULL; + boot = 0; buflen = 0; quiet = 0; @@ -282,6 +285,9 @@ main(int argc, char **argv) case 'q': quiet++; break; + case 'r': + boot = 1; + break; case 'e': i = 0; while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS)) @@ -373,7 +379,13 @@ main(int argc, char **argv) fprintf(stderr, "\n"); break; } - + sync(); + if (boot) { + fprintf(stderr, "\nRebooting ... "); + fflush(stdout); + fflush(stderr); + syscall(SYS_reboot,LINUX_REBOOT_MAGIC1,LINUX_REBOOT_MAGIC2,LINUX_REBOOT_CMD_RESTART,NULL); + } return 0; } diff --git a/package/ppp/files/ppp.pre-up b/package/ppp/files/ppp.pre-up index ec6cc5a31..c83a09177 100755 --- a/package/ppp/files/ppp.pre-up +++ b/package/ppp/files/ppp.pre-up @@ -36,7 +36,7 @@ sed "$REPLACE" < /etc/ppp/templates/$IF_USE_TEMPLATE > /etc/ppp/peers/$IF_PROVID [ "$IF_PPP_ENCAPS" ] || encap=0 [ "$IF_PPP_PAYLOAD" ] || payload=1 [ "$IF_PPP_VPI" ] || $IF_PPP_VPI=1 -[ "$IF_PPP_PAYLOAD" ] || $IF_PPP_VCI=32 +[ "$IF_PPP_VCI" ] || $IF_PPP_VCI=32 case "$IF_PPP_PAYLOAD" in bridged) diff --git a/target/ag241/TODO b/target/ag241/TODO index 3c1ac28a8..19fd8d5e8 100644 --- a/target/ag241/TODO +++ b/target/ag241/TODO @@ -1,3 +1 @@ -- update with mtd, reboot feature in mtd -- startupscript for bridged nas device -- +- update with mtd diff --git a/target/ag241/files/etc/network/interfaces b/target/ag241/files/etc/network/interfaces new file mode 100644 index 000000000..5d2e025d7 --- /dev/null +++ b/target/ag241/files/etc/network/interfaces @@ -0,0 +1,9 @@ +auto lo +iface lo inet loopback + +auto nas0 +iface nas0 inet atm + +auto br0 +iface br0 inet manual + bridge-ports eth0 nas0 |