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.
This commit is contained in:
Wang Han 2025-03-01 15:43:14 +08:00 committed by John Wu
parent 494615d9a0
commit 442d0b5ddc

View File

@ -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