[openwrt/openwrt] mediatek: set new compat version if booted on R64 and R3

LEDE Commits lede-commits at lists.infradead.org
Fri Jun 9 11:24:03 PDT 2023


dangole pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/49bd38f01ac6927cda2dc894417994d1256673a7

commit 49bd38f01ac6927cda2dc894417994d1256673a7
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Jun 6 01:14:27 2023 +0100

    mediatek: set new compat version if booted on R64 and R3
    
    If the board comes up with OpenWrt that means that the bootloader is
    recent enough and knows about the new device tree overlays.
    
    Using /etc/board.d/ is not enough in this case because it doesn't
    overwrite existing configuration which may exist (and is fine to exist)
    if the user updated with 'sysupgrade -F *.itb' and has kept
    configuration. They would still need to manually set compat_version
    even though the fact that the bootloader env has been updated can be
    implied by the fact that the system has started.
    
    Hence we can always set compat_version=1.1 for those two boards using
    uci-defaults.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
    (cherry picked from commit 25e27c4af3f1de872aadbaada434437cba3b0a75)
---
 .../filogic/base-files/etc/uci-defaults/05_fix-compat-version  | 10 ++++++++++
 .../mt7622/base-files/etc/uci-defaults/05_fix-compat-version   | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version
new file mode 100644
index 0000000000..4486f2f090
--- /dev/null
+++ b/target/linux/mediatek/filogic/base-files/etc/uci-defaults/05_fix-compat-version
@@ -0,0 +1,10 @@
+. /lib/functions.sh
+
+case "$(board_name)" in
+	bananapi,bpi-r3)
+	uci set system. at system[0].compat_version="1.1"
+	uci commit system
+	;;
+esac
+
+exit 0
diff --git a/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version
new file mode 100644
index 0000000000..c77e1cb8bd
--- /dev/null
+++ b/target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version
@@ -0,0 +1,10 @@
+. /lib/functions.sh
+
+case "$(board_name)" in
+	bananapi,bpi-r64)
+	uci set system. at system[0].compat_version="1.1"
+	uci commit system
+	;;
+esac
+
+exit 0




More information about the lede-commits mailing list