[openwrt/openwrt] archs38: use generic 02_sysinfo

LEDE Commits lede-commits at lists.infradead.org
Wed Jul 22 12:28:35 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3c190ef112979793cd0e2148c53c6208a642a463

commit 3c190ef112979793cd0e2148c53c6208a642a463
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sat Jul 18 16:02:06 2020 +0200

    archs38: use generic 02_sysinfo
    
    Currently archs38 sets a board name from compatible for no apparent
    reason. Just use the compatible directly instead.
    
    This theoretically removes a board name "generic" when no compatible
    was present, however, there is no case where this "generic" board
    name was actually used.
    
    This also fixes an issue where snps,axs103 would not have been
    properly detected anyway, as its case was not set up syntactically
    correct.
    
    Fixes: 73015c4cb378 ("linux: add support of Synopsys ARCHS38-based boards")
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../archs38/base-files/etc/board.d/02_network      |  3 +-
 target/linux/archs38/base-files/lib/arc.sh         | 43 ----------------------
 .../base-files/lib/preinit/01_preinit_arc.sh       |  7 ----
 3 files changed, 2 insertions(+), 51 deletions(-)

diff --git a/target/linux/archs38/base-files/etc/board.d/02_network b/target/linux/archs38/base-files/etc/board.d/02_network
index 60a2602316..dcf33788c5 100755
--- a/target/linux/archs38/base-files/etc/board.d/02_network
+++ b/target/linux/archs38/base-files/etc/board.d/02_network
@@ -8,7 +8,8 @@
 board_config_update
 
 case "$(board_name)" in
-"arc-sdp"*|"arc-hsdk"*)
+snps,axs103|\
+snps,hsdk)
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
 esac
diff --git a/target/linux/archs38/base-files/lib/arc.sh b/target/linux/archs38/base-files/lib/arc.sh
deleted file mode 100644
index 50aaaa2d27..0000000000
--- a/target/linux/archs38/base-files/lib/arc.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-
-# defaults
-ARC_BOARD_NAME="generic"
-ARC_BOARD_MODEL="Generic ARC board"
-
-arc_board_detect() {
-	local board
-	local model
-	local compatible
-
-	[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
-
-	model="$( cat /proc/device-tree/model )"
-	compatible="$( cat /proc/device-tree/compatible )"
-
-	case "$compatible" in
-	"snps,axs103""snps,arc-sdp")
-		board="arc-sdp";
-		;;
-        "snps,hsdk")
-                board="arc-hsdk";
-                ;;
-	"snps,nsim_hs")
-		board="arc-nsim";
-		;;
-	esac
-
-	if [ "$board" != "" ]; then
-		ARC_BOARD_NAME="$board"
-	fi
-
-	if [ "$model" != "" ]; then
-		ARC_BOARD_MODEL="$model"
-	fi
-
-	echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name
-	echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model
-	echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL"
-}
diff --git a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh b/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh
deleted file mode 100644
index c5cd905828..0000000000
--- a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-do_arc() {
-	. /lib/arc.sh
-
-	arc_board_detect
-}
-
-boot_hook_add preinit_main do_arc



More information about the lede-commits mailing list