treewide: use the generic board_name function
authorMathias Kresin <dev@kresin.me>
Fri, 12 May 2017 20:36:07 +0000 (22:36 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 15 Jul 2017 21:13:34 +0000 (23:13 +0200)
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
94 files changed:
package/boot/uboot-envtools/files/ar71xx
package/boot/uboot-envtools/files/cns3xxx
package/boot/uboot-envtools/files/imx6
package/boot/uboot-envtools/files/ipq
package/boot/uboot-envtools/files/kirkwood
package/boot/uboot-envtools/files/mvebu
package/boot/uboot-envtools/files/mxs
package/boot/uboot-envtools/files/oxnas
package/boot/uboot-envtools/files/ramips
package/kernel/om-watchdog/files/om-watchdog.init
target/linux/apm821xx/base-files/etc/board.d/01_leds
target/linux/apm821xx/base-files/etc/board.d/02_network
target/linux/apm821xx/base-files/etc/diag.sh
target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/apm821xx/base-files/etc/rc.button/BTN_1
target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx
target/linux/apm821xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/base-files/etc/board.d/01_leds
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ar71xx/base-files/etc/hotplug.d/net/10-ar922x-led-fix
target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration
target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum
target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header
target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/arc770/base-files/etc/board.d/02_network
target/linux/archs38/base-files/etc/board.d/02_network
target/linux/at91/base-files/etc/board.d/02_network
target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
target/linux/brcm2708/base-files/etc/board.d/02_network
target/linux/brcm2708/base-files/etc/diag.sh
target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
target/linux/brcm47xx/base-files/lib/upgrade/platform.sh
target/linux/brcm63xx/base-files/etc/board.d/01_leds
target/linux/brcm63xx/base-files/etc/board.d/02_network
target/linux/brcm63xx/base-files/etc/diag.sh
target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
target/linux/imx6/base-files/etc/board.d/02_network
target/linux/imx6/base-files/lib/upgrade/platform.sh
target/linux/ipq806x/base-files/etc/board.d/01_leds
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ipq806x/base-files/etc/init.d/linksys_recovery
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
target/linux/ixp4xx/base-files/lib/upgrade/platform.sh
target/linux/kirkwood/base-files/etc/board.d/01_leds
target/linux/kirkwood/base-files/etc/board.d/02_network
target/linux/kirkwood/base-files/etc/diag.sh
target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol
target/linux/kirkwood/base-files/lib/upgrade/platform.sh
target/linux/mcs814x/base-files/etc/board.d/01_leds
target/linux/mpc85xx/base-files/etc/board.d/02_network
target/linux/mpc85xx/base-files/etc/diag.sh
target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/mpc85xx/base-files/lib/upgrade/platform.sh
target/linux/mvebu/base-files/etc/board.d/01_leds
target/linux/mvebu/base-files/etc/board.d/02_network
target/linux/mvebu/base-files/etc/diag.sh
target/linux/mvebu/base-files/etc/init.d/linksys_recovery
target/linux/mvebu/base-files/etc/uci-defaults/03_wireless
target/linux/mvebu/base-files/etc/uci-defaults/04_mambafan
target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
target/linux/mvebu/base-files/lib/upgrade/platform.sh
target/linux/mxs/base-files/etc/board.d/02_network
target/linux/mxs/base-files/etc/diag.sh
target/linux/oxnas/base-files/etc/board.d/01_leds
target/linux/oxnas/base-files/etc/board.d/02_network
target/linux/oxnas/base-files/etc/diag.sh
target/linux/oxnas/base-files/lib/upgrade/platform.sh
target/linux/ppc40x/base-files/lib/upgrade/platform.sh
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/etc/board.d/03_gpio_switches
target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
target/linux/ramips/base-files/etc/init.d/bootcount
target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
target/linux/ramips/base-files/lib/preinit/04_handle_checksumming
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/base-files/sbin/fixup-mac-address
target/linux/sunxi/base-files/etc/board.d/02_network
target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh

index 503e593089415df08c01cba60e767aca9e6a60b0..5c7b16c40e458dfc8777b31030100e166b7365ec 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/ar71xx.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 a40|\
index a56be15c571c5301b918db26f1b3f67b0fe22c0f..f998de463c68d5ba96482e017ee4b9acf04cefb1 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/cns3xxx.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(cns3xxx_board_name)
+board=$(board_name)
 
 case "$board" in
 laguna)
index a78c4fbe5389b8bbac1aa67a4d83445b9632180f..fec8ce0aa4f558fc80d9ba2c4cd94e4528da2060 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/imx6.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(imx6_board_name)
+board=$(board_name)
 
 case "$board" in
 *gw5*)
index 16c7ba6bb7c2036d3747b2397de73b61f2899e48..5d0a47790abf20d11de49695cbf00421f0479d51 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/ipq806x.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(ipq806x_board_name)
+board=$(board_name)
 
 case "$board" in
 ea8500)
index 26ae1b09ec565992c75b47c402bf82ee4e4d44c8..3b770c12f44d7e01942c8c319e1c83d6cf3a27a2 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/kirkwood.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(kirkwood_board_name)
+board=$(board_name)
 
 case "$board" in
 dockstar|\
index 2bbbc23661444bdfeffdafb8e85d0091849d9249..e33830e0a76ded5796452c49fcb91a21cdb404fa 100644 (file)
@@ -8,11 +8,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/mvebu.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(mvebu_board_name)
+board=$(board_name)
 
 case "$board" in
 armada-385-linksys-caiman|\
index ab8b4ef937f6e0aa0d4f13a20751d030197255be..37d3c96ed47dd09d58897b3b4aab21db4c1beba8 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/mxs.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(mxs_board_name)
+board=$(board_name)
 
 case "$board" in
 duckbill)
index ac4744e3e26a2061667ed11862fc4dc0cbeb2f79..70b0f1663a8f18d404df46186feef69eeed4b123 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/oxnas.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(oxnas_board_name)
+board=$(board_name)
 
 case "$board" in
 akitio|\
index 9ce8c30edda33fdc46a3e56aa4fa17705e4fd8a3..fa80e95299bf968a87ec9a4ea8112bc570b20a3d 100644 (file)
@@ -7,11 +7,10 @@
 
 touch /etc/config/ubootenv
 
-. /lib/ramips.sh
 . /lib/uboot-envtools.sh
 . /lib/functions.sh
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 case "$board" in
 all0239-3g|\
index 906ee665fd85be7a8e9f42fe1d4679258d17ff71..10eb55ccc27f2af585e63ebe7768503243197d59 100644 (file)
@@ -11,10 +11,9 @@ NAME=om-watchdog
 PROG=/sbin/om-watchdog
 
 get_gpio() {
-       if [ -r /lib/ar71xx.sh ]; then
-               . /lib/ar71xx.sh
-               local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
+       if [ -r /lib/ar71xx.sh ]; then
                case "$board" in
                "a40"|\
                "a60"|\
@@ -49,9 +48,6 @@ get_gpio() {
                        ;;
                esac
        elif [ -r /lib/ramips.sh ]; then
-               . /lib/ramips.sh
-               local board=$(ramips_board_name)
-
                case "$board" in
                "rut5xx")
                        return 11
index ad9bef9c09ee6362f3d0ec230b53919682631847..3b5fb721ae38e6e655894a6e00d00bf188d35ea7 100755 (executable)
@@ -1,11 +1,10 @@
 #!/bin/sh
 
 . /lib/functions/uci-defaults.sh
-. /lib/apm821xx.sh
 
 board_config_update
 
-board=$(apm821xx_board_name)
+board=$(board_name)
 
 case "$board" in
 mr24)
index 90a8c1a8d2d1930181ab5405224afc46cecfc431..03df7cb49f7aa58339ec5e468b0b1c4fcb60c980 100755 (executable)
@@ -2,11 +2,10 @@
 
 . /lib/functions/system.sh
 . /lib/functions/uci-defaults.sh
-. /lib/apm821xx.sh
 
 board_config_update
 
-board=$(apm821xx_board_name)
+board=$(board_name)
 
 case "$board" in
 mbl|\
index 3e480f1fe4363415c8e379efc8660b256199d293..eb9b04b52511f36c49425a9bf54ec716cdd754a9 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/apm821xx.sh
 
 get_status_led() {
-       local board=$(apm821xx_board_name)
+       local board=$(board_name)
 
        case $board in
        mbl|\
index dfdc548d63603e96ea203d8c98e9a75dfb1de54b..4a7e1c0b19ac946dade1664942c5539f3677f1da 100644 (file)
@@ -2,7 +2,6 @@
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
-. /lib/apm821xx.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
@@ -48,7 +47,7 @@ ath9k_patch_firmware_mac() {
         macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=2 count=6
 }
 
-board=$(apm821xx_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "pci_wmac0.eeprom")
index 995641237b4a0a59d9b4fc5099a8b96e293bf915..c011c857539360cfa7b1f97cce84c4f32133c052 100755 (executable)
@@ -1,9 +1,8 @@
 #!/bin/sh
 
 . /lib/functions.sh
-. /lib/apm821xx.sh
 
-BOARD=$(apm821xx_board_name)
+BOARD=$(board_name)
 
 if [ $BOARD == "wndr4700" ]; then
        case "$ACTION" in
index 750af042e19fc646b65277895bbcdd1a4fa55ba1..ec540feb846568819c6459fd5adc03e4fc9e9c5b 100644 (file)
@@ -1,9 +1,9 @@
 #!/bin/sh
 
-. /lib/apm821xx.sh
-
 preinit_set_mac_address() {
-       case $(apm821xx_board_name) in
+       . /lib/functions.sh
+
+       case $(board_name) in
                mr24|\
                mx60)
                        mac_lan=$(mtd_get_mac_binary_ubi board-config 102)
index ca6aa8d4be1634ea07aefbd13fdf40723770ae25..55f8ffa75d390185c3fec44ca11ce492acb87dda 100755 (executable)
@@ -1,12 +1,9 @@
 #!/bin/sh
 
-. /lib/apm821xx.sh
-
 PART_NAME=firmware
-RAMFS_COPY_DATA=/lib/apm821xx.sh
 
 platform_check_image() {
-       local board=$(apm821xx_board_name)
+       local board=$(board_name)
 
        [ "$#" -gt 1 ] && return 1
 
@@ -36,7 +33,7 @@ platform_check_image() {
 }
 
 platform_pre_upgrade() {
-       local board=$(apm821xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        mr24|\
@@ -54,7 +51,7 @@ platform_pre_upgrade() {
 }
 
 platform_do_upgrade() {
-       local board=$(apm821xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        mbl)
@@ -68,7 +65,7 @@ platform_do_upgrade() {
 }
 
 platform_copy_config() {
-       local board=$(apm821xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        mbl)
index e5afd50e7d73491a4208e0149a79ca967222d7c0..8eaa892b4aeb2972197f33b6bd29265c10b91dd5 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/ar71xx.sh
 
 board_config_update
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 a40)
index 7f2012855c29aab7e430e7932a35da1915af8605..b2126c0c94818035c5798d55bb09c69a8949d101 100755 (executable)
@@ -5,7 +5,6 @@
 
 . /lib/functions/system.sh
 . /lib/functions/uci-defaults.sh
-. /lib/ar71xx.sh
 
 ar71xx_setup_interfaces()
 {
@@ -545,7 +544,7 @@ ar71xx_setup_macs()
 }
 
 board_config_update
-board=$(ar71xx_board_name)
+board=$(board_name)
 ar71xx_setup_interfaces $board
 ar71xx_setup_macs $board
 board_config_flush
index 2b18741cd93679ff14b5e197c5537fae63049d40..add7e47e857c9c9f44f72feb1a2023accb8f8ca3 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/ar71xx.sh
 
 board_config_update
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 nanostation-m)
index 50b893f5b1d576387f7df0d9efcfc2669dcc66ac..1dc48624a0ec57e0e6ed47c94795ac9c8412e11a 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2009-2013 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/ar71xx.sh
 
 get_status_led() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
        case $board in
        a40)
@@ -175,7 +175,7 @@ get_status_led() {
                status_led="$board:blue:status"
                ;;
        eap120)
-               status_led="$(ar71xx_board_name):green:system"
+               status_led="$board:green:system"
                ;;
        eap300v2)
                status_led="engenius:blue:power"
@@ -516,7 +516,7 @@ set_state() {
                ;;
        done)
                status_led_on
-               case $(ar71xx_board_name) in
+               case $(board_name) in
                gl-ar300m)
                        fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0
                        ;;
index b4d78175699745d06880b885c3fcb5db89f2b7d2..f9520b302ba8ad03aa0a45b2064b9d122d7cd38c 100644 (file)
@@ -2,7 +2,6 @@
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
-. /lib/ar71xx.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
@@ -66,7 +65,7 @@ ath9k_patch_firmware_mac() {
        macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=2 count=6
 }
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
index a2e98f4be7c70703ab25b6fa26f3e25499090566..6a50e0c86e71446f8fb00d261ede86a335aeb8a6 100644 (file)
@@ -38,11 +38,10 @@ ath10kcal_patch_mac() {
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
-. /lib/ar71xx.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "ath10k/cal-pci-0000:00:00.0.bin")
index 7d2eca546d76b771b12026788510f73a293a9a93..77c835f2fd895fca3bdf4449c1c0d64cc8c0a695 100644 (file)
@@ -6,10 +6,10 @@ PHYNBR=${DEVPATH##*/phy}
 
 [ -n $PHYNBR ] || exit 0
 
-. /lib/ar71xx.sh
+. /lib/functions.sh
 . /lib/functions/system.sh
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
        archer-c58-v1)
index 8c57ddc886d095bcea2160e09719927945d0df90..c41d4b08f64c3c20ce376b8045b9bee82f91c50d 100644 (file)
@@ -37,9 +37,9 @@ ar922x_disable_gpio_jtag() {
 }
 
 [ $phyname -a $ACTION = "add" ] && {
-       . /lib/ar71xx.sh
+       . /lib/functions.sh
 
-       case $(ar71xx_board_name) in
+       case $(board_name) in
        wzr-hp-ag300h)
                ar922x_disable_gpio_jtag $phyname
                ;;
index a99a4ec0b457c8f0a5a1f6f284f235253fa4fc42..338a22297bb302c26124f11afa46e89d234d6351 100644 (file)
@@ -5,6 +5,8 @@
 
 SWITCH_NAME_CHANGED=
 
+. /lib/functions.sh
+
 do_change_switch_name() {
        local config="$1"
        local option=$2
@@ -25,8 +27,6 @@ migrate_switch_name() {
        local oldname=$1
        local newname=$2
 
-       . /lib/functions.sh
-
        config_load network
 
        logger -t migrate-switchX "Updating switch names in network configuration"
@@ -40,9 +40,7 @@ migrate_switch_name() {
        }
 }
 
-. /lib/ar71xx.sh
-
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 dir-825-c1|\
index 16722d1ab29afea416b427c789e9ff286ada36e5..d6f70770930ef7963f954bde0175bdcc0fb6fbe2 100644 (file)
@@ -41,9 +41,7 @@ migrate_leds()
        config_foreach do_led_update_sysfs led "$@"
 }
 
-. /lib/ar71xx.sh
-
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 dhp-1565-a1|\
index 057afe0193e6c2d76d31397a1890407f05835125..2d1afb11cb0b85cf0a62e3d9904a0acf0a7dc027 100644 (file)
@@ -3,9 +3,9 @@
 # Copyright (C) 2010 OpenWrt.org
 #
 
-. /lib/ar71xx.sh
+. /lib/functions.sh
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 fixtrx() {
        mtd -o 32 fixtrx firmware
index ebe9c1c90f98d9d1cf4b0e8388edfccc58885b6b..b3857ef07f45038734617b932c1406eea607a9b6 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /lib/ar71xx.sh
+. /lib/functions.sh
 
 fix_seama_header() {
        local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
@@ -8,7 +8,7 @@ fix_seama_header() {
        [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
 }
 
-board=$(ar71xx_board_name)
+board=$(board_name)
 
 case "$board" in
 dir-869-a1)
index 277287d3835accedb36d6598fd29cd9f9d1f894b..df653f2e48c65a5fe9923e57c8668621b51b1348 100644 (file)
@@ -2,8 +2,6 @@
 # Copyright (C) 2009 OpenWrt.org
 #
 
-. /lib/ar71xx.sh
-
 fetch_mac_from_mtd() {
        local mtd_part=$1
        local lan_env=$2
@@ -21,7 +19,9 @@ fetch_mac_from_mtd() {
 }
 
 preinit_set_mac_address() {
-       case $(ar71xx_board_name) in
+       . /lib/functions.sh
+
+       case $(board_name) in
                c-55|\
                c-60)
                        mac_lan=$(mtd_get_mac_binary art 0)
index d677599d8c6380d9920e95abc9fb4b92cc0cec29..3a98cdccf1aa5bf04d5da263731ec2f92f0286f6 100644 (file)
@@ -4,10 +4,10 @@
 # Copyright (C) 2009 OpenWrt.org
 #
 
-. /lib/ar71xx.sh
-
 set_preinit_iface() {
-       case $(ar71xx_board_name) in
+       . /lib/functions.sh
+
+       case $(board_name) in
        alfa-ap96 |\
        alfa-nx |\
        ap135-020 |\
index b6af921449b0284d1e05212bbe618d77744e8a15..c9aa4b1eb5fe868af49a96f6067eb13e60dbe272 100644 (file)
@@ -1,8 +1,7 @@
 #!/bin/sh
 
+. /lib/functions.sh
 . /lib/functions/system.sh
-. /lib/ar71xx.sh
-
 
 do_patch_ath10k_firmware() {
        local firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin"
@@ -25,7 +24,7 @@ do_patch_ath10k_firmware() {
        # some boards have bogus mac in otp (= directly in the PCIe card's EEPROM).
        # we have to patch the default mac in the firmware because we cannot change
        # the otp.
-       case $(ar71xx_board_name) in
+       case $(board_name) in
                dgl-5500-a1 | tew-823dru)
                        local mac
                        mac=$(mtd_get_mac_ascii nvram wlan1_mac)
@@ -44,7 +43,7 @@ do_patch_ath10k_firmware() {
 }
 
 check_patch_ath10k_firmware() {
-       case $(ar71xx_board_name) in
+       case $(board_name) in
                dgl-5500-a1 | tew-823dru)
                        do_patch_ath10k_firmware
                ;;
index ba65a790060c5d0db40860befce74ae4b05432e0..949cb6aed58d0a4992f6b270e7b4db2d4fa95388 100755 (executable)
@@ -184,7 +184,7 @@ alfa_check_image() {
 }
 
 platform_nand_board_name() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        rb*) echo "routerboard";;
@@ -193,7 +193,7 @@ platform_nand_board_name() {
 }
 
 platform_check_image() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
        local magic="$(get_magic_word "$1")"
        local magic_long="$(get_magic_long "$1")"
 
@@ -668,7 +668,7 @@ platform_check_image() {
 }
 
 platform_pre_upgrade() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        c-60|\
@@ -727,7 +727,7 @@ platform_pre_upgrade() {
 }
 
 platform_nand_pre_upgrade() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        rb*)
@@ -742,7 +742,7 @@ platform_nand_pre_upgrade() {
 }
 
 platform_do_upgrade() {
-       local board=$(ar71xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        all0258n)
index dabc539fc84b55cd801929810f94a83b7b8a96af..3f53293700c8b805afed99f8980e1885f77f29aa 100755 (executable)
@@ -3,12 +3,11 @@
 # Copyright (C) 2015 OpenWrt.org
 #
 
-. /lib/arc.sh
 . /lib/functions/uci-defaults.sh
 
 board_config_update
 
-case "$( arc_board_name )" in
+case "$(board_name)" in
 "arc-sdp"*)
        ucidef_set_interface_lan "eth0" "dhcp"
        ;;
index da86ee0b697a9182c27baeed7e843272aeb95960..d8bdd50677c4f6a4e816994ba8502ee3ef435d26 100755 (executable)
@@ -3,12 +3,11 @@
 # Copyright (C) 2016 OpenWrt.org
 #
 
-. /lib/arc.sh
 . /lib/functions/uci-defaults.sh
 
 board_config_update
 
-case "$( arc_board_name )" in
+case "$(board_name)" in
 "arc-sdp"*)
        ucidef_set_interface_lan "eth0" "dhcp"
        ;;
index 52709f6061c1a42259a287d855a8610dd34c8423..66f9d88fae319d9737a8ff7ea919386ab03c0d41 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/at91.sh
 
 board_config_update
 
-case "$(at91_board_name)" in
+case "$(board_name)" in
 
 sama5d3_xplained)
        ucidef_set_interfaces_lan_wan "eth0" "eth1"
index 1f778c72b6892b9accace01be00e11dcd11bf907..1a33e3a447273357f16b716df3b881fc02c87718 100644 (file)
@@ -8,10 +8,6 @@ get_magic_long_at() {
        dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -e '1/1 "%02x"'
 }
 
-platform_machine() {
-       cat /proc/device-tree/compatible | tr '\0' '\t' | cut -f 1
-}
-
 platform_flash_type() {
        # On NAND devices "rootfs" is UBI volume, so won't be find in /proc/mtd
        grep -q "\"rootfs\"" /proc/mtd && {
@@ -23,7 +19,7 @@ platform_flash_type() {
 }
 
 platform_expected_image() {
-       local machine=$(platform_machine)
+       local machine=$(board_name)
 
        case "$machine" in
                "dlink,dir-885l")       echo "seama wrgac42_dlink.2015_dir885l"; return;;
index 9486a6ae6844ac947880bd273b8c0ecaec6e4702..29bcf33e33fa51cba11e6c60316ff19f2cd1dcec 100755 (executable)
@@ -3,13 +3,12 @@
 # Copyright (C) 2017 LEDE project
 
 . /lib/functions/uci-defaults.sh
-. /lib/brcm2708.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
 board_config_update
 
-board=$(brcm2708_board_name)
+board=$(board_name)
 
 case "$board" in
 rpi-2-b |\
index 36c5cd71d0bb97c1e3a687a4c2a7175ebed60557..6f5810ed5812edf024eb67a4ca3c2673ccf4a619 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright (C) 2015-2016 OpenWrt.org
 # Copyright (C) 2017 LEDE project
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/brcm2708.sh
 
 set_state() {
-       case "$(brcm2708_board_name)" in
+       case "$(board_name)" in
        rpi-2-b |\
        rpi-b-plus)
                status_led="led1"
index 4401c875e4bf1553aaa621b42c5ae51f0f2009c7..95497cc5865ac0865cfbdbc4b51ce3bfe97b5817 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright (C) 2015-2016 OpenWrt.org
 # Copyright (C) 2017 LEDE project
 
-. /lib/brcm2708.sh
-
 set_preinit_iface() {
-       case "$(brcm2708_board_name)" in
+       . /lib/functions.sh
+
+       case "$(board_name)" in
        rpi-2-b |\
        rpi-3-b |\
        rpi-b |\
index cf05a847ee3feea4dea2a994a52b71d1c1d5e872..dfd4e97ed2e3c3aabbcea7b922c2aa1eef1416db 100644 (file)
@@ -6,12 +6,8 @@ get_magic_long_at() {
        dd if="$1" skip=$2 bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
 }
 
-platform_machine() {
-       grep "machine" /proc/cpuinfo | sed "s/.*:[ \t]*//"
-}
-
 platform_expected_image() {
-       local machine=$(platform_machine)
+       local machine=$(board_name)
 
        case "$machine" in
                "Netgear WGR614 V8")    echo "chk U12H072T00_NETGEAR"; return;;
index 7651650d3f8418acaa811f99d407e22a57acd3f5..a9096739b693034e177b3056fb522e05c8042636 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/brcm63xx.sh
 
 board_config_update
 
-case "$(brcm63xx_board_name)" in
+case "$(board_name)" in
 a4001n1)
        ucidef_set_led_netdev "lan" "LAN" "A4001N1:green:eth" "eth0"
        ucidef_set_led_usbdev "usb" "USB" "A4001N1:green:3g" "1-1"
index 6a20fcedde19e3b247df17c3104aec4ae4a74905..9d9f95d2d81797c9ad2886701687746eb461e48e 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/brcm63xx.sh
 
 board_config_update
 
-case "$(brcm63xx_board_name)" in
+case "$(board_name)" in
 
 cvg834g |\
 evg2000 |\
index b90b5907aa59a06640f400f9cdc0843a751b6e0d..24939a9cc1090f5c15c2fbd13f052f3281ffda48 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2007-2013 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/brcm63xx.sh
 
 set_state() {
-       case "$(brcm63xx_board_name)" in
+       case "$(board_name)" in
        a4001n1)
                status_led="A4001N1:green:power"
                ;;
index 21c510f17beac9fed4572c366718af782e9a7695..fe31ed323dfbb63ba7eb2a0282222db17f6ac09f 100644 (file)
@@ -12,8 +12,6 @@ rt2x00_eeprom_extract() {
        local count=$3
        local mtd
 
-       . /lib/functions.sh
-
        mtd=$(find_mtd_part $part)
        [ -n "$mtd" ] || \
                rt2x00_eeprom_die "no mtd device found for partition $part"
@@ -24,9 +22,9 @@ rt2x00_eeprom_extract() {
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
-. /lib/brcm63xx.sh
+. /lib/functions.sh
 
-board=$(brcm63xx_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "rt2x00.eeprom" )
index 57bf6e2a468dd31559da93a6056c7ee438fca231..94c422392ea3c5f8c1f758793646993af1508427 100644 (file)
@@ -4,13 +4,13 @@
 #
 #
 
-. /lib/brcm63xx.sh
+. /lib/functions.sh
 
 do_fixcrc() {
        mtd fixtrx linux
 }
 
-case "$(brcm63xx_board_name)" in
+case "$(board_name)" in
        a4001n |\
        a4001n1 |\
        ar-5381u |\
index fbe3eead7ad8017f417f9c2c90fd6769bbc39333..3f269dfae87129e0b7f509136852a060d6a41a68 100755 (executable)
@@ -4,9 +4,8 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/imx6.sh
 
-board=$(imx6_board_name)
+board=$(board_name)
 
 board_config_update
 
index 0bbf110282e108edd7f5f9f590028f7693be5afc..a9ca5ee875b34f56ad43c13b2990a54ea148ad7f 100755 (executable)
@@ -2,10 +2,8 @@
 # Copyright (C) 2010-2015 OpenWrt.org
 #
 
-. /lib/imx6.sh
-
 platform_check_image() {
-       local board=$(imx6_board_name)
+       local board=$(board_name)
 
        case "$board" in
        *gw5*)
@@ -19,7 +17,7 @@ platform_check_image() {
 }
 
 platform_pre_upgrade() {
-       local board=$(imx6_board_name)
+       local board=$(board_name)
 
        case "$board" in
        *gw5*)
index 13717672682d94ee90c654658620fb7daebbbf6c..5e04ee773a95368e71ee2738e58f93c41019eb52 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/ipq806x.sh
 
 board_config_update
 
-board=$(ipq806x_board_name)
+board=$(board_name)
 
 case "$board" in
 c2600)
index bd81a1ebff772b99fcd9cf124aebb40adeac96b6..28e42dcaf8ee2010c8c0e8ce2a7ace9c25241700 100755 (executable)
@@ -5,12 +5,11 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/ipq806x.sh
 . /lib/functions/system.sh
 
 board_config_update
 
-board=$(ipq806x_board_name)
+board=$(board_name)
 
 case "$board" in
 ap148 |\
index 40e1330bf0b46f5562a114d790c9dd609b1d6cdc..39757eb16158c162eb69854e716c76d6a6f264e5 100644 (file)
@@ -38,11 +38,10 @@ ath10kcal_patch_mac() {
 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
-. /lib/ipq806x.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
-board=$(ipq806x_board_name)
+board=$(board_name)
 
 
 case "$FIRMWARE" in
index 2ea408d619233c0e5c00d8d5b8f366c50d7ff798..fee56cd6618d5507788478c3d5d5c1c1c9fc3d03 100644 (file)
@@ -6,10 +6,10 @@ PHYNBR=${DEVPATH##*/phy}
 
 [ -n $PHYNBR ] || exit 0
 
-. /lib/ipq806x.sh
+. /lib/functions.sh
 . /lib/functions/system.sh
 
-board=$(ipq806x_board_name)
+board=$(board_name)
 
 case "$board" in
        c2600)
index b9ea004207148f34394b26c886fdb9770b2aeb55..4d94f1f76711ce0c12ad2dcd220603851efdcf22 100755 (executable)
@@ -4,9 +4,8 @@
 START=97
 boot() {
 . /lib/functions.sh
-. /lib/ipq806x.sh
 
-case $(ipq806x_board_name) in
+case $(board_name) in
        ea8500)
                # make sure auto_recovery in uboot is always on
                AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
index 246361bbf6018b60563439dda142aec08f1e8048..7d8b1783395550dfc9313aed882ca30dab805515 100644 (file)
@@ -1,5 +1,3 @@
-. /lib/ipq806x.sh
-
 PART_NAME=firmware
 REQUIRE_IMAGE_METADATA=1
 
@@ -11,9 +9,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board=$(ipq806x_board_name)
-
-       case "$board" in
+       case "$(board_name)" in
        ap148 |\
        ap-dk04.1-c1 |\
        d7800 |\
@@ -43,9 +39,7 @@ platform_do_upgrade() {
 }
 
 platform_nand_pre_upgrade() {
-       local board=$(ipq806x_board_name)
-
-       case "$board" in
+       case "$(board_name)" in
        nbg6817)
                zyxel_do_upgrade "$1"
                ;;
index 508a167419edf1a405b23d9ae15d4c5575a9ad47..e1e43cf19ab3d0310b2b039776f179599b05b83d 100644 (file)
@@ -1,7 +1,3 @@
-. /lib/ixp4xx.sh
-
-RAMFS_COPY_DATA="/lib/ixp4xx.sh"
-
 CI_BLKSZ=65536
 CI_LDADR=0x00800000
 
@@ -86,7 +82,7 @@ platform_do_upgrade_combined() {
 }
 
 platform_check_image() {
-       local board=$(ixp4xx_board_name)
+       local board=$(board_name)
        local magic="$(get_magic_word "$1")"
        local partitions=$(platform_find_partitions)
        local kernelpart=$(platform_find_kernelpart "${partitions#*:}")
@@ -127,7 +123,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board=$(ixp4xx_board_name)
+       local board=$(board_name)
 
        v "board=$board"
        case "$board" in
index 06084405333fabd88d8f3ff0275c4327f8b93d7f..0d897591808e6314c6df12866fb8d0e8d01c9d68 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/kirkwood.sh
 
 board_config_update
 
-board=$(kirkwood_board_name)
+board=$(board_name)
 
 case "$board" in
 "dockstar")
index 19f0292b294feb93736579228e51a2c2ad7ce525..85049d296880fa05d8b8b3bb5ae8f7f1ff87c720 100755 (executable)
@@ -5,11 +5,10 @@
 
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
-. /lib/kirkwood.sh
 
 board_config_update
 
-board=$(kirkwood_board_name)
+board=$(board_name)
 
 case "$board" in
 "dockstar"|\
index 64650850d60e2660528c5a8fa39d33bb1833b0ed..71a1639c2a6da6d84d3a98bb2bbbae361634e0e5 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2014 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/kirkwood.sh
 
 get_status_led() {
-       case $(kirkwood_board_name) in
+       case $(board_name) in
        dockstar|\
        goflexhome|\
        goflexnet)
index 3f1b7626bb093282e4672077ee6b8a81d716ea33..ba7e4bb3930069d36707e06906bd82943b0b1613 100755 (executable)
@@ -4,9 +4,8 @@
 START=97
 boot() {
 . /lib/functions.sh
-. /lib/kirkwood.sh
 
-case $(kirkwood_board_name) in
+case $(board_name) in
        linksys-audi|linksys-viper)
                # make sure auto_recovery in uboot is always on
                AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
index 32e863e55da9fd72440bd69e5f5312781cb870ce..4073c2d559dc4c10091cad4c01b834c4516948a5 100755 (executable)
@@ -3,14 +3,13 @@
 START=98
 boot() {
 . /lib/functions.sh
-. /lib/kirkwood.sh
 
 #configuring lm85 onboard temp/fan controller to run the fan on its own
 #for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
 
 path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
 
-case $(kirkwood_board_name) in
+case $(board_name) in
        nsa310b)
        echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1
        echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes
index f75acb0d61e197ea9f4ad38334e37d3ead35b9ff..b28ee873b30cc32288b5f32ce87fcae1cf0929ed 100644 (file)
@@ -1,11 +1,9 @@
-. /lib/kirkwood.sh
-
 RAMFS_COPY_BIN='fw_printenv fw_setenv'
 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
 
 platform_check_image() {
        [ "$#" -gt 1 ] && return 1
-       local board="$(kirkwood_board_name)"
+       local board="$(board_name)"
        local magic="$(get_magic_long "$1")"
 
        case "$board" in
@@ -28,7 +26,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board="$(kirkwood_board_name)"
+       local board="$(board_name)"
 
        case "$board" in
        "linksys-audi"|\
index efcf8093ae3774c9b726370ed1892f5d89cfeaca..65d738f0ad26ab64a1d5855db85e5442007bace5 100755 (executable)
@@ -4,11 +4,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/mcs814x.sh
 
 board_config_update
 
-board=$(mcs814x_board_name)
+board=$(board_name)
 
 case "$board" in
 dlan-usb-extender)
index e0a0861f3b023227580b12e4d893b1fa6137fab4..511b56b1cc72ab1405df6950f1623da0c73acd45 100755 (executable)
@@ -2,13 +2,12 @@
 # Copyright (C) 2014-2015 OpenWrt.org
 
 . /lib/functions/uci-defaults.sh
-. /lib/mpc85xx.sh
 . /lib/functions.sh
 . /lib/functions/system.sh
 
 board_config_update
 
-board=$(mpc85xx_board_name)
+board=$(board_name)
 
 case "$board" in
 tl-wdr4900-v1)
index 1107763a3785457d58e48f6e595f0c2c2cea320d..b269427a51640ba78a4a8060b305bb5fc2e85127 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2013 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/mpc85xx.sh
 
 get_status_led() {
-        case $(mpc85xx_board_name) in
+        case $(board_name) in
         tl-wdr4900-v1)
                 status_led="tp-link:blue:system"
                 ;;
index 0baec28859da1f5fc9b1f4855f97289e192bea71..4b5b7a30ba9665776d4b3647bddd691a4b3ccda8 100644 (file)
@@ -13,9 +13,6 @@ ath9k_eeprom_extract() {
        local count=$3
        local mtd
 
-       . /lib/functions.sh
-       . /lib/functions/system.sh
-
        mtd=$(find_mtd_chardev $part)
        [ -n "$mtd" ] || \
                ath9k_eeprom_die "no mtd device found for partition $part"
@@ -29,9 +26,6 @@ tpl_set_wireless_mac()
        local offset=$1
        local mac
 
-       . /lib/functions.sh
-       . /lib/functions/system.sh
-
        mac=$(mtd_get_mac_binary u-boot 326656)
        mac=$(macaddr_add $mac $offset)
 
@@ -40,9 +34,10 @@ tpl_set_wireless_mac()
 
 [ -e $FW_FILE ] && exit 0
 
-. /lib/mpc85xx.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
 
-board=$(mpc85xx_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "pci_wmac0.eeprom")
index d95ec3013fecc2de0826d39c26828520648267ab..65b3674769c001d2091d68ab4dd2291f44e0fe87 100755 (executable)
@@ -2,10 +2,7 @@
 # Copyright (C) 2011 OpenWrt.org
 #
 
-. /lib/mpc85xx.sh
-
 PART_NAME=firmware
-RAMFS_COPY_DATA=/lib/mpc85xx.sh
 
 tplink_get_hwid() {
        local part
@@ -25,7 +22,7 @@ tplink_get_image_boot_size() {
 }
 
 platform_check_image() {
-       local board=$(mpc85xx_board_name)
+       local board=$(board_name)
        local magic="$(get_magic_long "$1")"
 
        [ "$#" -gt 1 ] && return 1
@@ -65,7 +62,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board=$(mpc85xx_board_name)
+       local board=$(board_name)
 
        case "$board" in
        *)
index f4b72288fe122173c78e9ac5609c4c645d78437c..84519907af02a1e7ae4403b219da1ec8ab41e652 100755 (executable)
@@ -5,11 +5,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/mvebu.sh
 
 board_config_update
 
-board=$(mvebu_board_name)
+board=$(board_name)
 
 case "$board" in
 armada-385-linksys-caiman)
index 94ce7d7b25e1a492c5bffa76d3c0db978627b311..86a17823b7b1aee70f6f942a86b023ddaca51f4a 100755 (executable)
@@ -5,11 +5,10 @@
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/mvebu.sh
 
 board_config_update
 
-board=$(mvebu_board_name)
+board=$(board_name)
 
 case "$board" in
 armada-385-linksys-caiman|\
index 622c7d9604f867b17b809a559db47ffd5f5652d9..4a3f54ed2cd76cfb6099ef52959c7159efeb14d3 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright (C) 2014-2016 OpenWrt.org
 # Copyright (C) 2016 LEDE-Project.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/mvebu.sh
 
 get_status_led() {
-       case $(mvebu_board_name) in
+       case $(board_name) in
        armada-385-linksys-caiman)
                status_led="caiman:white:power"
                ;;
index 8eeb5f99b98e24ce399b9d6e7849b1c7664f1222..c1532ac2c17251c87e2ff14cc9a3779d353b5153 100755 (executable)
@@ -5,9 +5,8 @@
 START=97
 boot() {
 . /lib/functions.sh
-. /lib/mvebu.sh
 
-case $(mvebu_board_name) in
+case $(board_name) in
        armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
                # make sure auto_recovery in uboot is always on
                AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
index b20d9fd3021f8ae86e037cc0de88367428533b45..baf4a20721996412bdce9171993d66d4cac933ae 100644 (file)
@@ -5,10 +5,10 @@
 
 [ ! -e /etc/config/wireless ] && exit 0
 
+. /lib/functions.sh
 . /lib/functions/system.sh
-. /lib/mvebu.sh
 
-board=$(mvebu_board_name)
+board=$(board_name)
 
 case "$board" in
 armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
index 2ebb337936cb06a776c617a783064c7abdd431eb..e15ce616c789a3de9848fd7b375148c7c2baf599 100644 (file)
@@ -3,9 +3,9 @@
 # Copyright (C) 2017 LEDE-Project.org
 #
 
-. /lib/mvebu.sh
+. /lib/functions.sh
 
-board=$(mvebu_board_name)
+board=$(board_name)
 
 case "$board" in
 armada-xp-linksys-mamba)
index ae34ef49da53f00c97d444179903cd2392c86325..e884351bf73613b209c3229af61444f9949d5c90 100644 (file)
@@ -7,9 +7,8 @@ preinit_set_mac_address() {
        local mac
 
        . /lib/functions.sh
-       . /lib/mvebu.sh
 
-       case $(mvebu_board_name) in
+       case $(board_name) in
        armada-xp-linksys-mamba)
                mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                ifconfig eth0 hw ether $mac 2>/dev/null
index 3edd82ebcdd124d7db9fd2867a36accabbb70a8a..c55c1f5c5ab4609d699c52250af513266068ba20 100644 (file)
@@ -6,9 +6,8 @@
 preinit_mount_syscfg() {
 
        . /lib/functions.sh
-       . /lib/mvebu.sh
 
-       case $(mvebu_board_name) in
+       case $(board_name) in
        armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
                needs_recovery=0
                syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
index dd21c0958e3664504662b664c376225da71cd074..89d884f1bfd0c4d4aaf78f4413519cb36e5cfb62 100755 (executable)
@@ -3,10 +3,8 @@
 # Copyright (C) 2016 LEDE-Project.org
 #
 
-. /lib/mvebu.sh
-
 RAMFS_COPY_BIN='fw_printenv fw_setenv'
-RAMFS_COPY_DATA='/lib/mvebu.sh /etc/fw_env.config /var/lock/fw_printenv.lock'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
 REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
@@ -14,9 +12,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board=$(mvebu_board_name)
-
-       case "$board" in
+       case "$(board_name)" in
        armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
                platform_do_upgrade_linksys "$ARGV"
                ;;
@@ -32,9 +28,7 @@ platform_do_upgrade() {
        esac
 }
 platform_copy_config() {
-       local board=$(mvebu_board_name)
-
-       case "$board" in
+       case "$(board_name)" in
        armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
                platform_copy_config_linksys
                ;;
index b31deb7cb6929b2ea5ee5415989a8a9e4274ed10..95f6534788b1f08c32ac0bde8b90916db7f0197b 100755 (executable)
@@ -2,11 +2,10 @@
 # Copyright (C) 2013-2015 OpenWrt.org
 
 . /lib/functions/uci-defaults.sh
-. /lib/mxs.sh
 
 board_config_update
 
-board=$(mxs_board_name)
+board=$(board_name)
 
 case "$board" in
 *)
index 11b1f75fae337c29bf0b0470d1861b1a7ffa3aa2..3b05f6da5f9b6730e7e023b34be086c4602df80a 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2013-2014 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/mxs.sh
 
 get_status_led() {
-       case $(mxs_board_name) in
+       case $(board_name) in
        duckbill)
                status_led="duckbill:green:status"
                ;;
index b4b598cc4062b37e8e5e988642ac2e51176d099e..5d665093f670c0e895a92174bbeb1f7349acd051 100755 (executable)
@@ -1,9 +1,8 @@
 #!/bin/sh
 
 . /lib/functions/uci-defaults.sh
-. /lib/oxnas.sh
 
-board=$(oxnas_board_name)
+board=$(board_name)
 board_config_update
 
 case $board in
index ac7fa0a1f9de6a87c5efdecb2534de667bf4c524..7ecaed51bfe6acf21fc0f722e6844d984bde0e50 100755 (executable)
@@ -8,7 +8,7 @@ board_config_update
 
 lan_mac=""
 
-case "$(oxnas_board_name)" in
+case "$(board_name)" in
        kd20)
                lan_mac="$(legacy_boot_mac_adr)"
                ;;
index 51771f3ea61710dbdab9e0c587fc039847498bc1..fd3bc3b33663c5e465a47252b1d132652dbb4ada 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2009-2013 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/oxnas.sh
 
 get_status_led() {
-       case $(oxnas_board_name) in
+       case $(board_name) in
        akitio)
                status_led="akitio:red:status"
                ;;
index 48c1dc3f847111b25e50ff4ba848907a6c61b4b1..6652e14f19df8b298bfc5aefcb4a8672152f1954 100644 (file)
@@ -2,13 +2,10 @@
 # Copyright (C) 2014 OpenWrt.org
 #
 
-. /lib/oxnas.sh
-
-RAMFS_COPY_DATA=/lib/oxnas.sh
 REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
-       local board=$(oxnas_board_name)
+       local board=$(board_name)
 
        [ "$ARGC" -gt 1 ] && return 1
 
index b20b83cd57d23893602578335c3d67817de922da..222a25a5c0fda78d3a4c723fec656f1a1709495a 100644 (file)
@@ -2,13 +2,10 @@
 # Copyright (C) 2010 OpenWrt.org
 #
 
-. /lib/ppc40x.sh
-
 PART_NAME=firmware
-RAMFS_COPY_DATA=/lib/ppc40x.sh
 
 platform_check_image() {
-       local board=$(ppc40x_board_name)
+       local board=$(board_name)
        local magic="$(get_magic_word "$1")"
 
        [ "$#" -gt 1 ] && return 1
@@ -28,7 +25,7 @@ platform_check_image() {
 }
 
 platform_do_upgrade() {
-       local board=$(ppc40x_board_name)
+       local board=$(board_name)
 
        case "$board" in
        *)
index 61fbf0f3f3b73628ec4e5fa9e0b4dbe379b0be37..83141dedd8db3aa45ec0be7fb9b7e37c651d0e30 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 . /lib/functions/uci-defaults.sh
-. /lib/ramips.sh
 
 set_usb_led() {
        ucidef_set_led_usbdev "usb" "USB" "${1}" "${2:-1-1}"
@@ -12,7 +11,7 @@ set_wifi_led() {
 }
 
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 board_config_update
 
index f6129b527add0e33315298656b71c977a6ce8013..78ba10342b3d6b18844554df81d0b5ae22ad0df2 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 . /lib/functions.sh
-. /lib/ramips.sh
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
 
@@ -494,7 +493,7 @@ ramips_setup_macs()
 }
 
 board_config_update
-board=$(ramips_board_name)
+board=$(board_name)
 ramips_setup_interfaces $board
 ramips_setup_macs $board
 board_config_flush
index 859dfb31f51244e69d3dce5fc80b329cb57729f3..a847a64d6bb026bb7e7943f8ecec92864eb96ec3 100755 (executable)
@@ -1,11 +1,10 @@
 #!/bin/sh
 
 . /lib/functions/uci-defaults.sh
-. /lib/ramips.sh
 
 board_config_update
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 case "$board" in
 ubnt-erx)
index 0f4e646ce11c15fe763c8e48e5263c1d0d763015..531c8e055f26eab5cd18ebfce43135f713676070 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 # Copyright (C) 2010-2013 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/ramips.sh
 
 get_status_led() {
-       board=$(ramips_board_name)
+       board=$(board_name)
 
        case $board in
        3g150b|\
index b44bae90bb7614514f3ce871821efad0ad410167..1e25643cb75c3bf12a3bb17bc0773ac0e7529adc 100644 (file)
@@ -11,8 +11,6 @@ rt2x00_eeprom_extract() {
        local count=$3
        local mtd
 
-       . /lib/functions.sh
-
        mtd=$(find_mtd_part $part)
        [ -n "$mtd" ] || \
                rt2x00_eeprom_die "no mtd device found for partition $part"
@@ -35,10 +33,10 @@ rt2x00_eeprom_set_macaddr() {
 FW="/lib/firmware/$FIRMWARE"
 [ -e "$FW" ] && exit 0
 
-. /lib/ramips.sh
+. /lib/functions.sh
 . /lib/functions/system.sh
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 case "$FIRMWARE" in
 "soc_wmac.eeprom")
index a9fdd666c37ae9736491d605cfca4c11b96bd610..0f260fa3fc67f9bb44d8273a25b1d4549f41ee79 100755 (executable)
@@ -3,9 +3,9 @@
 START=99
 
 start() {
-       . /lib/ramips.sh
+       . /lib/functions.sh
 
-       local board=$(ramips_board_name)
+       local board=$(board_name)
        if [ $board = "sk-wb8" ]; then
                fw_setenv bootcount 0
        fi
index f8d408deda8b59285b9aeec147550f46eb8bf9a3..9533aed475a14c9280c3984d530ff8c7c43a9eaf 100644 (file)
@@ -3,7 +3,7 @@
 # Copyright (C) 2012 OpenWrt.org
 #
 
-. /lib/ramips.sh
+. /lib/functions.sh
 
 fix_seama_header() {
        local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
@@ -11,7 +11,7 @@ fix_seama_header() {
        [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
 }
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 case "$board" in
 cy-swr1100 | \
index 057fe45444eb9c8041e5d5e7d00e68f620b6e0b1..007abf79f6d69b4bec9786e9956fef069ba79332 100644 (file)
@@ -6,9 +6,9 @@
 # that happens, so this needs to run very early during boot.
 
 do_checksumming_disable() {
-       . /lib/ramips.sh
+       . /lib/functions.sh
 
-       local board=$(ramips_board_name)
+       local board=$(board_name)
 
        case "$board" in
        wnce2001)
index 9b5da57146489705bd9b5df60a72225e55b42c68..e0a260216d510e7954f2b4e4afe9af374d7d4443 100755 (executable)
@@ -2,13 +2,10 @@
 # Copyright (C) 2010 OpenWrt.org
 #
 
-. /lib/ramips.sh
-
 PART_NAME=firmware
-RAMFS_COPY_DATA=/lib/ramips.sh
 
 platform_check_image() {
-       local board=$(ramips_board_name)
+       local board=$(board_name)
        local magic="$(get_magic_long "$1")"
 
        [ "$#" -gt 1 ] && return 1
@@ -275,7 +272,7 @@ platform_check_image() {
 }
 
 platform_nand_pre_upgrade() {
-       local board=$(ramips_board_name)
+       local board=$(board_name)
 
        case "$board" in
        ubnt-erx|\
@@ -286,7 +283,7 @@ platform_nand_pre_upgrade() {
 }
 
 platform_do_upgrade() {
-       local board=$(ramips_board_name)
+       local board=$(board_name)
 
        case "$board" in
        hc5962|\
index 900fb7d0869b8a870bf4e44872aaf14ae44ad0f6..98264c082e761c7f9bb865c1b488b6fd2c03d6bd 100755 (executable)
@@ -1,14 +1,13 @@
 #!/bin/sh
 . /lib/functions.sh
 . /lib/functions/system.sh
-. /lib/ramips.sh
 
 partname=""
 offset=""
 NEW_MAC=
 YES=
 
-board=$(ramips_board_name)
+board=$(board_name)
 case $board in
        witi)
                partname=factory
index 2b18748c6f08fcfbd57b12de626396b7591b82a5..782f3ec0d344fff0ae13aaad0d2f3bc5e4e6f7a6 100755 (executable)
@@ -3,12 +3,11 @@
 # Copyright (C) 2013-2015 OpenWrt.org
 #
 
-. /lib/sunxi.sh
 . /lib/functions/uci-defaults.sh
 
 board_config_update
 
-case "$( sunxi_board_name )" in
+case "$(board_name)" in
 "olimex,a20-olinuxino-micro")
        ucidef_set_interface_lan 'wlan0'
        ;;
index 7f508ff918e0fc7576591434d1f1012b0d4df4a6..170cfd5b29f05fce0ba2bf7e13a44e010d6166b5 100644 (file)
@@ -1,9 +1,10 @@
 #!/bin/sh
-. /lib/sunxi.sh
 
 do_b53_hack() {
+       . /lib/functions.sh
+
        # hack: enable switch on Lamobo R1 and reset counters
-       case "$( sunxi_board_name )" in
+       case "$(board_name)" in
        "lamobo,lamobo-r1")
                ifconfig eth0 up
                sleep 1