brcm2708: Use uci-defaults for network config
authorJohn Crispin <john@openwrt.org>
Sat, 12 Jul 2014 06:50:21 +0000 (06:50 +0000)
committerJohn Crispin <john@openwrt.org>
Sat, 12 Jul 2014 06:50:21 +0000 (06:50 +0000)
By using uci-defaults force_link is enabled, which fixes some link issues if ethernet cable isn't connected when LAN is initialized.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
SVN-Revision: 41583

target/linux/brcm2708/base-files/etc/config/network [deleted file]
target/linux/brcm2708/base-files/etc/uci-defaults/02_network [new file with mode: 0644]

diff --git a/target/linux/brcm2708/base-files/etc/config/network b/target/linux/brcm2708/base-files/etc/config/network
deleted file mode 100644 (file)
index 1d5ded3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright (C) 2006 OpenWrt.org
-
-config interface loopback
-       option ifname   lo
-       option proto    static
-       option ipaddr   127.0.0.1
-       option netmask  255.0.0.0
-
-config interface lan
-       option ifname   eth0
-       option proto    static
-       option ipaddr   192.168.1.1
-       option netmask  255.255.255.0
diff --git a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
new file mode 100644 (file)
index 0000000..e7e35c5
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Copyright (C) 2014 OpenWrt.org
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+. /lib/functions/uci-defaults.sh
+
+ucidef_set_interface_loopback
+ucidef_set_interface_lan "eth0"
+
+uci commit network
+
+exit 0