From 442d0b5ddcbe8064efafaba5b92400cc46beb17e Mon Sep 17 00:00:00 2001 From: Wang Han <416810799@qq.com> Date: Sat, 1 Mar 2025 15:43:14 +0800 Subject: [PATCH] Delete bootctl binary if execution fails New devices may use AIDL bootctrl HAL, so if bootctl hal-info fails, simply remove the temp file and return. --- scripts/app_functions.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/app_functions.sh b/scripts/app_functions.sh index dbc7c29c0..5ac141314 100644 --- a/scripts/app_functions.sh +++ b/scripts/app_functions.sh @@ -102,7 +102,10 @@ post_ota() { cp -f $1 bootctl rm -f $1 chmod 755 bootctl - ./bootctl hal-info || return + if ! ./bootctl hal-info; then + rm -f bootctl + return + fi SLOT_NUM=0 [ $(./bootctl get-current-slot) -eq 0 ] && SLOT_NUM=1 ./bootctl set-active-boot-slot $SLOT_NUM