diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-01-18 02:21:13 +0100 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-01-21 14:24:49 +0100 |
commit | 1fa04b5d9fb1cba56a8597d6da9e1d52b8030f6b (patch) | |
tree | da02f4bb267128497f1ad7e3c755c8685d8005d1 /target | |
parent | e93626f1f47ec6c1995067c9ed3798ebd468cda3 (diff) | |
download | upstream-1fa04b5d9fb1cba56a8597d6da9e1d52b8030f6b.tar.gz upstream-1fa04b5d9fb1cba56a8597d6da9e1d52b8030f6b.tar.bz2 upstream-1fa04b5d9fb1cba56a8597d6da9e1d52b8030f6b.zip |
mvebu: split base-files across subtargets
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>
Diffstat (limited to 'target')
17 files changed, 251 insertions, 129 deletions
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 index 14313ee664..0000000000 --- a/target/linux/mvebu/base-files/etc/board.d/01_leds +++ /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 index 0223b72d71..0000000000 --- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh +++ /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 index 0000000000..ba4b930426 --- /dev/null +++ b/target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network @@ -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/base-files/lib/preinit/82_uDPU b/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU index 12bbfc3725..12bbfc3725 100644 --- a/target/linux/mvebu/base-files/lib/preinit/82_uDPU +++ b/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU 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 index 0000000000..cdf5933272 --- /dev/null +++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh @@ -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/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh index 032c706605..032c706605 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/uDPU.sh +++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh 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 index 0000000000..080e32ada3 --- /dev/null +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -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 index 0000000000..2428de08c4 --- /dev/null +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -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 index 0000000000..a7762f0080 --- /dev/null +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds @@ -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 diff --git a/target/linux/mvebu/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network index 283a856258..b10e1419b5 100755 --- a/target/linux/mvebu/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network @@ -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/base-files/etc/init.d/bootcount b/target/linux/mvebu/cortexa9/base-files/etc/init.d/bootcount index dd2266bdc8..dd2266bdc8 100755 --- a/target/linux/mvebu/base-files/etc/init.d/bootcount +++ b/target/linux/mvebu/cortexa9/base-files/etc/init.d/bootcount diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless index 3c345ff148..3c345ff148 100644 --- a/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless +++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/04_mambafan b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/04_mambafan index ec25aedad6..ec25aedad6 100644 --- a/target/linux/mvebu/base-files/etc/uci-defaults/04_mambafan +++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/04_mambafan diff --git a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac b/target/linux/mvebu/cortexa9/base-files/lib/preinit/06_set_iface_mac index fd41836c8d..fd41836c8d 100644 --- a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/mvebu/cortexa9/base-files/lib/preinit/06_set_iface_mac diff --git a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg b/target/linux/mvebu/cortexa9/base-files/lib/preinit/81_linksys_syscfg index 83448e5ace..83448e5ace 100644 --- a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg +++ b/target/linux/mvebu/cortexa9/base-files/lib/preinit/81_linksys_syscfg diff --git a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh index 6ccfdd0768..6ccfdd0768 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh 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 index 0000000000..8baed969a3 --- /dev/null +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh @@ -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 +} |