Skip to content

Commit

Permalink
fix: more improvements in update OTA
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Dec 19, 2024
1 parent 10c9ba6 commit 60225c7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ set_boot() {

switch_boot(){
[ "$DRY_RUN" != 0 ] && return 0
[ "$BOOTPART" = "boot0" ] && set_boot boot1 || set_boot boot0
[ "$BOOTPART" = "boot0" ] && set_boot boot1
[ "$BOOTPART" = "boot1" ] && set_boot boot0
}

get_boot_from_cmdline() {
Expand Down Expand Up @@ -100,9 +101,12 @@ set_target_partitions() {
if [ "$BOOTPART" = "boot0" ]; then
mtdkrn=3
mtdroot=5 # update sys1
else
elif [ "$BOOTPART" = "boot1" ]; then
mtdkrn=2
mtdroot=4 # update sys0
else
echo "-----"
fail 1 "Invalid boot partition: $BOOTPART"
fi
}

Expand Down Expand Up @@ -251,6 +255,10 @@ download_ota() {
}

run_ota() {
if [ "$SKIP_DOWNLOAD" = 1 ]; then
MIN_MEMORY=5000
fi

if [ `mem_available` -lt $MIN_MEMORY ]; then
clean_memory
if [ `mem_available` -lt $MIN_MEMORY ]; then
Expand Down

0 comments on commit 60225c7

Please sign in to comment.