Skip to content

Commit

Permalink
fix: solved the problem that the returned version number is not the l…
Browse files Browse the repository at this point in the history
…atest version
  • Loading branch information
Lesords committed Jun 17, 2024
1 parent 87b66c2 commit e1ed6f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/global_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define PATH_UPGRADE_URL "/etc/upgrade"
#define PATH_SSH_KEY_FILE "/root/.ssh/authorized_keys"
#define PATH_UPGRADE_PROGRESS_FILE "/tmp/upgrade.percentage"
#define PATH_UPGRADE_VERSION_FILE "/tmp/upgrade.version"

/* usertool.sh*/
#define SCRIPT_USER(action) ("/mnt/system/usr/scripts/usertool.sh" \
Expand Down
2 changes: 1 addition & 1 deletion modules/ipc/src/utils_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int getSystemUpdateVesionInfo(HttpRequest* req, HttpResponse* resp)
}
}

content = readFile(PATH_ISSUE);
content = readFile(PATH_UPGRADE_VERSION_FILE);
pos = content.find(' ');
if (pos != std::string::npos) {
os = content.substr(0, pos);
Expand Down
4 changes: 3 additions & 1 deletion solutions/recamera/scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ROOTFS_FILE=rootfs_ext4.emmc
PERCENTAGE=0
PERCENTAGE_FILE=/tmp/upgrade.percentage
CTRL_FILE=/tmp/upgrade.ctrl
VERSION_FILE=/tmp/upgrade.version

function clean_up() {
if [ ! -z $MOUNTPATH ]; then
Expand Down Expand Up @@ -173,6 +174,7 @@ latest)
exit_upgrade 1
fi

echo "$os_name $os_version" > $VERSION_FILE
result=$(check_version $os_name $os_version)
PERCENTAGE=$result

Expand Down Expand Up @@ -319,4 +321,4 @@ query)
fi
;;

esac
esac

0 comments on commit e1ed6f0

Please sign in to comment.