From 1a6a1c8a66b8d08154539a3884c6684999e94116 Mon Sep 17 00:00:00 2001 From: Shravan Vadeghar <89348492+Shra1V32@users.noreply.github.com> Date: Sun, 11 Jun 2023 21:39:57 +0530 Subject: [PATCH] dumpyara.sh: explicitly check the folders generated by `fsck.erofs` There's one case with `fsck.erofs` where it generates folder but fails to extract. The script will now check whether the generated folders are empty or not. --- dumpyara.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumpyara.sh b/dumpyara.sh index e16d97c..b40b908 100755 --- a/dumpyara.sh +++ b/dumpyara.sh @@ -122,7 +122,7 @@ for p in $PARTITIONS; do echo "Trying to extract $p partition via fsck.erofs." "$PROJECT_DIR"/Firmware_extractor/tools/Linux/bin/fsck.erofs --extract="$p" "$p".img # Deletes images if they were correctly extracted via fsck.erofs - if [ -d "$p" ]; then + if [[ -d "$p" ]] && [[ $(ls "$p") != '' ]]; then rm "$p".img > /dev/null 2>&1 else # Uses 7z if images could not be extracted via fsck.erofs