From 848dffc2f53535118ecf09b71c28901f6b7ab5f4 Mon Sep 17 00:00:00 2001 From: lindongping Date: Thu, 20 Mar 2025 11:30:27 +0800 Subject: [PATCH 1/2] update phytium-firstlogin and ft-config Signed-off-by: lindongping --- package/phytium-firstlogin/src/phytium-firstlogin | 4 ++-- package/phytium-tools/src/ft-config | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/phytium-firstlogin/src/phytium-firstlogin b/package/phytium-firstlogin/src/phytium-firstlogin index afa25754..a78ad79c 100755 --- a/package/phytium-firstlogin/src/phytium-firstlogin +++ b/package/phytium-firstlogin/src/phytium-firstlogin @@ -493,7 +493,7 @@ check-if-dd-success() { if [ "${_hash}" = "${_known}" ]; then echo -e "\033[1;32mHash verification succeeded, configuration has been updated.\033[0m" else - echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/phytium_ota%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" + echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/%E9%A3%9E%E8%85%BE%E6%B4%BE%E5%9B%BA%E4%BB%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7ft-config%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" exit 1 fi } @@ -520,7 +520,7 @@ firmware_configure(){ echo "$response" done if [[ "${response}" =~ ^(Y|y)$ ]]; then - printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc bs=1 count=1 seek=1004390 && sync + printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync flag=1 fi if [[ "$flag" == 1 ]]; then diff --git a/package/phytium-tools/src/ft-config b/package/phytium-tools/src/ft-config index daf9f0d8..e967d431 100755 --- a/package/phytium-tools/src/ft-config +++ b/package/phytium-tools/src/ft-config @@ -94,7 +94,7 @@ check-if-dd-success() { if [ "${_hash}" = "${_known}" ]; then echo -e "\033[1;32mHash verification succeeded, configuration has been updated.\033[0m" else - echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/phytium_ota%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" + echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/%E9%A3%9E%E8%85%BE%E6%B4%BE%E5%9B%BA%E4%BB%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7ft-config%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" exit 1 fi } @@ -121,9 +121,9 @@ configure_phytiumpi_firmware() { fi elif [[ "$1" == "mem" ]]; then if [[ "$2" == "4g" ]]; then - printf "\x10" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc bs=1 count=1 seek=1004390 && sync + printf "\x10" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync elif [[ "$2" == "8g" ]]; then - printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc bs=1 count=1 seek=1004390 && sync + printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync fi if [ "$?" != "0" ]; then echo "\033[1;31mconfigure mem failed\033[0m" @@ -146,7 +146,7 @@ configure_phytiumpi_firmware() { check-if-dd-success para_msata.bin 980k 1568 fi # restore memory information. - printf "\\x$pre_mem" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc bs=1 count=1 seek=1004390 + printf "\\x$pre_mem" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 fi echo -e "\033[1;32mConfigure phytiumpi firmware success, please power reset now\033[0m" -- Gitee From ac39a395407bbda73a82bb95edcf891e7d14c91a Mon Sep 17 00:00:00 2001 From: lindongping Date: Thu, 20 Mar 2025 11:31:04 +0800 Subject: [PATCH 2/2] delete check-latest Signed-off-by: lindongping --- package/phytium-ota/phytium-ota.mk | 1 - package/phytium-ota/src/check-latest | 38 ---------------------------- 2 files changed, 39 deletions(-) delete mode 100755 package/phytium-ota/src/check-latest diff --git a/package/phytium-ota/phytium-ota.mk b/package/phytium-ota/phytium-ota.mk index 26a6eb7f..30ecb39e 100644 --- a/package/phytium-ota/phytium-ota.mk +++ b/package/phytium-ota/phytium-ota.mk @@ -13,7 +13,6 @@ define PHYTIUM_OTA_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/usr/bin mkdir -p $(TARGET_DIR)/usr/lib/phytium/ $(INSTALL) -m 755 -D $(@D)/check-hash $(TARGET_DIR)/usr/bin/ - $(INSTALL) -m 755 -D $(@D)/check-latest $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 755 -D $(@D)/get_phytium_ota $(TARGET_DIR)/usr/bin/ cp -rf $(@D)/phytium-ota-latest/ $(TARGET_DIR)/usr/lib/phytium/ endef diff --git a/package/phytium-ota/src/check-latest b/package/phytium-ota/src/check-latest deleted file mode 100755 index 9709bab7..00000000 --- a/package/phytium-ota/src/check-latest +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -set -e - -latest_dir="/usr/lib/phytium/phytium-ota-latest" - -if [ $2 = "uboot" ]; then - _hash=$( sha256sum "$1/$2/fip-all-optee-4GB.bin" |cut -d ' ' -f 1 ) -elif [ $2 = "fitImage" ]; then - _hash=$( sha256sum "$1/$2/5.10/$2.tar" |cut -d ' ' -f 1 ) -elif [ $2 = "rootfs" ]; then - _hash=$( sha256sum "$1/$2/$2.tar" |cut -d ' ' -f 1 ) -fi - -if [ ! -e "$latest_dir/$2/$2_latest.hash" ]; then - mkdir -p $latest_dir/$2 - if [ $2 = "uboot" ]; then - echo "sha256 ${_hash} fip-all-optee-4GB.bin" > $latest_dir/$2/$2_latest.hash - else - echo "sha256 ${_hash} $2.tar" > $latest_dir/$2/$2_latest.hash - fi - echo "no_latest" - exit -else - _known=$(cat $latest_dir/$2/$2_latest.hash | cut -d ' ' -f 3) -fi - -# Do the hashes match? -if [ "${_hash}" = "${_known}" ]; then - echo "latest" -else - mkdir -p $latest_dir/$2 - if [ $2 = "uboot" ]; then - echo "sha256 ${_hash} fip-all-optee-4GB.bin" > $latest_dir/$2/$2_latest.hash - else - echo "sha256 ${_hash} $2.tar" > $latest_dir/$2/$2_latest.hash - fi - echo "no_latest" -fi -- Gitee