[PATCH RESEND 11/11] kernel/x86: isolate board-specific files to associated architecture

Elliott Mitchell ehem+openwrt at m5p.com
Tue Dec 5 18:54:42 PST 2023


Split the board.d files to isolate their data to associated
architectures.  Seems wasteful to include all board-specific data
with every single build.

Signed-off-by: Elliott Mitchell <ehem+openwrt at m5p.com>
---
 .../{ => 64}/base-files/etc/board.d/01_leds   |  5 -----
 .../base-files/etc/board.d/02_network         |  7 -------
 .../x86/geode/base-files/etc/board.d/01_leds  | 18 ++++++++++++++++
 .../geode/base-files/etc/board.d/02_network   | 21 +++++++++++++++++++
 4 files changed, 39 insertions(+), 12 deletions(-)
 rename target/linux/x86/{ => 64}/base-files/etc/board.d/01_leds (85%)
 rename target/linux/x86/{ => 64}/base-files/etc/board.d/02_network (93%)
 create mode 100644 target/linux/x86/geode/base-files/etc/board.d/01_leds
 create mode 100644 target/linux/x86/geode/base-files/etc/board.d/02_network

diff --git a/target/linux/x86/base-files/etc/board.d/01_leds b/target/linux/x86/64/base-files/etc/board.d/01_leds
similarity index 85%
rename from target/linux/x86/base-files/etc/board.d/01_leds
rename to target/linux/x86/64/base-files/etc/board.d/01_leds
index 47ea0929e6..2d65997d99 100644
--- a/target/linux/x86/base-files/etc/board.d/01_leds
+++ b/target/linux/x86/64/base-files/etc/board.d/01_leds
@@ -23,11 +23,6 @@ sophos-sg-105wr2|sophos-sg-125wr2|sophos-sg-135wr2|sophos-xg-105wr2|sophos-xg-12
 sophos-sg-105wr3|sophos-sg-125wr3|sophos-sg-135wr3|sophos-xg-105wr3|sophos-xg-125wr3|sophos-xg-135wr3)
 	ucidef_set_led_netdev "wlan" "WiFi" "ath10k-phy0" "phy0tpt"
 	;;
-traverse-technologies-geos)
-	ucidef_set_led_netdev "lan" "LAN" "geos:1" "br-lan" "tx rx"
-	ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt"
-	ucidef_set_led_default "diag" "DIAG" "geos:3" "1"
-	;;
 silicom-80500-0214-*)
         ucidef_set_led_netdev "wan" "WAN" "multicolor:fp_center" "wan0"
         ucidef_set_led_netdev "lan" "LAN" "multicolor:fp_right" "br-lan"
diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/64/base-files/etc/board.d/02_network
similarity index 93%
rename from target/linux/x86/base-files/etc/board.d/02_network
rename to target/linux/x86/64/base-files/etc/board.d/02_network
index b18ab60120..c47f79b607 100644
--- a/target/linux/x86/base-files/etc/board.d/02_network
+++ b/target/linux/x86/64/base-files/etc/board.d/02_network
@@ -71,13 +71,6 @@ sophos-sg-135r3|sophos-xg-135r3| \
 sophos-sg-135wr3|sophos-xg-135wr3)
 	ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth5 eth7 eth8" "eth6"
 	;;
-traverse-technologies-geos)
-	ucidef_set_interface_lan "eth0 eth1"
-	ucidef_add_atm_bridge "0" "35" "llc" "bridged"
-	ucidef_set_interface_wan "nas0" "dhcp"
-	macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
-	[ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
-	;;
 silicom-80500-0214-*)
         ucidef_set_network_device_path "wan0" "pci0000:00/0000:00:16.0/0000:03:00.0"
         ucidef_set_network_device_path "wan1" "pci0000:00/0000:00:16.0/0000:03:00.1"
diff --git a/target/linux/x86/geode/base-files/etc/board.d/01_leds b/target/linux/x86/geode/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..75fd60c1f9
--- /dev/null
+++ b/target/linux/x86/geode/base-files/etc/board.d/01_leds
@@ -0,0 +1,18 @@
+#
+# Copyright © 2017 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+traverse-technologies-geos)
+	ucidef_set_led_netdev "lan" "LAN" "geos:1" "br-lan" "tx rx"
+	ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt"
+	ucidef_set_led_default "diag" "DIAG" "geos:3" "1"
+	;;
+esac
+board_config_flush
+
+exit 0
diff --git a/target/linux/x86/geode/base-files/etc/board.d/02_network b/target/linux/x86/geode/base-files/etc/board.d/02_network
new file mode 100644
index 0000000000..53cc0f8261
--- /dev/null
+++ b/target/linux/x86/geode/base-files/etc/board.d/02_network
@@ -0,0 +1,21 @@
+#
+# Copyright © 2017 OpenWrt.org
+#
+
+. /lib/functions/system.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+traverse-technologies-geos)
+	ucidef_set_interface_lan "eth0 eth1"
+	ucidef_add_atm_bridge "0" "35" "llc" "bridged"
+	ucidef_set_interface_wan "nas0" "dhcp"
+	macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
+	[ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
+	;;
+esac
+board_config_flush
+
+exit 0
-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |       ehem+openwrt at m5p.com     PGP 87145445       |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445






More information about the openwrt-devel mailing list