From 5c916de64cfdb41b664379b2c7a05305a66af12c Mon Sep 17 00:00:00 2001 From: osm0sis Date: Thu, 25 May 2023 18:36:51 -0300 Subject: [PATCH] Backend: abort apex loop mounts early if failing - /dev/block/loop* nodes don't behave correctly in Lineage Recovery anymore (beginning ~ LOS19), not sure why, but mount and losetup can't use them - bail out early so we don't slow the install to a crawl with the rapid mount failures --- META-INF/com/google/android/update-binary | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index f6fb7f7..080c32b 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -82,6 +82,10 @@ mount_apex() { mount -t ext4 -o ro,loop,noatime $loop $dest && echo "$dest (loop)" >&2; if [ $? != 0 ]; then losetup -d $loop 2>/dev/null; + if [ $num -eq 64 -a $(losetup -f) == "/dev/block/loop0" ]; then + echo "Aborting apex mounts due to broken environment..." >&2; + break; + fi; fi; fi; ;;