mediatek: restrict compat_version override for BPi-R3
authorDaniel Golle <daniel@makrotopia.org>
Sun, 30 Mar 2025 17:11:39 +0000 (18:11 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 30 Mar 2025 17:14:33 +0000 (18:14 +0100)
Only force compat_version to 1.2 if it was less than 1.2 before, as changes
1.1 and 1.2 were bootloader-related and a completed boot indicates that the
changes have been completed. Newer compat version 1.3 indicates a config change
and should not be forced on boot.

Fixes: 84fc59c0d5 ("mediatek: filogic: bpi-r3: set netdev-name for sfp1 port")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version

index f39d2575e131926d8d73ef835222157403d7ad2e..d1ec1a6914b191dfd1c7c81f793fab377ed155df 100644 (file)
@@ -2,8 +2,11 @@
 
 case "$(board_name)" in
        bananapi,bpi-r3)
-       uci set system.@system[0].compat_version="1.2"
-       uci commit system
+       compat_version="$(uci get system.@system[0].compat_version)"
+       if [ "${compat_version%%.*}" = "1" ] && [ "${compat_version##*.}" -le 1 ]; then
+               uci set system.@system[0].compat_version="1.2"
+               uci commit system
+       fi
        ;;
 esac