]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mvebu: split base-files across subtargets
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 18 Jan 2020 01:21:13 +0000 (02:21 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 21 Jan 2020 13:24:49 +0000 (14:24 +0100)
For the mvebu target in particular, there is a lot of files in
base-files that are only relevant for one subtarget. Improve
overview and reduce size per subtarget by moving/splitting
base-files depending on the subtarget they belong to.

While at it, consolidate 01_leds by using the model part of
the board name as variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
17 files changed:
target/linux/mvebu/base-files/etc/board.d/01_leds [deleted file]
target/linux/mvebu/base-files/lib/upgrade/platform.sh [deleted file]
target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network [new file with mode: 0755]
target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU [moved from target/linux/mvebu/base-files/lib/preinit/82_uDPU with 100% similarity]
target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh [new file with mode: 0755]
target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh [moved from target/linux/mvebu/base-files/lib/upgrade/uDPU.sh with 100% similarity]
target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network [new file with mode: 0755]
target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh [new file with mode: 0755]
target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds [new file with mode: 0755]
target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network [moved from target/linux/mvebu/base-files/etc/board.d/02_network with 66% similarity]
target/linux/mvebu/cortexa9/base-files/etc/init.d/bootcount [moved from target/linux/mvebu/base-files/etc/init.d/bootcount with 100% similarity]
target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless [moved from target/linux/mvebu/base-files/etc/uci-defaults/03_wireless with 100% similarity]
target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/04_mambafan [moved from target/linux/mvebu/base-files/etc/uci-defaults/04_mambafan with 100% similarity]
target/linux/mvebu/cortexa9/base-files/lib/preinit/06_set_iface_mac [moved from target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac with 100% similarity]
target/linux/mvebu/cortexa9/base-files/lib/preinit/81_linksys_syscfg [moved from target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg with 100% similarity]
target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh [moved from target/linux/mvebu/base-files/lib/upgrade/linksys.sh with 100% similarity]
target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh [new file with mode: 0755]

diff --git a/target/linux/mvebu/base-files/etc/board.d/01_leds b/target/linux/mvebu/base-files/etc/board.d/01_leds
deleted file mode 100755 (executable)
index 14313ee..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2014-2016 OpenWrt.org
-# Copyright (C) 2016 LEDE-Project.org
-#
-
-. /lib/functions/uci-defaults.sh
-
-board_config_update
-
-board=$(board_name)
-
-case "$board" in
-linksys,caiman)
-       ucidef_set_led_netdev "wan" "WAN" "pca963x:caiman:white:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:caiman:white:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:caiman:white:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:caiman:white:usb3_2" "usb3-port1"
-       ;;
-linksys,cobra)
-       ucidef_set_led_netdev "wan" "WAN" "pca963x:cobra:white:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:cobra:white:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:cobra:white:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:cobra:white:usb3_2" "usb3-port1"
-       ;;
-linksys,mamba)
-       ucidef_set_led_netdev "wan" "WAN" "mamba:white:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "mamba:white:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "mamba:white:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "mamba:white:usb3_2" "usb3-port2"
-       ;;
-linksys,rango)
-       ucidef_set_led_netdev "wan" "WAN" "pca963x:rango:white:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:rango:white:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:rango:white:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:rango:white:usb3_2" "usb3-port1"
-       ;;
-linksys,shelby)
-       ucidef_set_led_netdev "wan" "WAN" "pca963x:shelby:white:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:shelby:white:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:shelby:white:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:shelby:white:usb3_2" "usb3-port1"
-       ;;
-linksys,venom)
-       ucidef_set_led_netdev "wan" "WAN" "pca963x:venom:blue:wan" "eth1"
-       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:venom:blue:usb2" "usb1-port1"
-       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:venom:blue:usb3_1" "usb2-port1" "usb3-port1"
-       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:venom:blue:usb3_2" "usb3-port1"
-       ;;
-
-esac
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
deleted file mode 100755 (executable)
index 0223b72..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (C) 2014-2016 OpenWrt.org
-# Copyright (C) 2016 LEDE-Project.org
-#
-
-RAMFS_COPY_BIN='fw_printenv fw_setenv'
-RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
-REQUIRE_IMAGE_METADATA=1
-
-platform_check_image() {
-       case "$(board_name)" in
-       cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
-       marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
-               platform_check_image_sdcard "$1"
-               ;;
-       *)
-               return 0
-               ;;
-       esac
-}
-
-platform_do_upgrade() {
-       case "$(board_name)" in
-       linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
-               platform_do_upgrade_linksys "$1"
-               ;;
-       cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
-       marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
-               platform_do_upgrade_sdcard "$1"
-               ;;
-       methode,udpu)
-               platform_do_upgrade_uDPU "$1"
-               ;;
-       *)
-               default_do_upgrade "$1"
-               ;;
-       esac
-}
-platform_copy_config() {
-       case "$(board_name)" in
-       linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
-               platform_copy_config_linksys
-               ;;
-       cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
-       marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
-               platform_copy_config_sdcard
-               ;;
-       methode,udpu)
-               platform_copy_config_uDPU
-               ;;
-       esac
-}
diff --git a/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network
new file mode 100755 (executable)
index 0000000..ba4b930
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+globalscale,espressobin|\
+globalscale,espressobin-emmc|\
+globalscale,espressobin-v7|\
+globalscale,espressobin-v7-emmc)
+       ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
+       ;;
+marvell,armada-3720-db|\
+methode,udpu)
+       ucidef_set_interfaces_lan_wan "eth1" "eth0"
+       ;;
+*)
+       ucidef_set_interface_lan "eth0"
+       ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..cdf5933
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+       case "$(board_name)" in
+       globalscale,espressobin|\
+       globalscale,espressobin-emmc|\
+       globalscale,espressobin-v7|\
+       globalscale,espressobin-v7-emmc)
+               platform_check_image_sdcard "$1"
+               ;;
+       *)
+               return 0
+               ;;
+       esac
+}
+
+platform_do_upgrade() {
+       case "$(board_name)" in
+       globalscale,espressobin|\
+       globalscale,espressobin-emmc|\
+       globalscale,espressobin-v7|\
+       globalscale,espressobin-v7-emmc)
+               platform_do_upgrade_sdcard "$1"
+               ;;
+       methode,udpu)
+               platform_do_upgrade_uDPU "$1"
+               ;;
+       *)
+               default_do_upgrade "$1"
+               ;;
+       esac
+}
+platform_copy_config() {
+       case "$(board_name)" in
+       globalscale,espressobin|\
+       globalscale,espressobin-emmc|\
+       globalscale,espressobin-v7|\
+       globalscale,espressobin-v7-emmc)
+               platform_copy_config_sdcard
+               ;;
+       methode,udpu)
+               platform_copy_config_uDPU
+               ;;
+       esac
+}
diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network
new file mode 100755 (executable)
index 0000000..080e32a
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+marvell,armada8040-mcbin)
+       ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
+       ;;
+marvell,armada8040-db)
+       ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
+       ;;
+marvell,armada7040-db)
+       ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
+       ;;
+*)
+       ucidef_set_interface_lan "eth0"
+       ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..2428de0
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+       case "$(board_name)" in
+       marvell,armada8040-mcbin)
+               platform_check_image_sdcard "$1"
+               ;;
+       *)
+               return 0
+               ;;
+       esac
+}
+
+platform_do_upgrade() {
+       case "$(board_name)" in
+       marvell,armada8040-mcbin)
+               platform_do_upgrade_sdcard "$1"
+               ;;
+       *)
+               default_do_upgrade "$1"
+               ;;
+       esac
+}
+platform_copy_config() {
+       case "$(board_name)" in
+       marvell,armada8040-mcbin)
+               platform_copy_config_sdcard
+               ;;
+       esac
+}
diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds b/target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds
new file mode 100755 (executable)
index 0000000..a7762f0
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+boardname="${board##*,}"
+
+case "$board" in
+linksys,caiman|\
+linksys,cobra|\
+linksys,rango|\
+linksys,shelby)
+       ucidef_set_led_netdev "wan" "WAN" "pca963x:$boardname:white:wan" "eth1"
+       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:$boardname:white:usb2" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:$boardname:white:usb3_1" "usb2-port1" "usb3-port1"
+       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:$boardname:white:usb3_2" "usb3-port1"
+       ;;
+linksys,mamba)
+       ucidef_set_led_netdev "wan" "WAN" "mamba:white:wan" "eth1"
+       ucidef_set_led_usbport "usb1" "USB 1" "mamba:white:usb2" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB 2" "mamba:white:usb3_1" "usb2-port1" "usb3-port1"
+       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "mamba:white:usb3_2" "usb3-port2"
+       ;;
+linksys,venom)
+       ucidef_set_led_netdev "wan" "WAN" "pca963x:venom:blue:wan" "eth1"
+       ucidef_set_led_usbport "usb1" "USB 1" "pca963x:venom:blue:usb2" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB 2" "pca963x:venom:blue:usb3_1" "usb2-port1" "usb3-port1"
+       ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:venom:blue:usb3_2" "usb3-port1"
+       ;;
+esac
+
+board_config_flush
+
+exit 0
similarity index 66%
rename from target/linux/mvebu/base-files/etc/board.d/02_network
rename to target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index 283a8562582d6f8e08b212372bfaf27829a438cb..b10e1419b50fdf7a5e190ea90913ba3fe41b4fd5 100755 (executable)
@@ -15,12 +15,6 @@ cznic,turris-omnia)
        ucidef_set_interface_lan "lan0 lan1 lan2 lan3 lan4"
        ucidef_set_interface_wan "eth2"
        ;;
-globalscale,espressobin|\
-globalscale,espressobin-emmc|\
-globalscale,espressobin-v7|\
-globalscale,espressobin-v7-emmc)
-       ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
-       ;;
 linksys,caiman|\
 linksys,cobra|\
 linksys,mamba|\
@@ -34,25 +28,11 @@ linksys,venom)
 marvell,a385-db-ap)
        ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
        ;;
-marvell,armada8040-mcbin)
-       ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
-       ;;
-marvell,armada8040-db)
-       ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
-       ;;
-marvell,armada7040-db)
-       ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
-       ;;
-marvell,armada-3720-db)
-       ucidef_set_interfaces_lan_wan "eth1" "eth0"
-       ;;
 marvell,axp-gp)
        ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
        ;;
-methode,udpu)
-       ucidef_set_interfaces_lan_wan "eth1" "eth0"
-       ;;
-solidrun,clearfog-a1|solidrun,clearfog-pro-a1)
+solidrun,clearfog-a1|\
+solidrun,clearfog-pro-a1)
        # eth0 is standalone ethernet
        # eth1 is switch
        # eth2 is SFP
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..8baed96
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
+#
+
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+       case "$(board_name)" in
+       cznic,turris-omnia|\
+       solidrun,clearfog-base-a1|\
+       solidrun,clearfog-pro-a1)
+               platform_check_image_sdcard "$1"
+               ;;
+       *)
+               return 0
+               ;;
+       esac
+}
+
+platform_do_upgrade() {
+       case "$(board_name)" in
+       cznic,turris-omnia|\
+       solidrun,clearfog-base-a1|\
+       solidrun,clearfog-pro-a1)
+               platform_do_upgrade_sdcard "$1"
+               ;;
+       linksys,caiman|\
+       linksys,cobra|\
+       linksys,mamba|\
+       linksys,rango|\
+       linksys,shelby|\
+       linksys,venom)
+               platform_do_upgrade_linksys "$1"
+               ;;
+       *)
+               default_do_upgrade "$1"
+               ;;
+       esac
+}
+platform_copy_config() {
+       case "$(board_name)" in
+       cznic,turris-omnia|\
+       solidrun,clearfog-base-a1|\
+       solidrun,clearfog-pro-a1)
+               platform_copy_config_sdcard
+               ;;
+       linksys,caiman|\
+       linksys,cobra|\
+       linksys,mamba|\
+       linksys,rango|\
+       linksys,shelby|\
+       linksys,venom)
+               platform_copy_config_linksys
+               ;;
+       esac
+}