diff options
author | Chirayu Desai <chirayudesai1@gmail.com> | 2021-12-04 01:18:45 +0530 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2021-12-09 01:40:34 +0200 |
commit | 48f78ad780218269ae3c9dc69119df7093b9a530 (patch) | |
tree | eb6a967ebcbb3c18f5f2fbc3689f92dc454fa407 | |
parent | 3e6a2fe5ebdf8915ed06c78095321e2a895985c3 (diff) |
regen-vendor: Support directly extracting from sparse images
Change-Id: I1707b013fe661c45ede57960fa448eccfc4350d5
-rw-r--r-- | extract_utils.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index c60b376..598e42e 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1808,7 +1808,17 @@ function generate_prop_list_from_image() { local -n skipped_files="$3" local partition="$4" - extract_img_data "$image_file" "$image_dir" + mkdir -p "$image_dir" + + if [[ $(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" + extract_img_data "$image_dir"/"$(basename "$image_file").raw" "$image_dir" + rm "$image_dir"/"$(basename "$image_file").raw" + else + echo "Unsupported "$image_file"" + fi find "$image_dir" -not -type d | sed "s#^$image_dir/##" | while read -r FILE do |