0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-09-23 22:52:27 +00:00
Files
openwrt/target/linux/realtek/base-files/etc/uci-defaults/99_fwenv-store-ethaddr
Jonas Jelonek b082f9f60e realtek: fix model for TP-Link TL-ST1008F v2.0
Fix the model name in DTS compatible, Makefiles and board scripts by
using dash instead of comma or underscore. This aligns it with other
examples in OpenWrt and makes in consistent in all places where the
board model is used.

'tplink,tl-st1008f,v2' --> 'tplink,tl-st1008f-v2'
'tplink,tl-st1008f_v2' --> 'tplink,tl-st1008f-v2'

Fixes: 39b9b491bb ("realtek: add support for TP-Link TL-ST1008F v2.0")
Fixes: #19930
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19934
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-03 00:51:49 +02:00

30 lines
772 B
Plaintext

[ ! -e /etc/fw_env.config ] && exit 0
BOARD_CFG=/etc/board.json
[ ! -e "$BOARD_CFG" ] && exit 0
. /lib/functions/system.sh
. /lib/upgrade/common.sh
. /usr/share/libubox/jshn.sh
[ "$(rootfs_type)" = "tmpfs" ] && exit 0
case "$(board_name)" in
tplink,tl-st1008f-v2)
env_ethaddr=$(macaddr_canonicalize "$(fw_printenv -n ethaddr 2>/dev/null)")
# This device ships with a dummy ethaddr because it's an unmanaged switch.
# If it hasn't been updated to another one yet, do that now.
if [ -z "$env_ethaddr" ] || [ "$env_ethaddr" = "00:e0:4c:00:00:00" ]; then
json_init
json_load_file "$BOARD_CFG"
json_select network_device
json_select eth0
json_get_var board_ethaddr macaddr
[ -n "$board_ethaddr" ] && fw_setenv ethaddr "$board_ethaddr"
fi
;;
esac
exit 0