From patchwork Mon Apr 12 12:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 1465228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=pNJ3c1iO; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.a=rsa-sha256 header.s=b header.b=gNgCLWZK; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FJp2w48kqz9sjB for ; Mon, 12 Apr 2021 22:29:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s1NaFT4/CXV5oProIrux1BhCsn93ZVu8llat4iIgBAI=; b=pNJ3c1iO9uqg5zZh+2tZXsAqN fH+K5m6FNK2S1knjCYe76qzoANwt5r37lyaFg8uM/eStu9ILkSnAV2hnaUj1k6TBSl2t4NpxiDtQS /1UH54UJxTX8bWejMckcTU/u2RJxfM7MonLzQO1GS3EkP41MuV9BhWpGx/ZzjXq+vQK+XnsEvlpYw lC8jXNHHtUtMFhI4pFXYneIUUYYjM02kladSEV0VtM9PiKZwaRpVSE6IfzifVHJn9wNjbQx1dWbIa T3wkRwFLUKLvhA9bsaizziqhpwy4HNgnS/wKI3D59A1HvhDUp/ltaqwhlyZv7bH8yHPiBmlVZAgCy vEnJCYlZA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVvfa-006gZ9-6e; Mon, 12 Apr 2021 12:27:58 +0000 Received: from canardo.mork.no ([2001:4641::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVvfB-006gS8-CO for openwrt-devel@lists.openwrt.org; Mon, 12 Apr 2021 12:27:36 +0000 Received: from canardo.mork.no (ip6-localhost [IPv6:0:0:0:0:0:0:0:1]) by canardo.mork.no (8.15.2/8.15.2) with ESMTPS id 13CCRT9q029504 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 12 Apr 2021 14:27:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1618230449; bh=yV4WeNbRzhiho4R+dpDM2xY7u8cMrLU2BoMvoF8yVnY=; h=From:To:Cc:Subject:Date:Message-Id:References:From; b=gNgCLWZK3MaXygVQ3AQj6gpMV0rR3ID6yLbViBZkZXAEw97ZkLbdGtPK2a/gIfCvr XGGSNSRgKvkn7nnhPo0d60LvqqCi7kFXRdEieszABm7wgJR6sJ1mYqsVCtY6uXc8tC bQnoH+J5maiW0H5n4meRUIOW5RJz66tvGk1BHP8k= Received: (from bjorn@localhost) by canardo.mork.no (8.15.2/8.15.2/Submit) id 13CCRTV3029495; Mon, 12 Apr 2021 14:27:29 +0200 From: =?utf-8?q?Bj=C3=B8rn_Mork?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Bj=C3=B8rn_Mork?= Subject: [PATCH 2/3] realtek: sort the port list numerically Date: Mon, 12 Apr 2021 14:27:24 +0200 Message-Id: <20210412122725.29430-3-bjorn@mork.no> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210412122725.29430-1-bjorn@mork.no> References: <20210412122725.29430-1-bjorn@mork.no> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on canardo.mork.no X-Virus-Scanned: clamav-milter 0.102.4 at canardo X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_132733_738219_6A29EECD X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Mac adresses are assigned in the order given by the port list. The interfaces are also brought up in this order. This target supports devices with up to 52 ports. Sorting these alphabetically is very [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:4641:0:0:0:0:0:1 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Mac adresses are assigned in the order given by the port list. The interfaces are also brought up in this order. This target supports devices with up to 52 ports. Sorting these alphabetically is very confusing, and assigning mac addresses in alphabetic order does not match stock firmware behaviour. There are probably better ways to do the numrical sorting, but this was what I came up with... Signed-off-by: Bjørn Mork --- target/linux/realtek/base-files/etc/board.d/02_network | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 44f1f0a7a5c1..06293174b0df 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -17,10 +17,7 @@ ucidef_set_poe() { board=$(board_name) board_config_update -lan_list="" -for lan in /sys/class/net/lan*; do - lan_list="$lan_list $(basename $lan)" -done +lan_list=$(for lan in /sys/class/net/lan*; do echo "${lan#/sys/class/net/lan}"; done|sort -n|sed -e 's/^/lan/'|xargs) ucidef_set_bridge_device switch ucidef_set_interface_lan "$lan_list"