Commit 3fcd85b6 authored by fuyanbin's avatar fuyanbin
Browse files

统一判断system file是否为sparse格式的方式

parent 921fb7d7
......@@ -204,7 +204,7 @@ unpack_and_mount_image() {
__unpack_super_img "$ROCKCHIP_DEFAULT_SYSTEM_PARTITION_NAME"
fi
if file "$systemfile" | grep "Android sparse image"
if __is_sparse_system
then
simg2img "$systemfile" "$systemfile_ext4"
loopdev=$(losetup -P -f --show "$systemfile_ext4")
......@@ -421,6 +421,15 @@ __get_chip_from_parameter() {
printf "%s" "$parameter"
}
__is_sparse_system() {
if file "$systemfile" | grep "Android sparse image"
then
return 0
else
return 1
fi
}
pack_image() {
local img
img="$1"
......@@ -429,7 +438,7 @@ pack_image() {
rm -rf "$system_mount_point"
sync
if [[ -f "$systemfile_ext4" ]]
if __is_sparse_system
then
rm -f "$systemfile"
img2simg "$systemfile_ext4" "$systemfile"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment