mirror of
https://github.com/FUjr/gl-infra-builder.git
synced 2025-12-16 09:10:02 +00:00
73 lines
1.8 KiB
Diff
73 lines
1.8 KiB
Diff
From a70578eadae572187daab68d6e7318f10daeb140 Mon Sep 17 00:00:00 2001
|
|
From: Weiping Yang <weiping.yang@gl-inet.com>
|
|
Date: Sun, 26 Feb 2023 22:44:41 -0500
|
|
Subject: [PATCH] mvebu-adjust-02_network
|
|
|
|
---
|
|
.../base-files/etc/board.d/02_network | 25 ++++++++++++++++++-
|
|
1 file changed, 24 insertions(+), 1 deletion(-)
|
|
mode change 100644 => 100755 target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
|
|
|
|
diff --git a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
|
|
old mode 100644
|
|
new mode 100755
|
|
index 7da9de58c7..441fc286e8
|
|
--- a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
|
|
+++ b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
|
|
@@ -1,9 +1,12 @@
|
|
+#!/bin/sh
|
|
#
|
|
# Copyright (C) 2014-2016 OpenWrt.org
|
|
# Copyright (C) 2016 LEDE-Project.org
|
|
#
|
|
|
|
+. /lib/functions.sh
|
|
. /lib/functions/uci-defaults.sh
|
|
+. /lib/functions/system.sh
|
|
|
|
board_config_update
|
|
|
|
@@ -11,11 +14,12 @@ board=$(board_name)
|
|
|
|
case "$board" in
|
|
glinet,gl-mv1000|\
|
|
+gl-mv1000|\
|
|
globalscale,espressobin|\
|
|
globalscale,espressobin-emmc|\
|
|
globalscale,espressobin-v7|\
|
|
globalscale,espressobin-v7-emmc)
|
|
- ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
|
|
+ ucidef_set_interfaces_lan_wan "lan0 lan1 usb0" "wan"
|
|
;;
|
|
globalscale,espressobin-ultra)
|
|
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan"
|
|
@@ -29,6 +33,25 @@ methode,udpu)
|
|
;;
|
|
esac
|
|
|
|
+mvebu_setup_macs()
|
|
+{
|
|
+ local board="$1"
|
|
+ local lan_mac=""
|
|
+ local wan_mac=""
|
|
+
|
|
+ case "$board" in
|
|
+ glinet,gl-mv1000|\
|
|
+ gl-mv1000)
|
|
+ wan_mac=$(mtd_get_mac_binary "factory" 0)
|
|
+ lan_mac=$(macaddr_add "$wan_mac" 1)
|
|
+ ;;
|
|
+ esac
|
|
+
|
|
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
|
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
|
+}
|
|
+
|
|
+mvebu_setup_macs $board
|
|
board_config_flush
|
|
|
|
exit 0
|
|
--
|
|
2.17.1
|
|
|