CCCPaste

Modify Android GSI system Image

#modify Android GSI system Image
# System image option
## - https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
## - https://sourceforge.net/projects/andyyan-gsi/files/lineage-20-light/

#resize the image
fallocate -l 3500M system.img
resize2fs system.img 3500M

#mount the image
mkdir mnt
sudo mount system.img mnt

#THIS IS WHERE YOU MAKE CHANGES TO THE SYSTEM

#unmount image
sudo umount mnt

#now resize the image by removing empty space
e2fsck -yf system.img
resize2fs -M system.img
e2fsck -yf system.img

#now install it
adb reboot bootloader

wget https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot fastboot

fastboot delete-logical-partition product
fastboot delete-logical-partition product_a
fastboot delete-logical-partition product_b
fastboot erase userdata
fastboot erase cache
fastboot flash system system.img
fastboot -w
fastboot reboot