ramips: remove default network configuration, and generate that from uci-defaults
authorGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:48:51 +0000 (22:48 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:48:51 +0000 (22:48 +0000)
SVN-Revision: 29387

target/linux/ramips/base-files.mk [new file with mode: 0644]
target/linux/ramips/base-files/etc/uci-defaults/network

diff --git a/target/linux/ramips/base-files.mk b/target/linux/ramips/base-files.mk
new file mode 100644 (file)
index 0000000..d6682bd
--- /dev/null
@@ -0,0 +1,5 @@
+define Package/base-files/install-target
+       rm -f $(1)/etc/config/network
+endef
+
+
index 7cb6b833a7435f3a5a1eb869d63d782869bff6e2..a00e162d01dc1c5cf6d62824fb1e8ff2ce5bca66 100755 (executable)
@@ -58,8 +58,11 @@ ramips_setup_interfaces()
 
        *)
                RT3X5X=`cat /proc/cpuinfo | grep RT3.5`
-               [ -z "${RT3X5X}" ] || \
+               if [ -n "${RT3X5X}" ]; then
                        ucidef_set_interfaces_lan_wan "eth0.1 eth0.2"
+               else
+                       ucidef_set_interfaces_lan_wan "eth0 eth1"
+               fi
                ;;
        esac
 }
@@ -88,6 +91,10 @@ ramips_setup_macs()
        [ -n $wan_mac ] && ucidef_set_interface_macaddr wan $wan_mac
 }
 
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
 board=$(ramips_board_name)
 
 ramips_setup_interfaces $board