aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/orion
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-12-04 14:39:14 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-12-04 14:39:14 +0000
commit9c29a7b75564e6cd7a6f7b0cc4eea74e302fda3e (patch)
treebedae4cfb1b5c1ef04bd6412c0d141ccde900d81 /target/linux/orion
parent118d00906cf282e9708a6f1d2e6bfffb685a558e (diff)
downloadmaster-187ad058-9c29a7b75564e6cd7a6f7b0cc4eea74e302fda3e.tar.gz
master-187ad058-9c29a7b75564e6cd7a6f7b0cc4eea74e302fda3e.tar.bz2
master-187ad058-9c29a7b75564e6cd7a6f7b0cc4eea74e302fda3e.zip
orion: convert initial network configuration to board.d
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47759 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/orion')
-rwxr-xr-xtarget/linux/orion/base-files/etc/board.d/02_network15
-rw-r--r--target/linux/orion/base-files/etc/uci-defaults/10-network53
2 files changed, 15 insertions, 53 deletions
diff --git a/target/linux/orion/base-files/etc/board.d/02_network b/target/linux/orion/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..96cd083c45
--- /dev/null
+++ b/target/linux/orion/base-files/etc/board.d/02_network
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults-new.sh
+
+board_config_update
+
+if grep -q lan1 /proc/net/dev; then
+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+else
+ ucidef_set_interface_lan "eth0"
+fi
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/orion/base-files/etc/uci-defaults/10-network b/target/linux/orion/base-files/etc/uci-defaults/10-network
deleted file mode 100644
index 5d5a5851f9..0000000000
--- a/target/linux/orion/base-files/etc/uci-defaults/10-network
+++ /dev/null
@@ -1,53 +0,0 @@
-config_simple() {
-cat >> /etc/config/network <<EOF
-config interface lan
- option ifname eth0
- option type bridge
- option proto static
- option ipaddr 192.168.1.1
- option netmask 255.255.255.0
- option ip6assign 60
-EOF
-}
-
-config_dsa() {
-cat >> /etc/config/network <<EOF
-config interface eth0
- option ifname eth0
-
-config interface wan
- option ifname wan
- option proto dhcp
- option hostname openwrt
-
-config interface lan
- option ifname "lan1 lan2 lan3 lan4"
- option type bridge
- option proto static
- option ipaddr 192.168.1.1
- option netmask 255.255.255.0
- option ip6assign 60
-
-config interface wan6
- option ifname wan
- option proto dhcpv6
-
-config globals globals
- option ula_prefix auto
-EOF
-}
-
-cat > /etc/config/network <<EOF
-config interface loopback
- option ifname lo
- option proto static
- option ipaddr 127.0.0.1
- option netmask 255.0.0.0
-
-EOF
-
-if grep -q lan /proc/net/dev; then
- config_dsa
-else
- config_simple
-fi