From patchwork Tue Feb 24 05:02:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Olivari X-Patchwork-Id: 442795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 34E60140159 for ; Tue, 24 Feb 2015 16:04:16 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 869A428BFE8; Tue, 24 Feb 2015 06:02:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 178E528BE4C for ; Tue, 24 Feb 2015 06:02:24 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7.6 Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 24 Feb 2015 06:02:19 +0100 (CET) Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 9254F140275; Tue, 24 Feb 2015 05:02:26 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 81F6714028C; Tue, 24 Feb 2015 05:02:26 +0000 (UTC) Received: from mathieu-linux.qualcomm.com (qf-scl1nat.qualcomm.com [207.114.132.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mathieu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4957F140296; Tue, 24 Feb 2015 05:02:25 +0000 (UTC) From: Mathieu Olivari To: blogic@openwrt.org Date: Mon, 23 Feb 2015 21:02:01 -0800 Message-Id: <1424754121-19468-5-git-send-email-mathieu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424754121-19468-1-git-send-email-mathieu@codeaurora.org> References: <1424754121-19468-1-git-send-email-mathieu@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: mmcclint@codeaurora.org, openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 4/4] ipq806x: initialize the network on AP148 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Mathieu Olivari --- .../ipq806x/base-files/etc/uci-defaults/network | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 target/linux/ipq806x/base-files/etc/uci-defaults/network diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/network b/target/linux/ipq806x/base-files/etc/uci-defaults/network new file mode 100755 index 0000000..34e9fe4 --- /dev/null +++ b/target/linux/ipq806x/base-files/etc/uci-defaults/network @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Copyright (c) 2015 The Linux Foundation. All rights reserved. +# Copyright (C) 2011 OpenWrt.org +# + +[ -e /etc/config/network ] && exit 0 + +touch /etc/config/network + +. /lib/functions/uci-defaults.sh +. /lib/ipq806x.sh + +ucidef_set_interface_loopback + +board=$(ipq806x_board_name) + +case "$board" in +ap148) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4" + ucidef_add_switch_vlan "switch0" "2" "0 5" + ;; +*) + echo "Unsupported hardware. Network interfaces not intialized" + ;; +esac + +uci commit network + +exit 0