[1/2] adds support vor tp-link cpe210

Submitted by Tobias Klaus on May 10, 2016, 6:47 a.m.

Details

Message ID 1462862866-6685-2-git-send-email-tk+ff@meskal.net
State Superseded, archived
Headers show

Commit Message

Tobias Klaus May 10, 2016, 6:47 a.m.
Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
---
 bsp/ar71xx/root_file_system/etc/network.cpe210 | 28 ++++++++++++++++++++++++++
 bsp/board_ar71xx.bsp                           |  3 ++-
 bsp/default/root_file_system/etc/rc.local.tpl  |  3 +++
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 bsp/ar71xx/root_file_system/etc/network.cpe210

Patch hide | download patch | download mbox

diff --git a/bsp/ar71xx/root_file_system/etc/network.cpe210 b/bsp/ar71xx/root_file_system/etc/network.cpe210
new file mode 100644
index 0000000..e1313ba
--- /dev/null
+++ b/bsp/ar71xx/root_file_system/etc/network.cpe210
@@ -0,0 +1,28 @@ 
+WANDEV=eth0
+SWITCHDEV=eth0
+CLIENT_PORTS="0t"
+WAN_PORTS="0t"
+BATMAN_PORTS="0t"
+CLIENTIF="w2ap eth0.1"
+
+ETHMESHMAC="w2ap"
+
+. /etc/network.mode
+
+#LAN0: default: BATMAN
+if [ "${LAN0MODE}" = "BATMAN" ] ; then
+  BATMAN_PORTS="${BATMAN_PORTS} 5"
+elif [ "${LAN0MODE}" = "CLIENT" ] ; then
+  CLIENT_PORTS="${CLIENT_PORTS} 5"
+else
+  WAN_PORTS="${WAN_PORTS} 5"
+fi
+
+#LAN1: default: BATMAN
+if [ "${LAN1MODE}" = "WAN" ] ; then
+  WAN_PORTS="${WAN_PORTS} 4"
+elif [ "${LAN1MODE}" = "CLIENT" ] ; then
+  CLIENT_PORTS="${CLIENT_PORTS} 4"
+else
+  BATMAN_PORTS="${BATMAN_PORTS} 4"
+fi
diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
index e246dc4..cbdac68 100644
--- a/bsp/board_ar71xx.bsp
+++ b/bsp/board_ar71xx.bsp
@@ -1,7 +1,8 @@ 
 machine=ar71xx
 chipset=ar71xx
 target=$builddir/$machine
-images=("openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
+images=("openwrt-ar71xx-generic-cpe210-220-510-520-squashfs-sysupgrade.bin"
+        "openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
         "openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-sysupgrade.bin"
         "openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-sysupgrade.bin"
         "openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-sysupgrade.bin"
diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
index cb8aa04..5a18675 100755
--- a/bsp/default/root_file_system/etc/rc.local.tpl
+++ b/bsp/default/root_file_system/etc/rc.local.tpl
@@ -50,6 +50,9 @@  case "$BOARD" in
     tl-mr3020)
         BOARD=tl-mr3020-v1
         ;;
+    cpe510)
+        grep "CPE210" /var/sysinfo/model && BOARD=cpe210
+        ;;
 esac
 
 if ! uci get board.model.name; then

Comments

Tim Niemeyer May 10, 2016, 7:27 a.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi

Am 10. Mai 2016 08:47:45 MESZ, schrieb Tobias Klaus <tk+ff@meskal.net>:
>Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
>---
>bsp/ar71xx/root_file_system/etc/network.cpe210 | 28
>++++++++++++++++++++++++++
> bsp/board_ar71xx.bsp                           |  3 ++-
> bsp/default/root_file_system/etc/rc.local.tpl  |  3 +++
> 3 files changed, 33 insertions(+), 1 deletion(-)
> create mode 100644 bsp/ar71xx/root_file_system/etc/network.cpe210
>
>diff --git a/bsp/ar71xx/root_file_system/etc/network.cpe210
>b/bsp/ar71xx/root_file_system/etc/network.cpe210
>new file mode 100644
>index 0000000..e1313ba
>--- /dev/null
>+++ b/bsp/ar71xx/root_file_system/etc/network.cpe210
>@@ -0,0 +1,28 @@
>+WANDEV=eth0
>+SWITCHDEV=eth0
>+CLIENT_PORTS="0t"
>+WAN_PORTS="0t"
>+BATMAN_PORTS="0t"
>+CLIENTIF="w2ap eth0.1"
>+
>+ETHMESHMAC="w2ap"
>+
>+. /etc/network.mode
>+
>+#LAN0: default: BATMAN
>+if [ "${LAN0MODE}" = "BATMAN" ] ; then
>+  BATMAN_PORTS="${BATMAN_PORTS} 5"
>+elif [ "${LAN0MODE}" = "CLIENT" ] ; then
>+  CLIENT_PORTS="${CLIENT_PORTS} 5"
>+else
>+  WAN_PORTS="${WAN_PORTS} 5"
>+fi
>+
>+#LAN1: default: BATMAN
>+if [ "${LAN1MODE}" = "WAN" ] ; then
>+  WAN_PORTS="${WAN_PORTS} 4"
>+elif [ "${LAN1MODE}" = "CLIENT" ] ; then
>+  CLIENT_PORTS="${CLIENT_PORTS} 4"
>+else
>+  BATMAN_PORTS="${BATMAN_PORTS} 4"
>+fi
>diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
>index e246dc4..cbdac68 100644
>--- a/bsp/board_ar71xx.bsp
>+++ b/bsp/board_ar71xx.bsp
>@@ -1,7 +1,8 @@
> machine=ar71xx
> chipset=ar71xx
> target=$builddir/$machine
>-images=("openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
>+images=("openwrt-ar71xx-generic-cpe210-220-510-520-squashfs-sysupgrade.bin"

Bin grad unterwegs und kann nicht näher nach gucken.. Aber geht mit diesem Namen das sysupgrade script.

Ansonsten sieht der Patch soweit gut aus.

Bitte nochmal testen, ob das sysupgrade geht. Wenn es geht:
Reviewed-by: Tim Niemeyer <tim@tn-x.org>

Tim

>+        "openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
>        "openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-sysupgrade.bin"
>         "openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-sysupgrade.bin"
>         "openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-sysupgrade.bin"
>diff --git a/bsp/default/root_file_system/etc/rc.local.tpl
>b/bsp/default/root_file_system/etc/rc.local.tpl
>index cb8aa04..5a18675 100755
>--- a/bsp/default/root_file_system/etc/rc.local.tpl
>+++ b/bsp/default/root_file_system/etc/rc.local.tpl
>@@ -50,6 +50,9 @@ case "$BOARD" in
>     tl-mr3020)
>         BOARD=tl-mr3020-v1
>         ;;
>+    cpe510)
>+        grep "CPE210" /var/sysinfo/model && BOARD=cpe210
>+        ;;
> esac
>
> if ! uci get board.model.name; then
-----BEGIN PGP SIGNATURE-----

iQE5BAEBCgAjHBxUaW0gTmllbWV5ZXIgPHRpbUB0bi14Lm9yZz4FAlcxjUQACgkQ
ELiw0DPkKM/PgwgAk9qxurLfzbUy/ZWXByC9h9Q4xqI9M1Zoi71l4UUg/eLsBVvS
RT38+XLP1jq6Vm+sQeC/TTOgXURLs9/VKqd17wIyZPN5oU2iU0SMIWGk8GUGOBpK
ZY6DWGTCjkjOknie27DcVPRqZSHQKbdvdO81NacBgS0HsIUuU6cnmubegaztrwTv
z5nq1sbj9HxtqHpFov12n1C5BukqCr/DuakW2sLp/CNauo48hilkhZWYxmyF3/xv
KcWXvZ+PZWZ/q6Ch2+WylpTenk8oY2WrQsSfdwwzhFe1AyiQd/QjZOABw7mIamnk
2dQklvVJSDToCeYddYjyk2B9s6UZCYipEEjZcw==
=LfEA
-----END PGP SIGNATURE-----
Jan Kraus May 10, 2016, 4:45 p.m.
Hi,

schaut soweit gut aus.
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>

Ggf. in der network.mode und auf jeden Fall im Wiki dokumentieren, was
bei der CPE in die network.mode einzutragen ist. Du hast das hier ja
anders als bisher gelöst.

Grüße Jan

Am Dienstag, den 10.05.2016, 08:47 +0200 schrieb Tobias Klaus:
> Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
> ---
>  bsp/ar71xx/root_file_system/etc/network.cpe210 | 28 ++++++++++++++++++++++++++
>  bsp/board_ar71xx.bsp                           |  3 ++-
>  bsp/default/root_file_system/etc/rc.local.tpl  |  3 +++
>  3 files changed, 33 insertions(+), 1 deletion(-)
>  create mode 100644 bsp/ar71xx/root_file_system/etc/network.cpe210
> 
> diff --git a/bsp/ar71xx/root_file_system/etc/network.cpe210 b/bsp/ar71xx/root_file_system/etc/network.cpe210
> new file mode 100644
> index 0000000..e1313ba
> --- /dev/null
> +++ b/bsp/ar71xx/root_file_system/etc/network.cpe210
> @@ -0,0 +1,28 @@
> +WANDEV=eth0
> +SWITCHDEV=eth0
> +CLIENT_PORTS="0t"
> +WAN_PORTS="0t"
> +BATMAN_PORTS="0t"
> +CLIENTIF="w2ap eth0.1"
> +
> +ETHMESHMAC="w2ap"
> +
> +. /etc/network.mode
> +
> +#LAN0: default: BATMAN
> +if [ "${LAN0MODE}" = "BATMAN" ] ; then
> +  BATMAN_PORTS="${BATMAN_PORTS} 5"
> +elif [ "${LAN0MODE}" = "CLIENT" ] ; then
> +  CLIENT_PORTS="${CLIENT_PORTS} 5"
> +else
> +  WAN_PORTS="${WAN_PORTS} 5"
> +fi
> +
> +#LAN1: default: BATMAN
> +if [ "${LAN1MODE}" = "WAN" ] ; then
> +  WAN_PORTS="${WAN_PORTS} 4"
> +elif [ "${LAN1MODE}" = "CLIENT" ] ; then
> +  CLIENT_PORTS="${CLIENT_PORTS} 4"
> +else
> +  BATMAN_PORTS="${BATMAN_PORTS} 4"
> +fi
> diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
> index e246dc4..cbdac68 100644
> --- a/bsp/board_ar71xx.bsp
> +++ b/bsp/board_ar71xx.bsp
> @@ -1,7 +1,8 @@
>  machine=ar71xx
>  chipset=ar71xx
>  target=$builddir/$machine
> -images=("openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
> +images=("openwrt-ar71xx-generic-cpe210-220-510-520-squashfs-sysupgrade.bin"
> +        "openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
>          "openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-sysupgrade.bin"
>          "openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-sysupgrade.bin"
>          "openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-sysupgrade.bin"
> diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
> index cb8aa04..5a18675 100755
> --- a/bsp/default/root_file_system/etc/rc.local.tpl
> +++ b/bsp/default/root_file_system/etc/rc.local.tpl
> @@ -50,6 +50,9 @@ case "$BOARD" in
>      tl-mr3020)
>          BOARD=tl-mr3020-v1
>          ;;
> +    cpe510)
> +        grep "CPE210" /var/sysinfo/model && BOARD=cpe210
> +        ;;
>  esac
>  
>  if ! uci get board.model.name; then
> -- 
> 2.8.2
>
Jan Kraus May 10, 2016, 4:50 p.m.
Hi,

grad noch was übersehen:
Bitte die commit message noch anpassen. Es sollte vermutlich "adds
support for" heißen.

Grüße Jan
Am Dienstag, den 10.05.2016, 18:45 +0200 schrieb mayosemmel:
> Hi,
> 
> schaut soweit gut aus.
> Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
> 
> Ggf. in der network.mode und auf jeden Fall im Wiki dokumentieren, was
> bei der CPE in die network.mode einzutragen ist. Du hast das hier ja
> anders als bisher gelöst.
> 
> Grüße Jan
> 
> Am Dienstag, den 10.05.2016, 08:47 +0200 schrieb Tobias Klaus:
> > Signed-off-by: Tobias Klaus <tk+ff@meskal.net>
> > ---
> >  bsp/ar71xx/root_file_system/etc/network.cpe210 | 28 ++++++++++++++++++++++++++
> >  bsp/board_ar71xx.bsp                           |  3 ++-
> >  bsp/default/root_file_system/etc/rc.local.tpl  |  3 +++
> >  3 files changed, 33 insertions(+), 1 deletion(-)
> >  create mode 100644 bsp/ar71xx/root_file_system/etc/network.cpe210
> > 
> > diff --git a/bsp/ar71xx/root_file_system/etc/network.cpe210 b/bsp/ar71xx/root_file_system/etc/network.cpe210
> > new file mode 100644
> > index 0000000..e1313ba
> > --- /dev/null
> > +++ b/bsp/ar71xx/root_file_system/etc/network.cpe210
> > @@ -0,0 +1,28 @@
> > +WANDEV=eth0
> > +SWITCHDEV=eth0
> > +CLIENT_PORTS="0t"
> > +WAN_PORTS="0t"
> > +BATMAN_PORTS="0t"
> > +CLIENTIF="w2ap eth0.1"
> > +
> > +ETHMESHMAC="w2ap"
> > +
> > +. /etc/network.mode
> > +
> > +#LAN0: default: BATMAN
> > +if [ "${LAN0MODE}" = "BATMAN" ] ; then
> > +  BATMAN_PORTS="${BATMAN_PORTS} 5"
> > +elif [ "${LAN0MODE}" = "CLIENT" ] ; then
> > +  CLIENT_PORTS="${CLIENT_PORTS} 5"
> > +else
> > +  WAN_PORTS="${WAN_PORTS} 5"
> > +fi
> > +
> > +#LAN1: default: BATMAN
> > +if [ "${LAN1MODE}" = "WAN" ] ; then
> > +  WAN_PORTS="${WAN_PORTS} 4"
> > +elif [ "${LAN1MODE}" = "CLIENT" ] ; then
> > +  CLIENT_PORTS="${CLIENT_PORTS} 4"
> > +else
> > +  BATMAN_PORTS="${BATMAN_PORTS} 4"
> > +fi
> > diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
> > index e246dc4..cbdac68 100644
> > --- a/bsp/board_ar71xx.bsp
> > +++ b/bsp/board_ar71xx.bsp
> > @@ -1,7 +1,8 @@
> >  machine=ar71xx
> >  chipset=ar71xx
> >  target=$builddir/$machine
> > -images=("openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
> > +images=("openwrt-ar71xx-generic-cpe210-220-510-520-squashfs-sysupgrade.bin"
> > +        "openwrt-ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin"
> >          "openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-sysupgrade.bin"
> >          "openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-sysupgrade.bin"
> >          "openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-sysupgrade.bin"
> > diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
> > index cb8aa04..5a18675 100755
> > --- a/bsp/default/root_file_system/etc/rc.local.tpl
> > +++ b/bsp/default/root_file_system/etc/rc.local.tpl
> > @@ -50,6 +50,9 @@ case "$BOARD" in
> >      tl-mr3020)
> >          BOARD=tl-mr3020-v1
> >          ;;
> > +    cpe510)
> > +        grep "CPE210" /var/sysinfo/model && BOARD=cpe210
> > +        ;;
> >  esac
> >  
> >  if ! uci get board.model.name; then
> > -- 
> > 2.8.2
> > 
>