From 92c0e2d5a072f076a45033780350dd8f26446066 Mon Sep 17 00:00:00 2001 From: Dirk Chang Date: Sat, 12 Oct 2024 09:08:17 +0800 Subject: [PATCH] rockchip: fixed image check --- .config_tlink_r4x | 5 ----- package/base-files/files/etc/build_version | 2 +- .../armv8/base-files/lib/upgrade/platform.sh | 12 +++++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.config_tlink_r4x b/.config_tlink_r4x index 20f7c5042c8896..ede80f476dd3c2 100644 --- a/.config_tlink_r4x +++ b/.config_tlink_r4x @@ -3826,11 +3826,8 @@ CONFIG_PACKAGE_MAC80211_MESH=y # CONFIG_PACKAGE_kmod-rtl8812au-mw is not set # CONFIG_PACKAGE_kmod-rtl8812cu is not set # CONFIG_PACKAGE_kmod-rtl8821ae is not set -# CONFIG_PACKAGE_kmod-rtl8821cu is not set -# CONFIG_PACKAGE_kmod-rtl8822cu is not set # CONFIG_PACKAGE_kmod-rtl8xxxu is not set # CONFIG_PACKAGE_kmod-rtw88 is not set -# CONFIG_PACKAGE_kmod-rtw88-usb is not set # CONFIG_PACKAGE_kmod-wil6210 is not set # CONFIG_PACKAGE_kmod-wl12xx is not set # CONFIG_PACKAGE_kmod-wl18xx is not set @@ -5554,7 +5551,6 @@ CONFIG_PACKAGE_luci-app-firewall=y # CONFIG_PACKAGE_luci-app-nextdns is not set # CONFIG_PACKAGE_luci-app-nft-qos is not set # CONFIG_PACKAGE_luci-app-nlbwmon is not set -# CONFIG_PACKAGE_luci-app-ntpc is not set # CONFIG_PACKAGE_luci-app-nut is not set # CONFIG_PACKAGE_luci-app-ocserv is not set # CONFIG_PACKAGE_luci-app-olsr is not set @@ -6383,7 +6379,6 @@ CONFIG_PACKAGE_ip-full=y # CONFIG_PACKAGE_linuxptp is not set # CONFIG_PACKAGE_ntp-keygen is not set # CONFIG_PACKAGE_ntp-utils is not set -# CONFIG_PACKAGE_ntpclient is not set # CONFIG_PACKAGE_ntpd is not set # CONFIG_PACKAGE_ntpdate is not set # end of Time Synchronization diff --git a/package/base-files/files/etc/build_version b/package/base-files/files/etc/build_version index bdb157dc9f80d0..19b468b7620388 100644 --- a/package/base-files/files/etc/build_version +++ b/package/base-files/files/etc/build_version @@ -1 +1 @@ -24.07.16 +24.10.12 diff --git a/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh b/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh index d1ad1d7ddccd04..8f932960887504 100644 --- a/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh +++ b/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh @@ -1,6 +1,6 @@ tlink_get_type_magic() { - # 0x4c0cc - local skip_base=311500 + # 0x800943 + local skip_base=8390979 local skip_offset=$(($skip_base)) local name_len=$2 get_image "$1" | dd bs=1 count=$name_len skip=$skip_offset 2>/dev/null | hexdump -v -n $name_len -e '/1 "%c"' @@ -9,9 +9,11 @@ tlink_get_type_magic() { tlink_check_image() { local cur_name=$(board_name) local name_len=${#cur_name} - local typemagic="$(tlink_get_type_magic "$1" $name_len)" - [ "${typemagic}" != "$(board_name)" ] && { - echo "Invalid image, bad type: $typemagic $(board_name)" + local name_len_s=$((name_len-7)) + local cur_name_s=${cur_name:7} + local typemagic="$(tlink_get_type_magic "$1" $name_len_s)" + [ "${typemagic}"x != "${cur_name:7}"x ] && { + echo "Invalid image, bad type:${typemagic}!=${cur_name:7}." return 1 } return 0