From 9c40eb661a027beb0904cccbb2df6199c19ac43f Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Thu, 30 Nov 2023 18:11:51 +0100 Subject: [PATCH] extract-utils: Add support for EROFS extraction Change-Id: I08a83851bb2f35b68291f1df2fb961c6fb9c82bc --- extract_utils.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extract_utils.sh b/extract_utils.sh index 62085f0..9fe4ccc 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1629,7 +1629,9 @@ function prepare_images() { echo "Extracting "$PARTITION"" local IMAGE="$SRC"/"$PARTITION".img if [ -f "$IMAGE" ]; then - if [[ $(file -b "$IMAGE") == Linux* ]]; then + if [[ $(file -b "$IMAGE") == EROFS* ]]; then + fsck.erofs --extract="$DUMPDIR"/"$PARTITION" "$IMAGE" + elif [[ $(file -b "$IMAGE") == Linux* ]]; then extract_img_data "$IMAGE" "$DUMPDIR"/"$PARTITION" elif [[ $(file -b "$IMAGE") == Android* ]]; then "$SIMG2IMG" "$IMAGE" "$DUMPDIR"/"$PARTITION".raw @@ -2016,7 +2018,9 @@ function generate_prop_list_from_image() { mkdir -p "$image_dir" - if [[ $(file -b "$image_file") == Linux* ]]; then + if [[ $(file -b "$image_file") == EROFS* ]]; then + fsck.erofs --extract="$image_dir" "$image_file" + elif [[ $(file -b "$image_file") == Linux* ]]; then extract_img_data "$image_file" "$image_dir" elif [[ $(file -b "$image_file") == Android* ]]; then "$SIMG2IMG" "$image_file" "$image_dir"/"$(basename "$image_file").raw"