Resize images as required
Instead of resizing images directly to 6 GB , now resize as required by the add-on being installed, this should help mobile devices with limited storages
This commit is contained in:
parent
f4f4cf380b
commit
9a3b849d23
1 changed files with 16 additions and 6 deletions
|
|
@ -124,8 +124,10 @@ def install_gapps():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print("==> Found system image: "+system_img)
|
print("==> Found system image: "+system_img)
|
||||||
|
|
||||||
|
img_size = int(os.path.getsize(system_img)/(1024*1024))
|
||||||
|
|
||||||
# Resize image to get some free space
|
# Resize image to get some free space
|
||||||
resize_img(system_img, "5G")
|
resize_img(system_img, "{}M".format(img_size+500))
|
||||||
|
|
||||||
# Mount the system image
|
# Mount the system image
|
||||||
mount_image(system_img, sys_image_mount)
|
mount_image(system_img, sys_image_mount)
|
||||||
|
|
@ -226,7 +228,10 @@ on property:ro.enable.native.bridge.exec=1
|
||||||
print("==> Found system image: "+system_img)
|
print("==> Found system image: "+system_img)
|
||||||
|
|
||||||
# Resize rootfs
|
# Resize rootfs
|
||||||
resize_img(system_img, "6G")
|
img_size = int(os.path.getsize(system_img)/(1024*1024))
|
||||||
|
|
||||||
|
# Resize image to get some free space
|
||||||
|
resize_img(system_img, "{}M".format(img_size+50))
|
||||||
|
|
||||||
# Mount the system image
|
# Mount the system image
|
||||||
mount_image(system_img, sys_image_mount)
|
mount_image(system_img, sys_image_mount)
|
||||||
|
|
@ -329,8 +334,11 @@ on property:ro.enable.native.bridge.exec=1
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print("==> Found system image: "+system_img)
|
print("==> Found system image: "+system_img)
|
||||||
|
|
||||||
# Resize rootfs
|
img_size = int(os.path.getsize(system_img)/(1024*1024))
|
||||||
resize_img(system_img, "6G")
|
|
||||||
|
# Resize image to get some free space
|
||||||
|
resize_img(system_img, "{}M".format(img_size+300))
|
||||||
|
|
||||||
|
|
||||||
# Mount the system image
|
# Mount the system image
|
||||||
mount_image(system_img, sys_image_mount)
|
mount_image(system_img, sys_image_mount)
|
||||||
|
|
@ -450,8 +458,10 @@ service magisk /system/bin/init-magisk.sh
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print("==> Found system image: " + system_img)
|
print("==> Found system image: " + system_img)
|
||||||
|
|
||||||
# Resize rootfs
|
img_size = int(os.path.getsize(system_img)/(1024*1024))
|
||||||
resize_img(system_img, "6G")
|
|
||||||
|
# Resize image to get some free space
|
||||||
|
resize_img(system_img, "{}M".format(img_size+50))
|
||||||
|
|
||||||
# Mount the system image
|
# Mount the system image
|
||||||
mount_image(system_img, sys_image_mount)
|
mount_image(system_img, sys_image_mount)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue