aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips/base-files')
-rw-r--r--target/linux/ramips/base-files/.svn/entries34
-rw-r--r--target/linux/ramips/base-files/etc/.svn/entries102
-rw-r--r--target/linux/ramips/base-files/etc/.svn/prop-base/diag.sh.svn-base5
-rw-r--r--target/linux/ramips/base-files/etc/.svn/text-base/diag.sh.svn-base141
-rw-r--r--target/linux/ramips/base-files/etc/.svn/text-base/inittab.svn-base4
-rwxr-xr-xtarget/linux/ramips/base-files/etc/diag.sh141
-rw-r--r--target/linux/ramips/base-files/etc/hotplug.d/.svn/entries31
-rw-r--r--target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/entries62
-rw-r--r--target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base119
-rw-r--r--target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom119
-rw-r--r--target/linux/ramips/base-files/etc/inittab4
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/entries130
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base5
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base5
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/09_fix-seama-header.svn-base5
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base112
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base272
-rw-r--r--target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/09_fix-seama-header.svn-base20
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/01_leds112
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/02_network272
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header20
-rw-r--r--target/linux/ramips/base-files/lib/.svn/entries68
-rw-r--r--target/linux/ramips/base-files/lib/.svn/prop-base/ramips.sh.svn-base5
-rw-r--r--target/linux/ramips/base-files/lib/.svn/text-base/ramips.sh.svn-base234
-rw-r--r--target/linux/ramips/base-files/lib/preinit/.svn/entries130
-rw-r--r--target/linux/ramips/base-files/lib/preinit/.svn/text-base/03_preinit_do_ramips.sh.svn-base9
-rw-r--r--target/linux/ramips/base-files/lib/preinit/.svn/text-base/05_ramips_load-input_drivers.svn-base12
-rw-r--r--target/linux/ramips/base-files/lib/preinit/.svn/text-base/06_set_iface_mac.svn-base79
-rw-r--r--target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh9
-rw-r--r--target/linux/ramips/base-files/lib/preinit/05_ramips_load-input_drivers12
-rw-r--r--target/linux/ramips/base-files/lib/preinit/06_set_iface_mac79
-rwxr-xr-xtarget/linux/ramips/base-files/lib/ramips.sh234
-rw-r--r--target/linux/ramips/base-files/lib/upgrade/.svn/entries62
-rw-r--r--target/linux/ramips/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base5
-rw-r--r--target/linux/ramips/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base101
-rwxr-xr-xtarget/linux/ramips/base-files/lib/upgrade/platform.sh101
36 files changed, 2855 insertions, 0 deletions
diff --git a/target/linux/ramips/base-files/.svn/entries b/target/linux/ramips/base-files/.svn/entries
new file mode 100644
index 0000000..92a4281
--- /dev/null
+++ b/target/linux/ramips/base-files/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-12T13:52:40.669686Z
+35988
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+lib
+dir
+
+etc
+dir
+
diff --git a/target/linux/ramips/base-files/etc/.svn/entries b/target/linux/ramips/base-files/etc/.svn/entries
new file mode 100644
index 0000000..fd3978c
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/.svn/entries
@@ -0,0 +1,102 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/etc
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-12T13:52:40.669686Z
+35988
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+hotplug.d
+dir
+
+uci-defaults
+dir
+
+inittab
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+dfeb375fcdde55896e5c8ae21ace07b7
+2010-12-13T08:01:21.821616Z
+24540
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+137
+
+diag.sh
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+512025fbcc347efe0b0ff0f6287f0b87
+2013-03-12T13:52:40.669686Z
+35988
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2352
+
diff --git a/target/linux/ramips/base-files/etc/.svn/prop-base/diag.sh.svn-base b/target/linux/ramips/base-files/etc/.svn/prop-base/diag.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/.svn/prop-base/diag.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/etc/.svn/text-base/diag.sh.svn-base b/target/linux/ramips/base-files/etc/.svn/text-base/diag.sh.svn-base
new file mode 100644
index 0000000..0c2ae83
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/.svn/text-base/diag.sh.svn-base
@@ -0,0 +1,141 @@
+#!/bin/sh
+# Copyright (C) 2010-2013 OpenWrt.org
+
+. /lib/functions/leds.sh
+. /lib/ramips.sh
+
+get_status_led() {
+ case $(ramips_board_name) in
+ 3g-6200n)
+ status_led="edimax:green:power"
+ ;;
+ 3g300m)
+ status_led="tenda:blue:ap"
+ ;;
+ argus-atp52b)
+ status_led="argus-atp52b:green:run"
+ ;;
+ br6524n)
+ status_led="edimax:blue:power"
+ ;;
+ br6425)
+ status_led="edimax:green:power"
+ ;;
+ dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1)
+ status_led="d-link:green:status"
+ ;;
+ dir-645)
+ status_led="d-link:green:wps"
+ ;;
+ dap-1350)
+ status_led="d-link:blue:power"
+ ;;
+ esr-9753)
+ status_led="esr-9753:orange:power"
+ ;;
+ f5d8235-v2)
+ status_led="f5d8235v2:blue:router"
+ ;;
+ fonera20n)
+ status_led="fonera20n:green:power"
+ ;;
+ rt-n13u)
+ status_led="rt-n13u:power"
+ ;;
+ all0239-3g|\
+ hw550-3g)
+ status_led="hw550-3g:green:status"
+ ;;
+ mofi3500-3gn)
+ status_led="mofi3500-3gn:green:status"
+ ;;
+ nbg-419n)
+ status_led="nbg-419n:green:power"
+ ;;
+ nw718)
+ status_led="nw718:amber:cpu"
+ ;;
+ omni-emb|\
+ omni-emb-hpm)
+ status_led="emb:green:status"
+ ;;
+ psr-680w)
+ status_led="psr-680w:red:wan"
+ ;;
+ pwh2004)
+ status_led="pwh2004:green:power"
+ ;;
+ rt-n15)
+ status_led="rt-n15:blue:power"
+ ;;
+ rt-n10-plus)
+ status_led="asus:green:wps"
+ ;;
+ rt-n56u | wl-330n | wl-330n3g)
+ status_led="asus:blue:power"
+ ;;
+ sl-r7205)
+ status_led="sl-r7205:green:status"
+ ;;
+ tew-691gr|\
+ tew-692gr)
+ status_led="trendnet:green:wps"
+ ;;
+ v11st-fe)
+ status_led="v11st-fe:green:status"
+ ;;
+ v22rw-2x2)
+ status_led="v22rw-2x2:green:security"
+ ;;
+ w306r-v20)
+ status_led="w306r-v20:green:sys"
+ ;;
+ w502u)
+ status_led="alfa:blue:wps"
+ ;;
+ wcr-150gn)
+ status_led="wcr150gn:amber:power"
+ ;;
+ whr-g300n)
+ status_led="whr-g300n:green:router"
+ ;;
+ wli-tx4-ag300n)
+ status_led="buffalo:blue:power"
+ ;;
+ wl-351)
+ status_led="wl-351:amber:power"
+ ;;
+ wr512-3gn)
+ status_led="wr512:green:wps"
+ ;;
+ mzk-w300nh2)
+ status_led="mzkw300nh2:green:power"
+ ;;
+ ur-326n4g)
+ status_led="ur326:green:wps"
+ ;;
+ ur-336un)
+ status_led="ur336:green:wps"
+ ;;
+ xdxrn502j)
+ status_led="xdxrn502j:green:power"
+ ;;
+ esac
+}
+
+set_state() {
+ get_status_led
+
+ case "$1" in
+ preinit)
+ insmod leds-gpio 2> /dev/null
+ status_led_blink_preinit
+ ;;
+ failsafe)
+ status_led_blink_failsafe
+ ;;
+ done)
+ status_led_on
+ ;;
+ esac
+}
diff --git a/target/linux/ramips/base-files/etc/.svn/text-base/inittab.svn-base b/target/linux/ramips/base-files/etc/.svn/text-base/inittab.svn-base
new file mode 100644
index 0000000..67c36a6
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/.svn/text-base/inittab.svn-base
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+ttyS0::askfirst:/bin/ash --login
+ttyS1::askfirst:/bin/ash --login
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
new file mode 100755
index 0000000..0c2ae83
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -0,0 +1,141 @@
+#!/bin/sh
+# Copyright (C) 2010-2013 OpenWrt.org
+
+. /lib/functions/leds.sh
+. /lib/ramips.sh
+
+get_status_led() {
+ case $(ramips_board_name) in
+ 3g-6200n)
+ status_led="edimax:green:power"
+ ;;
+ 3g300m)
+ status_led="tenda:blue:ap"
+ ;;
+ argus-atp52b)
+ status_led="argus-atp52b:green:run"
+ ;;
+ br6524n)
+ status_led="edimax:blue:power"
+ ;;
+ br6425)
+ status_led="edimax:green:power"
+ ;;
+ dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1)
+ status_led="d-link:green:status"
+ ;;
+ dir-645)
+ status_led="d-link:green:wps"
+ ;;
+ dap-1350)
+ status_led="d-link:blue:power"
+ ;;
+ esr-9753)
+ status_led="esr-9753:orange:power"
+ ;;
+ f5d8235-v2)
+ status_led="f5d8235v2:blue:router"
+ ;;
+ fonera20n)
+ status_led="fonera20n:green:power"
+ ;;
+ rt-n13u)
+ status_led="rt-n13u:power"
+ ;;
+ all0239-3g|\
+ hw550-3g)
+ status_led="hw550-3g:green:status"
+ ;;
+ mofi3500-3gn)
+ status_led="mofi3500-3gn:green:status"
+ ;;
+ nbg-419n)
+ status_led="nbg-419n:green:power"
+ ;;
+ nw718)
+ status_led="nw718:amber:cpu"
+ ;;
+ omni-emb|\
+ omni-emb-hpm)
+ status_led="emb:green:status"
+ ;;
+ psr-680w)
+ status_led="psr-680w:red:wan"
+ ;;
+ pwh2004)
+ status_led="pwh2004:green:power"
+ ;;
+ rt-n15)
+ status_led="rt-n15:blue:power"
+ ;;
+ rt-n10-plus)
+ status_led="asus:green:wps"
+ ;;
+ rt-n56u | wl-330n | wl-330n3g)
+ status_led="asus:blue:power"
+ ;;
+ sl-r7205)
+ status_led="sl-r7205:green:status"
+ ;;
+ tew-691gr|\
+ tew-692gr)
+ status_led="trendnet:green:wps"
+ ;;
+ v11st-fe)
+ status_led="v11st-fe:green:status"
+ ;;
+ v22rw-2x2)
+ status_led="v22rw-2x2:green:security"
+ ;;
+ w306r-v20)
+ status_led="w306r-v20:green:sys"
+ ;;
+ w502u)
+ status_led="alfa:blue:wps"
+ ;;
+ wcr-150gn)
+ status_led="wcr150gn:amber:power"
+ ;;
+ whr-g300n)
+ status_led="whr-g300n:green:router"
+ ;;
+ wli-tx4-ag300n)
+ status_led="buffalo:blue:power"
+ ;;
+ wl-351)
+ status_led="wl-351:amber:power"
+ ;;
+ wr512-3gn)
+ status_led="wr512:green:wps"
+ ;;
+ mzk-w300nh2)
+ status_led="mzkw300nh2:green:power"
+ ;;
+ ur-326n4g)
+ status_led="ur326:green:wps"
+ ;;
+ ur-336un)
+ status_led="ur336:green:wps"
+ ;;
+ xdxrn502j)
+ status_led="xdxrn502j:green:power"
+ ;;
+ esac
+}
+
+set_state() {
+ get_status_led
+
+ case "$1" in
+ preinit)
+ insmod leds-gpio 2> /dev/null
+ status_led_blink_preinit
+ ;;
+ failsafe)
+ status_led_blink_failsafe
+ ;;
+ done)
+ status_led_on
+ ;;
+ esac
+}
diff --git a/target/linux/ramips/base-files/etc/hotplug.d/.svn/entries b/target/linux/ramips/base-files/etc/hotplug.d/.svn/entries
new file mode 100644
index 0000000..e659f9d
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/hotplug.d/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/etc/hotplug.d
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+firmware
+dir
+
diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/entries b/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/entries
new file mode 100644
index 0000000..c38ecdc
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/etc/hotplug.d/firmware
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+10-rt2x00-eeprom
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+28de10bf94881ff4fbef8cfe0ab94df4
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1836
+
diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base b/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base
new file mode 100644
index 0000000..4078528
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+rt2x00_eeprom_die() {
+ echo "rt2x00 eeprom: " "$*"
+ exit 1
+}
+
+rt2x00_eeprom_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ . /lib/functions.sh
+
+ mtd=$(find_mtd_part $part)
+ [ -n "$mtd" ] || \
+ rt2x00_eeprom_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ rt2x00_eeprom_die "failed to extract from $mtd"
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ramips.sh
+
+board=$(ramips_board_name)
+
+case "$FIRMWARE" in
+"soc_wmac.eeprom")
+ case $board in
+ dir-300-b1 | \
+ dir-600-b1 | \
+ dir-600-b2 | \
+ dir-615-d)
+ rt2x00_eeprom_extract "devdata" 16384 272
+ ;;
+
+ dap-1350)
+ rt2x00_eeprom_extract "devdata" 0 272
+ ;;
+
+ rt-n10-plus | \
+ rt-g32-b1)
+ rt2x00_eeprom_extract "devconf" 0 272
+ ;;
+
+ f5d8235-v1 | \
+ f5d8235-v2)
+ rt2x00_eeprom_extract "u-boot" 262144 272
+ ;;
+
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ all0239-3g | \
+ all0256n | \
+ all5002 | \
+ argus-atp52b | \
+ bc2 | \
+ br6425 | \
+ broadway | \
+ br6524n | \
+ carambola | \
+ dir-615-h1 | \
+ dir-620-a1 | \
+ esr-9753 | \
+ fonera20n | \
+ rt-n13u | \
+ freestation5 | \
+ hw550-3g | \
+ mofi3500-3gn | \
+ pwh2004 | \
+ nbg-419n | \
+ nw718 | \
+ omni-emb | \
+ omni-emb-hpm | \
+ psr-680w | \
+ rt-n15 | \
+ rt-n56u | \
+ sl-r7205 | \
+ v11st-fe | \
+ v22rw-2x2 | \
+ w306r-v20 | \
+ w502u | \
+ wcr-150gn | \
+ whr-g300n | \
+ wl-330n | \
+ wl-330n3g | \
+ wl-351 | \
+ wli-tx4-ag300n | \
+ wr512-3gn | \
+ wr6202 | \
+ mzk-w300nh2 | \
+ ur-326n4g | \
+ ur-336un | \
+ xdxrn502j)
+ rt2x00_eeprom_extract "factory" 0 272
+ ;;
+
+ wl341v3)
+ rt2x00_eeprom_extract "board-nvram" 64880 272
+ ;;
+
+ *)
+ rt2x00_eeprom_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+
+"rt2x00pci_1_0.eeprom")
+ case $board in
+ rt-n56u)
+ rt2x00_eeprom_extract "factory" 32768 272
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
new file mode 100644
index 0000000..4078528
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+rt2x00_eeprom_die() {
+ echo "rt2x00 eeprom: " "$*"
+ exit 1
+}
+
+rt2x00_eeprom_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ . /lib/functions.sh
+
+ mtd=$(find_mtd_part $part)
+ [ -n "$mtd" ] || \
+ rt2x00_eeprom_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ rt2x00_eeprom_die "failed to extract from $mtd"
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ramips.sh
+
+board=$(ramips_board_name)
+
+case "$FIRMWARE" in
+"soc_wmac.eeprom")
+ case $board in
+ dir-300-b1 | \
+ dir-600-b1 | \
+ dir-600-b2 | \
+ dir-615-d)
+ rt2x00_eeprom_extract "devdata" 16384 272
+ ;;
+
+ dap-1350)
+ rt2x00_eeprom_extract "devdata" 0 272
+ ;;
+
+ rt-n10-plus | \
+ rt-g32-b1)
+ rt2x00_eeprom_extract "devconf" 0 272
+ ;;
+
+ f5d8235-v1 | \
+ f5d8235-v2)
+ rt2x00_eeprom_extract "u-boot" 262144 272
+ ;;
+
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ all0239-3g | \
+ all0256n | \
+ all5002 | \
+ argus-atp52b | \
+ bc2 | \
+ br6425 | \
+ broadway | \
+ br6524n | \
+ carambola | \
+ dir-615-h1 | \
+ dir-620-a1 | \
+ esr-9753 | \
+ fonera20n | \
+ rt-n13u | \
+ freestation5 | \
+ hw550-3g | \
+ mofi3500-3gn | \
+ pwh2004 | \
+ nbg-419n | \
+ nw718 | \
+ omni-emb | \
+ omni-emb-hpm | \
+ psr-680w | \
+ rt-n15 | \
+ rt-n56u | \
+ sl-r7205 | \
+ v11st-fe | \
+ v22rw-2x2 | \
+ w306r-v20 | \
+ w502u | \
+ wcr-150gn | \
+ whr-g300n | \
+ wl-330n | \
+ wl-330n3g | \
+ wl-351 | \
+ wli-tx4-ag300n | \
+ wr512-3gn | \
+ wr6202 | \
+ mzk-w300nh2 | \
+ ur-326n4g | \
+ ur-336un | \
+ xdxrn502j)
+ rt2x00_eeprom_extract "factory" 0 272
+ ;;
+
+ wl341v3)
+ rt2x00_eeprom_extract "board-nvram" 64880 272
+ ;;
+
+ *)
+ rt2x00_eeprom_die "board $board is not supported yet"
+ ;;
+ esac
+ ;;
+
+"rt2x00pci_1_0.eeprom")
+ case $board in
+ rt-n56u)
+ rt2x00_eeprom_extract "factory" 32768 272
+ ;;
+ esac
+ ;;
+esac
diff --git a/target/linux/ramips/base-files/etc/inittab b/target/linux/ramips/base-files/etc/inittab
new file mode 100644
index 0000000..67c36a6
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+ttyS0::askfirst:/bin/ash --login
+ttyS1::askfirst:/bin/ash --login
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/entries b/target/linux/ramips/base-files/etc/uci-defaults/.svn/entries
new file mode 100644
index 0000000..d43ab49
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/etc/uci-defaults
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+01_leds
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+3708cda2b86612688936bfd17e3ea9d6
+2013-02-02T17:21:05.243919Z
+35467
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2430
+
+09_fix-seama-header
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+ac682b85cb33c872900702babfa8c990
+2013-01-18T12:42:53.029206Z
+35217
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+214
+
+02_network
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+12e5ae1f3f5d02b7f9a7063dab64ed8f
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5499
+
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/09_fix-seama-header.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/09_fix-seama-header.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/prop-base/09_fix-seama-header.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base
new file mode 100644
index 0000000..104f201
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+. /lib/ramips.sh
+
+set_usb_led() {
+ ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
+}
+
+set_wifi_led() {
+ ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
+}
+
+board=$(ramips_board_name)
+
+case $board in
+ 3g-6200n)
+ set_wifi_led "edimax:amber:wlan"
+ set_usb_led "edimax:blue:3g"
+ ;;
+ 3g300m)
+ set_usb_led "tenda:blue:3g"
+ ;;
+ air3gii)
+ set_wifi_led "airlive:green:wlan"
+ set_usb_led "airlive:green:mobile"
+ ;;
+ all0256n)
+ ucidef_set_rssimon "wlan0" "40000" "1"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
+ ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ bc2)
+ set_usb_led "bc2:blue:usb"
+ ;;
+ br6425)
+ set_wifi_led "edimax:orange:wlan"
+ ;;
+ broadway)
+ set_usb_led "red:diskmounted"
+ set_wifi_led "red:wps_active"
+ ;;
+ br6524n)
+ set_wifi_led "edimax:blue:wlan"
+ ;;
+ dir-300-b1|\
+ dir-600-b1|\
+ dir-600-b2|\
+ dir-620-a1)
+ # ANDed with vlan switch port 4 led state
+ ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ dir-615-d|\
+ dir-615-h1)
+ ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ esr-9753)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ f5d8235-v1)
+ set_usb_led "f5d8235-v1:blue:storage"
+ ;;
+ f5d8235-v2)
+ set_usb_led "f5d8235v2:blue:storage"
+ ;;
+ fonera20n)
+ set_usb_led "fonera20n:orange:usb"
+ set_wifi_led "fonera20n:orange:wifi"
+ ;;
+ all0239-3g|\
+ hw550-3g)
+ set_usb_led "hw550-3g:green:usb"
+ ;;
+ mofi3500-3gn)
+ set_usb_led "mofi3500-3gn:green:usb"
+ ;;
+ mzk-w300nh2)
+ set_wifi_led "mzkw300nh2:amber:wlan"
+ ;;
+ nw718)
+ set_usb_led "nw718:amber:usb"
+ ;;
+ omni-emb-hpm)
+ ucidef_set_led_default "power" "POWER" "emb:orange:power" "1"
+ ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0"
+ set_wifi_led "emb:green:wifi"
+ ;;
+ sl-r7205)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ v11st-fe)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ w306r-v20)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ w502u)
+ set_usb_led "alfa:blue:usb"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ wcr-150gn)
+ set_usb_led "wcr150gn:amber:user"
+ ;;
+esac
+
+ucidef_commit_leds
+
+exit 0
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base
new file mode 100644
index 0000000..d6ab75a
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base
@@ -0,0 +1,272 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/ramips.sh
+. /lib/functions/uci-defaults.sh
+
+ramips_setup_rt3x5x_vlans()
+{
+ if [ ! -x /sbin/swconfig ]; then
+ # legacy default
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ return
+ fi
+ local wanports=""
+ local lanports=""
+ swconfig dev rt305x set reset 1
+ for port in 5 4 3 2 1 0; do
+ if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
+ continue
+ fi
+ if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
+ wanports="$port $wanports"
+ else
+ lanports="$port $lanports"
+ fi
+ done
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "rt305x" "1" "1"
+ ucidef_add_switch_vlan "rt305x" "1" "$lanports 6t"
+ ucidef_add_switch_vlan "rt305x" "2" "$wanports 6t"
+}
+
+ramips_setup_interfaces()
+{
+ local board="$1"
+
+ ucidef_set_interface_loopback
+
+ case $board in
+ 3g300m | \
+ all0256n | \
+ all5002 | \
+ broadway)
+ ucidef_add_switch "switch0" "1" "0"
+ ucidef_set_interface_lan "eth0"
+ ;;
+
+ dir-615-h1 | \
+ wl-330n)
+ ucidef_set_interface_lan "eth0.1"
+ ;;
+
+ 3g-6200n | \
+ argus-atp52b | \
+ b2c | \
+ nw718 | \
+ psr-680w | \
+ sl-r7205 | \
+ w502u | \
+ wr6202)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ;;
+
+ dir-645)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+ ucidef_add_switch_vlan "switch0" "2" "0 6t"
+ ;;
+
+ mzk-w300nh2)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
+ ucidef_add_switch_vlan "switch0" "2" "4 6t"
+ ;;
+
+ f5d8235-v1 | \
+ f5d8235-v2 | \
+ ur-326n4g)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+ ucidef_add_switch_vlan "switch0" "2" "0 6t"
+ ;;
+
+ ur-336un)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ;;
+
+ br6524n | \
+ v11st-fe)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
+ ucidef_add_switch_vlan "switch0" "2" "0 5t"
+ ;;
+
+ rt-n15 | \
+ wl-351)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
+ ucidef_add_switch_vlan "switch0" "2" "4 5t"
+ ;;
+
+ rt-n56u)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
+ ucidef_add_switch_vlan "switch0" "2" "4 8t"
+ ;;
+
+ tew-691gr|\
+ tew-692gr)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+ ucidef_add_switch_vlan "switch0" "2" "0t 5"
+ ;;
+
+ freestation5 | \
+ wcr-150gn)
+ ucidef_set_interfaces_lan_wan "eth0.2" "eth0.1"
+ ;;
+
+ omni-emb-hpm|\
+ wli-tx4-ag300n)
+ ucidef_set_interface_lan "eth0"
+ ;;
+
+ *)
+ RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
+ if [ -n "${RT3X5X}" ]; then
+ ramips_setup_rt3x5x_vlans
+ else
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ fi
+ ;;
+ esac
+}
+
+ramips_setup_macs()
+{
+ local board="$1"
+ local lan_mac=""
+ local wan_mac=""
+
+ case $board in
+ all0256n | \
+ all5002 | \
+ dir-615-h1)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ argus-atp52b | \
+ bc2 | \
+ br6425 | \
+ broadway | \
+ f5d8235-v1 | \
+ mzk-w300nh2 | \
+ nw718 | \
+ psr-680w | \
+ rt-n15 | \
+ sl-r7205 | \
+ wl-351)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ w306r-v20)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(macaddr_add "$lan_mac" 5)
+ ;;
+
+ rt-n13u | \
+ fonera20n)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-300-b1 |\
+ dir-300-b2 |\
+ dir-600-b1)
+ lan_mac=$(mtd_get_mac_binary devdata 16388)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-620-a1)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ lan_mac=$(macaddr_setbit_la "$lan_mac")
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-645)
+ lan_mac=$(mtd_get_mac_ascii nvram lanmac)
+ wan_mac=$(mtd_get_mac_ascii nvram wanmac)
+ ;;
+
+ esr-9753 | \
+ ur-326n4g | \
+ ur-336un)
+ lan_mac=$(mtd_get_mac_binary devdata 16388)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ nbg-419n | \
+ wcr-150gn)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+
+ omni-emb-hpm)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+
+ f5d8235-v2)
+ lan_mac=$(mtd_get_mac_binary "u-boot" 262148)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ rt-n56u)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(mtd_get_mac_binary factory 32772)
+ ;;
+
+ tew-691gr)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 3)
+ ;;
+
+ tew-692gr)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 4)
+ ;;
+
+ all0239-3g | \
+ carambola | \
+ w502u)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(mtd_get_mac_binary factory 46)
+ ;;
+
+ wl341v3)
+ lan_mac=$(mtd_get_mac_binary board-nvram 65440)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ wli-tx4-ag300n)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ ;;
+
+ esac
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac
+}
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+board=$(ramips_board_name)
+
+ramips_setup_interfaces $board
+ramips_setup_macs $board
+
+uci commit network
+
+exit 0
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/09_fix-seama-header.svn-base b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/09_fix-seama-header.svn-base
new file mode 100644
index 0000000..d8bed79
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/.svn/text-base/09_fix-seama-header.svn-base
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+. /lib/ramips.sh
+
+fix_seama_header() {
+ local part=$1
+
+ mtd fixseama $part
+}
+
+board=$(ramips_board_name)
+
+case "$board" in
+dir-645)
+ fix_seama_header kernel
+ ;;
+esac
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
new file mode 100755
index 0000000..104f201
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+. /lib/ramips.sh
+
+set_usb_led() {
+ ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
+}
+
+set_wifi_led() {
+ ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
+}
+
+board=$(ramips_board_name)
+
+case $board in
+ 3g-6200n)
+ set_wifi_led "edimax:amber:wlan"
+ set_usb_led "edimax:blue:3g"
+ ;;
+ 3g300m)
+ set_usb_led "tenda:blue:3g"
+ ;;
+ air3gii)
+ set_wifi_led "airlive:green:wlan"
+ set_usb_led "airlive:green:mobile"
+ ;;
+ all0256n)
+ ucidef_set_rssimon "wlan0" "40000" "1"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
+ ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ bc2)
+ set_usb_led "bc2:blue:usb"
+ ;;
+ br6425)
+ set_wifi_led "edimax:orange:wlan"
+ ;;
+ broadway)
+ set_usb_led "red:diskmounted"
+ set_wifi_led "red:wps_active"
+ ;;
+ br6524n)
+ set_wifi_led "edimax:blue:wlan"
+ ;;
+ dir-300-b1|\
+ dir-600-b1|\
+ dir-600-b2|\
+ dir-620-a1)
+ # ANDed with vlan switch port 4 led state
+ ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ dir-615-d|\
+ dir-615-h1)
+ ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ esr-9753)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ f5d8235-v1)
+ set_usb_led "f5d8235-v1:blue:storage"
+ ;;
+ f5d8235-v2)
+ set_usb_led "f5d8235v2:blue:storage"
+ ;;
+ fonera20n)
+ set_usb_led "fonera20n:orange:usb"
+ set_wifi_led "fonera20n:orange:wifi"
+ ;;
+ all0239-3g|\
+ hw550-3g)
+ set_usb_led "hw550-3g:green:usb"
+ ;;
+ mofi3500-3gn)
+ set_usb_led "mofi3500-3gn:green:usb"
+ ;;
+ mzk-w300nh2)
+ set_wifi_led "mzkw300nh2:amber:wlan"
+ ;;
+ nw718)
+ set_usb_led "nw718:amber:usb"
+ ;;
+ omni-emb-hpm)
+ ucidef_set_led_default "power" "POWER" "emb:orange:power" "1"
+ ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0"
+ set_wifi_led "emb:green:wifi"
+ ;;
+ sl-r7205)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ v11st-fe)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ w306r-v20)
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ w502u)
+ set_usb_led "alfa:blue:usb"
+ set_wifi_led "rt2800pci-phy0::radio"
+ ;;
+ wcr-150gn)
+ set_usb_led "wcr150gn:amber:user"
+ ;;
+esac
+
+ucidef_commit_leds
+
+exit 0
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network
new file mode 100755
index 0000000..d6ab75a
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -0,0 +1,272 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/ramips.sh
+. /lib/functions/uci-defaults.sh
+
+ramips_setup_rt3x5x_vlans()
+{
+ if [ ! -x /sbin/swconfig ]; then
+ # legacy default
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ return
+ fi
+ local wanports=""
+ local lanports=""
+ swconfig dev rt305x set reset 1
+ for port in 5 4 3 2 1 0; do
+ if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
+ continue
+ fi
+ if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
+ wanports="$port $wanports"
+ else
+ lanports="$port $lanports"
+ fi
+ done
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "rt305x" "1" "1"
+ ucidef_add_switch_vlan "rt305x" "1" "$lanports 6t"
+ ucidef_add_switch_vlan "rt305x" "2" "$wanports 6t"
+}
+
+ramips_setup_interfaces()
+{
+ local board="$1"
+
+ ucidef_set_interface_loopback
+
+ case $board in
+ 3g300m | \
+ all0256n | \
+ all5002 | \
+ broadway)
+ ucidef_add_switch "switch0" "1" "0"
+ ucidef_set_interface_lan "eth0"
+ ;;
+
+ dir-615-h1 | \
+ wl-330n)
+ ucidef_set_interface_lan "eth0.1"
+ ;;
+
+ 3g-6200n | \
+ argus-atp52b | \
+ b2c | \
+ nw718 | \
+ psr-680w | \
+ sl-r7205 | \
+ w502u | \
+ wr6202)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ;;
+
+ dir-645)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+ ucidef_add_switch_vlan "switch0" "2" "0 6t"
+ ;;
+
+ mzk-w300nh2)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
+ ucidef_add_switch_vlan "switch0" "2" "4 6t"
+ ;;
+
+ f5d8235-v1 | \
+ f5d8235-v2 | \
+ ur-326n4g)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+ ucidef_add_switch_vlan "switch0" "2" "0 6t"
+ ;;
+
+ ur-336un)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ;;
+
+ br6524n | \
+ v11st-fe)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
+ ucidef_add_switch_vlan "switch0" "2" "0 5t"
+ ;;
+
+ rt-n15 | \
+ wl-351)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
+ ucidef_add_switch_vlan "switch0" "2" "4 5t"
+ ;;
+
+ rt-n56u)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t"
+ ucidef_add_switch_vlan "switch0" "2" "4 8t"
+ ;;
+
+ tew-691gr|\
+ tew-692gr)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
+ ucidef_add_switch_vlan "switch0" "2" "0t 5"
+ ;;
+
+ freestation5 | \
+ wcr-150gn)
+ ucidef_set_interfaces_lan_wan "eth0.2" "eth0.1"
+ ;;
+
+ omni-emb-hpm|\
+ wli-tx4-ag300n)
+ ucidef_set_interface_lan "eth0"
+ ;;
+
+ *)
+ RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
+ if [ -n "${RT3X5X}" ]; then
+ ramips_setup_rt3x5x_vlans
+ else
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ fi
+ ;;
+ esac
+}
+
+ramips_setup_macs()
+{
+ local board="$1"
+ local lan_mac=""
+ local wan_mac=""
+
+ case $board in
+ all0256n | \
+ all5002 | \
+ dir-615-h1)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ argus-atp52b | \
+ bc2 | \
+ br6425 | \
+ broadway | \
+ f5d8235-v1 | \
+ mzk-w300nh2 | \
+ nw718 | \
+ psr-680w | \
+ rt-n15 | \
+ sl-r7205 | \
+ wl-351)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ w306r-v20)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(macaddr_add "$lan_mac" 5)
+ ;;
+
+ rt-n13u | \
+ fonera20n)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-300-b1 |\
+ dir-300-b2 |\
+ dir-600-b1)
+ lan_mac=$(mtd_get_mac_binary devdata 16388)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-620-a1)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ lan_mac=$(macaddr_setbit_la "$lan_mac")
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ dir-645)
+ lan_mac=$(mtd_get_mac_ascii nvram lanmac)
+ wan_mac=$(mtd_get_mac_ascii nvram wanmac)
+ ;;
+
+ esr-9753 | \
+ ur-326n4g | \
+ ur-336un)
+ lan_mac=$(mtd_get_mac_binary devdata 16388)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ nbg-419n | \
+ wcr-150gn)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+
+ omni-emb-hpm)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ ;;
+
+ f5d8235-v2)
+ lan_mac=$(mtd_get_mac_binary "u-boot" 262148)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ rt-n56u)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ wan_mac=$(mtd_get_mac_binary factory 32772)
+ ;;
+
+ tew-691gr)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 3)
+ ;;
+
+ tew-692gr)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 4)
+ ;;
+
+ all0239-3g | \
+ carambola | \
+ w502u)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(mtd_get_mac_binary factory 46)
+ ;;
+
+ wl341v3)
+ lan_mac=$(mtd_get_mac_binary board-nvram 65440)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ;;
+
+ wli-tx4-ag300n)
+ lan_mac=$(mtd_get_mac_binary factory 4)
+ ;;
+
+ esac
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac
+}
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+board=$(ramips_board_name)
+
+ramips_setup_interfaces $board
+ramips_setup_macs $board
+
+uci commit network
+
+exit 0
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
new file mode 100755
index 0000000..d8bed79
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+. /lib/ramips.sh
+
+fix_seama_header() {
+ local part=$1
+
+ mtd fixseama $part
+}
+
+board=$(ramips_board_name)
+
+case "$board" in
+dir-645)
+ fix_seama_header kernel
+ ;;
+esac
diff --git a/target/linux/ramips/base-files/lib/.svn/entries b/target/linux/ramips/base-files/lib/.svn/entries
new file mode 100644
index 0000000..9dc2779
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/.svn/entries
@@ -0,0 +1,68 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/lib
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+ramips.sh
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+33b007f2295ede63bd3b2943d92a0302
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3538
+
+upgrade
+dir
+
+preinit
+dir
+
diff --git a/target/linux/ramips/base-files/lib/.svn/prop-base/ramips.sh.svn-base b/target/linux/ramips/base-files/lib/.svn/prop-base/ramips.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/.svn/prop-base/ramips.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/lib/.svn/text-base/ramips.sh.svn-base b/target/linux/ramips/base-files/lib/.svn/text-base/ramips.sh.svn-base
new file mode 100644
index 0000000..6638b0a
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/.svn/text-base/ramips.sh.svn-base
@@ -0,0 +1,234 @@
+#!/bin/sh
+#
+# Copyright (C) 2010-2013 OpenWrt.org
+#
+
+RAMIPS_BOARD_NAME=
+RAMIPS_MODEL=
+
+all500x_board_detect() {
+ local systype
+
+ systype=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
+ case "$systype" in
+ *"RT5350"*)
+ RAMIPS_MODEL="Allnet ALL5003"
+ ;;
+ *"RT3352"*)
+ RAMIPS_MODEL="Allnet ALL5002"
+ ;;
+ esac
+}
+
+ramips_board_detect() {
+ local machine
+ local name
+
+ machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
+
+ case "$machine" in
+ *"8devices Carambola")
+ name="carambola"
+ ;;
+ *"Edimax 3g-6200n")
+ name="3g-6200n"
+ ;;
+ *"AirLive Air3GII")
+ name="air3gii"
+ ;;
+ *"Edimax BR-6425")
+ name="br6425"
+ ;;
+ *"Allnet ALL0239-3G")
+ name="all0239-3g"
+ ;;
+ *"Allnet ALL0256N")
+ name="all0256n"
+ ;;
+ *"Allnet ALL5002/ALL5003")
+ name="all5002"
+ ;;
+ *"ARC FreeStation5")
+ name="freestation5"
+ ;;
+ *"Argus ATP-52B")
+ name="argus-atp52b"
+ ;;
+ *"BR6524N")
+ name="br6524n"
+ ;;
+ *"Asus WL-330N")
+ name="wl-330n"
+ ;;
+ *"Asus WL-330N3G")
+ name="wl-330n3g"
+ ;;
+ *"Aztech HW550-3G")
+ name="hw550-3g"
+ ;;
+ *"DIR-300 B1")
+ name="dir-300-b1"
+ ;;
+ *"DIR-600 B1")
+ name="dir-600-b1"
+ ;;
+ *"DIR-600 B2")
+ name="dir-600-b2"
+ ;;
+ *"DIR-620 A1")
+ name="dir-620-a1"
+ ;;
+ *"DIR-615 H1")
+ name="dir-615-h1"
+ ;;
+ *"DIR-615 D")
+ name="dir-615-d"
+ ;;
+ *"DIR-645")
+ name="dir-645"
+ ;;
+ *"DAP-1350")
+ name="dap-1350"
+ ;;
+ *"ESR-9753")
+ name="esr-9753"
+ ;;
+ *"F5D8235 v1")
+ name="f5d8235-v1"
+ ;;
+ *"F5D8235 v2")
+ name="f5d8235-v2"
+ ;;
+ *"Hauppauge Broadway")
+ name="broadway"
+ ;;
+ *"La Fonera 2.0N")
+ name="fonera20n"
+ ;;
+ *"Asus RT-N13U")
+ name="rt-n13u"
+ ;;
+ *"MoFi Network MOFI3500-3GN")
+ name="mofi3500-3gn"
+ ;;
+ *"NBG-419N")
+ name="nbg-419n"
+ ;;
+ *"NexAira BC2")
+ name="bc2"
+ ;;
+ *"NW718")
+ name="nw718"
+ ;;
+ *"Omnima EMB HPM")
+ name="omni-emb-hpm"
+ ;;
+ *"Omnima MiniEMBWiFi")
+ name="omni-emb"
+ ;;
+ *"Petatel PSR-680W"*)
+ name="psr-680w"
+ ;;
+ *"Planex MZK-W300NH2"*)
+ name="mzk-w300nh2"
+ ;;
+ *"PWH2004")
+ name="pwh2004"
+ ;;
+ *"RT-G32 B1")
+ name="rt-g32-b1"
+ ;;
+ *"RT-N10+")
+ name="rt-n10-plus"
+ ;;
+ *"RT-N15")
+ name="rt-n15"
+ ;;
+ *"RT-N56U")
+ name="rt-n56u"
+ ;;
+ *"Skyline SL-R7205"*)
+ name="sl-r7205"
+ ;;
+ *"Sparklan WCR-150GN")
+ name="wcr-150gn"
+ ;;
+ *"V22RW-2X2")
+ name="v22rw-2x2"
+ ;;
+ *"W502U")
+ name="w502u"
+ ;;
+ *"WHR-G300N")
+ name="whr-g300n"
+ ;;
+ *"Sitecom WL-341 v3")
+ name="wl341v3"
+ ;;
+ *"Sitecom WL-351 v1 002")
+ name="wl-351"
+ ;;
+ *"Tenda 3G300M")
+ name="3g300m"
+ ;;
+ *"Tenda W306R V2.0")
+ name="w306r-v20"
+ ;;
+ *"TEW-691GR")
+ name="tew-691gr"
+ ;;
+ *"TEW-692GR")
+ name="tew-692gr"
+ ;;
+ *"Ralink V11ST-FE")
+ name="v11st-fe"
+ ;;
+ *"WLI-TX4-AG300N")
+ name="wli-tx4-ag300n"
+ ;;
+ *"WZR-AGL300NH")
+ name="wzr-agl300nh"
+ ;;
+ *"WR512-3GN-like router")
+ name="wr512-3gn"
+ ;;
+ *"UR-326N4G Wireless N router")
+ name="ur-326n4g"
+ ;;
+ *"UR-336UN Wireless N router")
+ name="ur-336un"
+ ;;
+ *"AWB WR6202")
+ name="wr6202"
+ ;;
+ *"XDX RN502J")
+ name="xdxrn502j"
+ ;;
+ *)
+ name="generic"
+ ;;
+ esac
+
+ case "$machine" in
+ *"Allnet ALL5002/ALL5003")
+ all500x_board_detect
+ ;;
+ esac
+
+ [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
+ [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"
+
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+ echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name
+ echo "$RAMIPS_MODEL" > /tmp/sysinfo/model
+}
+
+ramips_board_name() {
+ local name
+
+ [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+ [ -z "$name" ] && name="unknown"
+
+ echo "$name"
+}
diff --git a/target/linux/ramips/base-files/lib/preinit/.svn/entries b/target/linux/ramips/base-files/lib/preinit/.svn/entries
new file mode 100644
index 0000000..bf46dff
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/lib/preinit
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-03T12:47:02.440277Z
+35850
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+03_preinit_do_ramips.sh
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+be863146c3e1fa1d1f0d61b92be310f1
+2013-03-03T12:47:02.440277Z
+35850
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+105
+
+06_set_iface_mac
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+c08558292850cc633c7bd532eaaaee2f
+2013-02-16T11:50:25.188717Z
+35615
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1522
+
+05_ramips_load-input_drivers
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+155cc5c94b53b6d821d22e11e65243d2
+2012-02-11T20:37:34.973611Z
+30463
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+229
+
diff --git a/target/linux/ramips/base-files/lib/preinit/.svn/text-base/03_preinit_do_ramips.sh.svn-base b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/03_preinit_do_ramips.sh.svn-base
new file mode 100644
index 0000000..31ef5f8
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/03_preinit_do_ramips.sh.svn-base
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+do_ramips() {
+ . /lib/ramips.sh
+
+ ramips_board_detect
+}
+
+boot_hook_add preinit_main do_ramips
diff --git a/target/linux/ramips/base-files/lib/preinit/.svn/text-base/05_ramips_load-input_drivers.svn-base b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/05_ramips_load-input_drivers.svn-base
new file mode 100644
index 0000000..fbd4c83
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/05_ramips_load-input_drivers.svn-base
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+preinit_ramips_load_input_drivers() {
+ insmod input-core
+ insmod input-polldev
+ insmod gpio_keys_polled
+ insmod button-hotplug
+}
+
+boot_hook_add preinit_main preinit_ramips_load_input_drivers
diff --git a/target/linux/ramips/base-files/lib/preinit/.svn/text-base/06_set_iface_mac.svn-base b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/06_set_iface_mac.svn-base
new file mode 100644
index 0000000..fcfb86b
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/.svn/text-base/06_set_iface_mac.svn-base
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+preinit_set_mac_address() {
+ local mac
+
+ . /lib/functions.sh
+ . /lib/ramips.sh
+
+ case $(ramips_board_name) in
+ 3g-6200n |\
+ 3g300m | \
+ mzk-w300nh2 |\
+ wl-330n |\
+ wl-330n3g)
+ mac=$(mtd_get_mac_binary factory 4)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ bc2 |\
+ broadway |\
+ dir-620-a1 |\
+ esr-9753 |\
+ freestation5 |\
+ nw718 |\
+ psr-680w |\
+ rt-n56u |\
+ sl-r7205)
+ mac=$(mtd_get_mac_binary factory 4)
+ mac=$(macaddr_setbit_la "$mac")
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dir-300-b1 |\
+ dir-300-b2 |\
+ dir-600-b1)
+ mac=$(mtd_get_mac_binary devdata 16388)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dir-645)
+ mac=$(mtd_get_mac_ascii nvram lanmac)
+ mac=$(macaddr_setbit_la "$mac")
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dap-1350)
+ mac=$(mtd_get_mac_binary devdata 46)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ all0239-3g |\
+ all0256n |\
+ all5002 |\
+ carambola |\
+ dir-615-h1 |\
+ fonera20n |\
+ rt-n13u |\
+ hw550-3g |\
+ nbg-419n |\
+ omni-emb |\
+ omni-emb-hpm |\
+ tew-691gr |\
+ tew-692gr |\
+ w306r-v20 |\
+ w502u |\
+ wr6202 |\
+ xdxrn502j)
+ mac=$(mtd_get_mac_binary factory 40)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ wl341v3)
+ mac=$(mtd_get_mac_binary board-nvram 65440)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ rt-n10-plus)
+ mac=$(mtd_get_mac_binary devconf 4)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ esac
+}
+
+boot_hook_add preinit_main preinit_set_mac_address
diff --git a/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh b/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh
new file mode 100644
index 0000000..31ef5f8
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/03_preinit_do_ramips.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+do_ramips() {
+ . /lib/ramips.sh
+
+ ramips_board_detect
+}
+
+boot_hook_add preinit_main do_ramips
diff --git a/target/linux/ramips/base-files/lib/preinit/05_ramips_load-input_drivers b/target/linux/ramips/base-files/lib/preinit/05_ramips_load-input_drivers
new file mode 100644
index 0000000..fbd4c83
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/05_ramips_load-input_drivers
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+preinit_ramips_load_input_drivers() {
+ insmod input-core
+ insmod input-polldev
+ insmod gpio_keys_polled
+ insmod button-hotplug
+}
+
+boot_hook_add preinit_main preinit_ramips_load_input_drivers
diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
new file mode 100644
index 0000000..fcfb86b
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+preinit_set_mac_address() {
+ local mac
+
+ . /lib/functions.sh
+ . /lib/ramips.sh
+
+ case $(ramips_board_name) in
+ 3g-6200n |\
+ 3g300m | \
+ mzk-w300nh2 |\
+ wl-330n |\
+ wl-330n3g)
+ mac=$(mtd_get_mac_binary factory 4)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ bc2 |\
+ broadway |\
+ dir-620-a1 |\
+ esr-9753 |\
+ freestation5 |\
+ nw718 |\
+ psr-680w |\
+ rt-n56u |\
+ sl-r7205)
+ mac=$(mtd_get_mac_binary factory 4)
+ mac=$(macaddr_setbit_la "$mac")
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dir-300-b1 |\
+ dir-300-b2 |\
+ dir-600-b1)
+ mac=$(mtd_get_mac_binary devdata 16388)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dir-645)
+ mac=$(mtd_get_mac_ascii nvram lanmac)
+ mac=$(macaddr_setbit_la "$mac")
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ dap-1350)
+ mac=$(mtd_get_mac_binary devdata 46)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ all0239-3g |\
+ all0256n |\
+ all5002 |\
+ carambola |\
+ dir-615-h1 |\
+ fonera20n |\
+ rt-n13u |\
+ hw550-3g |\
+ nbg-419n |\
+ omni-emb |\
+ omni-emb-hpm |\
+ tew-691gr |\
+ tew-692gr |\
+ w306r-v20 |\
+ w502u |\
+ wr6202 |\
+ xdxrn502j)
+ mac=$(mtd_get_mac_binary factory 40)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ wl341v3)
+ mac=$(mtd_get_mac_binary board-nvram 65440)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ rt-n10-plus)
+ mac=$(mtd_get_mac_binary devconf 4)
+ ifconfig eth0 hw ether $mac 2>/dev/null
+ ;;
+ esac
+}
+
+boot_hook_add preinit_main preinit_set_mac_address
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
new file mode 100755
index 0000000..6638b0a
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -0,0 +1,234 @@
+#!/bin/sh
+#
+# Copyright (C) 2010-2013 OpenWrt.org
+#
+
+RAMIPS_BOARD_NAME=
+RAMIPS_MODEL=
+
+all500x_board_detect() {
+ local systype
+
+ systype=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
+ case "$systype" in
+ *"RT5350"*)
+ RAMIPS_MODEL="Allnet ALL5003"
+ ;;
+ *"RT3352"*)
+ RAMIPS_MODEL="Allnet ALL5002"
+ ;;
+ esac
+}
+
+ramips_board_detect() {
+ local machine
+ local name
+
+ machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
+
+ case "$machine" in
+ *"8devices Carambola")
+ name="carambola"
+ ;;
+ *"Edimax 3g-6200n")
+ name="3g-6200n"
+ ;;
+ *"AirLive Air3GII")
+ name="air3gii"
+ ;;
+ *"Edimax BR-6425")
+ name="br6425"
+ ;;
+ *"Allnet ALL0239-3G")
+ name="all0239-3g"
+ ;;
+ *"Allnet ALL0256N")
+ name="all0256n"
+ ;;
+ *"Allnet ALL5002/ALL5003")
+ name="all5002"
+ ;;
+ *"ARC FreeStation5")
+ name="freestation5"
+ ;;
+ *"Argus ATP-52B")
+ name="argus-atp52b"
+ ;;
+ *"BR6524N")
+ name="br6524n"
+ ;;
+ *"Asus WL-330N")
+ name="wl-330n"
+ ;;
+ *"Asus WL-330N3G")
+ name="wl-330n3g"
+ ;;
+ *"Aztech HW550-3G")
+ name="hw550-3g"
+ ;;
+ *"DIR-300 B1")
+ name="dir-300-b1"
+ ;;
+ *"DIR-600 B1")
+ name="dir-600-b1"
+ ;;
+ *"DIR-600 B2")
+ name="dir-600-b2"
+ ;;
+ *"DIR-620 A1")
+ name="dir-620-a1"
+ ;;
+ *"DIR-615 H1")
+ name="dir-615-h1"
+ ;;
+ *"DIR-615 D")
+ name="dir-615-d"
+ ;;
+ *"DIR-645")
+ name="dir-645"
+ ;;
+ *"DAP-1350")
+ name="dap-1350"
+ ;;
+ *"ESR-9753")
+ name="esr-9753"
+ ;;
+ *"F5D8235 v1")
+ name="f5d8235-v1"
+ ;;
+ *"F5D8235 v2")
+ name="f5d8235-v2"
+ ;;
+ *"Hauppauge Broadway")
+ name="broadway"
+ ;;
+ *"La Fonera 2.0N")
+ name="fonera20n"
+ ;;
+ *"Asus RT-N13U")
+ name="rt-n13u"
+ ;;
+ *"MoFi Network MOFI3500-3GN")
+ name="mofi3500-3gn"
+ ;;
+ *"NBG-419N")
+ name="nbg-419n"
+ ;;
+ *"NexAira BC2")
+ name="bc2"
+ ;;
+ *"NW718")
+ name="nw718"
+ ;;
+ *"Omnima EMB HPM")
+ name="omni-emb-hpm"
+ ;;
+ *"Omnima MiniEMBWiFi")
+ name="omni-emb"
+ ;;
+ *"Petatel PSR-680W"*)
+ name="psr-680w"
+ ;;
+ *"Planex MZK-W300NH2"*)
+ name="mzk-w300nh2"
+ ;;
+ *"PWH2004")
+ name="pwh2004"
+ ;;
+ *"RT-G32 B1")
+ name="rt-g32-b1"
+ ;;
+ *"RT-N10+")
+ name="rt-n10-plus"
+ ;;
+ *"RT-N15")
+ name="rt-n15"
+ ;;
+ *"RT-N56U")
+ name="rt-n56u"
+ ;;
+ *"Skyline SL-R7205"*)
+ name="sl-r7205"
+ ;;
+ *"Sparklan WCR-150GN")
+ name="wcr-150gn"
+ ;;
+ *"V22RW-2X2")
+ name="v22rw-2x2"
+ ;;
+ *"W502U")
+ name="w502u"
+ ;;
+ *"WHR-G300N")
+ name="whr-g300n"
+ ;;
+ *"Sitecom WL-341 v3")
+ name="wl341v3"
+ ;;
+ *"Sitecom WL-351 v1 002")
+ name="wl-351"
+ ;;
+ *"Tenda 3G300M")
+ name="3g300m"
+ ;;
+ *"Tenda W306R V2.0")
+ name="w306r-v20"
+ ;;
+ *"TEW-691GR")
+ name="tew-691gr"
+ ;;
+ *"TEW-692GR")
+ name="tew-692gr"
+ ;;
+ *"Ralink V11ST-FE")
+ name="v11st-fe"
+ ;;
+ *"WLI-TX4-AG300N")
+ name="wli-tx4-ag300n"
+ ;;
+ *"WZR-AGL300NH")
+ name="wzr-agl300nh"
+ ;;
+ *"WR512-3GN-like router")
+ name="wr512-3gn"
+ ;;
+ *"UR-326N4G Wireless N router")
+ name="ur-326n4g"
+ ;;
+ *"UR-336UN Wireless N router")
+ name="ur-336un"
+ ;;
+ *"AWB WR6202")
+ name="wr6202"
+ ;;
+ *"XDX RN502J")
+ name="xdxrn502j"
+ ;;
+ *)
+ name="generic"
+ ;;
+ esac
+
+ case "$machine" in
+ *"Allnet ALL5002/ALL5003")
+ all500x_board_detect
+ ;;
+ esac
+
+ [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
+ [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"
+
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+ echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name
+ echo "$RAMIPS_MODEL" > /tmp/sysinfo/model
+}
+
+ramips_board_name() {
+ local name
+
+ [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+ [ -z "$name" ] && name="unknown"
+
+ echo "$name"
+}
diff --git a/target/linux/ramips/base-files/lib/upgrade/.svn/entries b/target/linux/ramips/base-files/lib/upgrade/.svn/entries
new file mode 100644
index 0000000..1b73523
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/upgrade/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/target/linux/ramips/base-files/lib/upgrade
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+platform.sh
+file
+
+
+
+
+2013-03-17T12:12:46.000000Z
+dfb9586a22583e5e30ee319a72463829
+2013-03-11T21:02:43.602648Z
+35971
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1515
+
diff --git a/target/linux/ramips/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base b/target/linux/ramips/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/target/linux/ramips/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base b/target/linux/ramips/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base
new file mode 100644
index 0000000..97cc382
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base
@@ -0,0 +1,101 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+
+. /lib/ramips.sh
+
+PART_NAME=firmware
+RAMFS_COPY_DATA=/lib/ramips.sh
+
+platform_check_image() {
+ local board=$(ramips_board_name)
+ local magic="$(get_magic_long "$1")"
+
+ [ "$ARGC" -gt 1 ] && return 1
+
+ case "$board" in
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ all0239-3g | \
+ all0256n | \
+ all5002 | \
+ bc2 | \
+ broadway | \
+ carambola | \
+ dir-300-b1 | \
+ dir-600-b1 | \
+ dir-600-b2 | \
+ dir-615-h1 | \
+ dir-615-d | \
+ dir-620-a1 | \
+ dap-1350 | \
+ esr-9753 | \
+ fonera20n | \
+ rt-n13u | \
+ freestation5 | \
+ hw550-3g | \
+ mofi3500-3gn | \
+ mzk-w300nh2 | \
+ nbg-419n | \
+ nw718 | \
+ omni-emb | \
+ omni-emb-hpm | \
+ psr-680w | \
+ rt-g32-b1 | \
+ rt-n10-plus | \
+ rt-n15 | \
+ rt-n56u | \
+ sl-r7205 | \
+ tew-691gr | \
+ tew-692gr | \
+ w306r-v20 |\
+ w502u |\
+ wr6202 |\
+ v22rw-2x2 | \
+ wl341v3 | \
+ wl-330n | \
+ wl-351 | \
+ wli-tx4-ag300n | \
+ whr-g300n |\
+ ur-326n4g |\
+ ur-336un |\
+ wr512-3gn)
+ [ "$magic" != "27051956" ] && {
+ echo "Invalid image type."
+ return 1
+ }
+ return 0
+ ;;
+ dir-645)
+ [ "$magic" != "5ea3a417" ] && {
+ echo "Invalid image type."
+ return 1
+ }
+ return 0
+ ;;
+ esac
+
+ echo "Sysupgrade is not yet supported on $board."
+ return 1
+}
+
+platform_do_upgrade() {
+ local board=$(ramips_board_name)
+
+ case "$board" in
+ *)
+ default_do_upgrade "$ARGV"
+ ;;
+ esac
+}
+
+disable_watchdog() {
+ killall watchdog
+ ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
+ echo 'Could not disable watchdog'
+ return 1
+ }
+}
+
+append sysupgrade_pre_upgrade disable_watchdog
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
new file mode 100755
index 0000000..97cc382
--- /dev/null
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,101 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+
+. /lib/ramips.sh
+
+PART_NAME=firmware
+RAMFS_COPY_DATA=/lib/ramips.sh
+
+platform_check_image() {
+ local board=$(ramips_board_name)
+ local magic="$(get_magic_long "$1")"
+
+ [ "$ARGC" -gt 1 ] && return 1
+
+ case "$board" in
+ 3g-6200n | \
+ 3g300m | \
+ air3gii | \
+ all0239-3g | \
+ all0256n | \
+ all5002 | \
+ bc2 | \
+ broadway | \
+ carambola | \
+ dir-300-b1 | \
+ dir-600-b1 | \
+ dir-600-b2 | \
+ dir-615-h1 | \
+ dir-615-d | \
+ dir-620-a1 | \
+ dap-1350 | \
+ esr-9753 | \
+ fonera20n | \
+ rt-n13u | \
+ freestation5 | \
+ hw550-3g | \
+ mofi3500-3gn | \
+ mzk-w300nh2 | \
+ nbg-419n | \
+ nw718 | \
+ omni-emb | \
+ omni-emb-hpm | \
+ psr-680w | \
+ rt-g32-b1 | \
+ rt-n10-plus | \
+ rt-n15 | \
+ rt-n56u | \
+ sl-r7205 | \
+ tew-691gr | \
+ tew-692gr | \
+ w306r-v20 |\
+ w502u |\
+ wr6202 |\
+ v22rw-2x2 | \
+ wl341v3 | \
+ wl-330n | \
+ wl-351 | \
+ wli-tx4-ag300n | \
+ whr-g300n |\
+ ur-326n4g |\
+ ur-336un |\
+ wr512-3gn)
+ [ "$magic" != "27051956" ] && {
+ echo "Invalid image type."
+ return 1
+ }
+ return 0
+ ;;
+ dir-645)
+ [ "$magic" != "5ea3a417" ] && {
+ echo "Invalid image type."
+ return 1
+ }
+ return 0
+ ;;
+ esac
+
+ echo "Sysupgrade is not yet supported on $board."
+ return 1
+}
+
+platform_do_upgrade() {
+ local board=$(ramips_board_name)
+
+ case "$board" in
+ *)
+ default_do_upgrade "$ARGV"
+ ;;
+ esac
+}
+
+disable_watchdog() {
+ killall watchdog
+ ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
+ echo 'Could not disable watchdog'
+ return 1
+ }
+}
+
+append sysupgrade_pre_upgrade disable_watchdog