[PATCH] new file: bsp/ar71xx/root_file_system/etc/network.tl-wa860re-v1 modified: bsp/board_ar71xx.bsp modified: bsp/default/root_file_system/etc/network.sh modified: bsp/default/root_file_system/etc/rc.local.tpl

Tim Niemeyer tim.niemeyer at mastersword.de
Sa Jan 2 00:31:41 CET 2016


Moin Christian

Sieht alles soweit super aus. Mir ist beim drüber gucken noch das
ETH0MAC=1 ins Auge gefallen. 

Am Donnerstag, den 31.12.2015, 15:49 +0100 schrieb fff at chrisi01.de:
> From: Christian Dresel <fff at chrisi01.de>
> 
> ---
>  .../root_file_system/etc/network.tl-wa860re-v1     | 32 ++++++++++++++++++++++
>  bsp/board_ar71xx.bsp                               |  2 ++
>  bsp/default/root_file_system/etc/network.sh        | 14 +++++++++-
>  bsp/default/root_file_system/etc/rc.local.tpl      |  3 ++
>  4 files changed, 50 insertions(+), 1 deletion(-)
>  create mode 100644 bsp/ar71xx/root_file_system/etc/network.tl-wa860re-v1
> 
> diff --git a/bsp/ar71xx/root_file_system/etc/network.tl-wa860re-v1 b/bsp/ar71xx/root_file_system/etc/network.tl-wa860re-v1
> new file mode 100644
> index 0000000..d4a5611
> --- /dev/null
> +++ b/bsp/ar71xx/root_file_system/etc/network.tl-wa860re-v1
> @@ -0,0 +1,32 @@
> +WANDEV=eth0
> +SWITCHDEV=eth0
> +CLIENT_PORTS=""
> +WAN_PORTS=""
> +BATMAN_PORTS=""
> +
> +. /etc/network.mode
> +
> +CLIENTIF="w2ap"
> +ETHMESHMAC=
> +ROUTERMAC=w2mesh

Ob die Settings hier soweit richtig sind kann ich nicht beurteilen. Wird
schon stimmen. :-)

> +
> +uci set network.$SWITCHDEV=interface
> +uci set network.$SWITCHDEV.ifname=$SWITCHDEV
> +uci set network.mesh.ifname="bat0"
> +
> +if [ "$ETHMODE" = "WAN" ] ; then
> +  ## Activate for WAN:
> +  echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
> +  echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
> +  echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
> +  echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
> +  uci set network.wan.ifname=$WANDEV
> +elif [ "$ETHMODE" = "CLIENT" ] ; then
> +  ## Activate Client:
> +  CLIENTIF="w2ap eth0"
> +  uci set network.mesh.ifname="bat0 $SWITCHDEV"
> +else
> +  ## Activate BATMAN:
> +  uci set network.ethmesh.ifname="$SWITCHDEV"
> +  ETH0MAC=1
Ich würde hier keine 1 erwarten, sondern wie bei den anderen xxxMAC
Variablen ein Interface-Namen:
ETH0MAC=w2ap

> +fi
> diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
> index d6055b2..6e01f03 100644
> --- a/bsp/board_ar71xx.bsp
> +++ b/bsp/board_ar71xx.bsp
> @@ -26,6 +26,8 @@ board_postbuild() {
>  
>      cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-*.bin ./bin/
>      cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr1043nd-v2-squashfs-*.bin ./bin/
> +
> +    cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wa860re-v1-squashfs-*.bin ./bin/
>  }
>  
>  board_clean() {
> diff --git a/bsp/default/root_file_system/etc/network.sh b/bsp/default/root_file_system/etc/network.sh
> index 63d3815..6c64083 100644
> --- a/bsp/default/root_file_system/etc/network.sh
> +++ b/bsp/default/root_file_system/etc/network.sh
> @@ -100,4 +100,16 @@ if [[ -n "$ROUTERMAC" ]]; then
>          ifconfig br-mesh up
>          /etc/init.d/network restart
>      fi
> -fi
> \ No newline at end of file
> +fi
> +
> +if [[ -n "$ETH0MAC" ]]; then
> +        echo "Fixing MAC on eth0"
> +        sleep 10
> +        NEW_MACADDR=$(cat /sys/class/net/w2ap/address)
Hier wäre es dann:
NEW_MACADDR=$(cat /sys/class/net/$ETH0MAC/address)

Tim

> +        uci set network.eth0.macaddr=$NEW_MACADDR
> +        uci commit
> +        ifconfig eth0 down
> +        ifconfig eth0 hw ether $NEW_MACADDR
> +        ifconfig eth0 up
> +        /etc/init.d/network restart
> +fi
> diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
> index b115fc1..6f83886 100755
> --- a/bsp/default/root_file_system/etc/rc.local.tpl
> +++ b/bsp/default/root_file_system/etc/rc.local.tpl
> @@ -23,6 +23,9 @@ case "$BOARD" in
>      nanostation-m)
>          BOARD=ubnt-nano-m
>          ;;
> +    tl-wa860re)
> +        BOARD=tl-wa860re-v1
> +        ;;
>  esac
>  
>  if ! uci get board.model.name; then
> -- 
> 2.1.4
> 

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 473 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20160102/bf1c314a/attachment-0002.sig>


Mehr Informationen über die Mailingliste franken-dev