7

When I try to flash via fastboot system.img (from my custom AOSP build) to Sony Xperia Z3 I get the following error:

# fastboot flash system system.img 
sending 'system' (584106 KB)...
OKAY [ 18.294s]
writing 'system'...
FAILED (remote: size too large)
finished. total time: 18.297s

Z3 has about 2GB system partition and I have no idea why flashing fails.

Lawiusz
  • 1,200
  • 1
  • 12
  • 16

4 Answers4

10

This forces fastboot to automatically sparse files to a given range in size K | M | G, in this case 256M

fastboot flash –S 256M system PATH_TO_SYSTEM.img
thomascrha
  • 193
  • 1
  • 1
  • 13
tiger.meng
  • 111
  • 2
  • 2
    This method also does not work. It gives the following output: sending sparse 'system' (259493 KB)... OKAY [ 8.138s] writing 'system'... FAILED (remote: size too large) finished. total time: 8.141s – Lawiusz Dec 16 '15 at 14:19
  • Faced the same issue @Lawiusz specifying the -S parameter didnt change my situation – Nwawel A Iroume Dec 16 '16 at 13:32
4

Use newer fastboot version that allow sending packages sperated.

Jami Liang
  • 41
  • 1
2

I have finally found the solution:

BOARD_SYSTEMIMAGE_PARTITION_SIZE

in BoardConfig.mk was larger than it should be. Changing it fixed the issue.

Lawiusz
  • 1,200
  • 1
  • 12
  • 16
  • May i ask what exactly is BoardConfig.mk ? I don't find this kind of file in my computer. – Tasos Moustakas Dec 30 '15 at 20:43
  • BoardConfig.mk is configuration file used when you compile your own Android ROM. – Lawiusz Dec 30 '15 at 20:46
  • Ok, i face the exact same problem as you. I have Asus Zenfone Selfie. I can't find such file in my computer. Can you provide me with something relevant, eg some other file, so i can edit that and increase partition size ? – Tasos Moustakas Dec 30 '15 at 20:51
  • By editing BOARD_SYSTEMIMAGE_PARTITION_SIZE you only give the compiler information how big is your device's system partition so that it can build system.img with appropriate size. – Lawiusz Dec 30 '15 at 20:55
  • Ok. How do i edit BOARD_SYSTEMIMAGE_PARTITION_SIZE ? – Tasos Moustakas Dec 30 '15 at 20:56
  • Assuming that you build your own ROM, the file is located upon your_aosp_source/device/your_device_vendor/your_device/BoardConfig.mk – Lawiusz Dec 30 '15 at 21:00
1

Just use a newer fastboot version. New bootloaders support downloading system.img in parts.

skoperst
  • 2,259
  • 1
  • 23
  • 35