Ishay Peled
Ishay Peled

Reputation: 2868

How to increase system.img partition size

I'm building a custom aosp image to which I want to add gapps after flashing.

There is not enough space in the system.img partition (500mb short) to accommodate gapps so the operation fails.

My question is where do I specify system.img partition size in the aosp tree?

Any ideas are welcome!

Upvotes: 2

Views: 10758

Answers (2)

Ishay Peled
Ishay Peled

Reputation: 2868

Okay, for other people looking for an answer for this, it is impossible to change the partition size for system.img. It is defined as part of BoardConfig.mk and is static for the device.

In theory, it may be possible to increase system.img size by altering the parameter BOARD_SYSTEMIMAGE_PARTITION_SIZE and reducing other partition sizes, but I guess that would fail if the partitions are on different physical devices.

See for example device/samsung/manta/BoardConfig.mk

Upvotes: 4

us_david
us_david

Reputation: 4917

This is NOT actually true. It's system.img is an linux ext4 file system and you can resize it from uBuntu using the following command:

dd if=/dev/zero bs=1M count=128 >> system.img  
e2fsck -f system.img  
resize2fs system.img    

Now, you added 128 MB to system.img!

David

Upvotes: 2

Related Questions