it is not a problem with the GPT which is probably correct. when flashing the GPT table it will fixup the size of the last partition to fit the entire space. So I suppose the partition size is correct if you check with gdisk tool on the board.
the main issue is with the file system itself and how it was generated. At the time this image was built we were using an android tool to create the rootfs image , not the standard linux mkfs tools. and we noticed that the android ‘mkfs’ tool had issues with ‘large’ sizes, and it would prevent the online resizing to work well. There are a bit more details in this commit message when we made the switch to the new tools:
so if you really want to keep your image, you can, but you need to regenerate the rootfs image. Something along these lines should work (on your PC):
1. create the raw image with the original image from einfochips
simg2img <linaro-vivid-xxx.img> linaro-vivid.img
2. loop mount the raw img
mount -o loop linaro-vivid.img ./rootfs
3. create a new rootfs image with the linux mkfs tools and with the content of the original image:
# the size can be small here, we will resize automatically on the first boot.
mkfs.ext4 -L rootfs linaro-vivid-new.img.raw 2G
mount -o loop linaro-vivid-new.img.raw rootfs2
cp -a rootfs/* rootfs2
4. create the fastboot sparse image
ext2simg -v linaro-vivid-new.img.raw linaro-vivid-new.img
I just typed the command, so there could be a few typos/issues, but you get the idea. on debian/ubuntu you will need to install android-tools-fsutils package.
You can then flash into rootfs linaro-vivid-new.img and let it boot. then you can run the following script on the your board:
It will resize the rootfs to fill up the entire actual partition size. then df -h should report the maximum size…
If it works, please report it to einfochips, so that they properly document that somewhere…
note that the resize-helper script is there in our latest images, and it is executed automatically on first boot. You need to run it only once (per board) after flashing the rootfs image.