A generic system image (GSI) is a system image with adjusted configurations for Android devices. One Single GSI could run on devices with different configuration without modification or re-compling theoretically. For example, we can repack Lineage OS, One UI or any other AOSP-based modifications into GSI and let it run on any devices.
Yet it is designed to run any where, some devices even like Pixel OG (codename
marlin) still has trick when flashing GSI.
Resize System Partition
While the original size of
system_b partition is only 2147MB,
To resize the partition, firstly download
parted. We will use that later within TWRP.
$ adb push parted /sbin/parted $ adb shell # chmod 777 /sbin/parted # /sbin/parted /dev/block/sda
# For system_a mkpart Partition name? system_a File system type? ext4 Start? 930 End? 4030 # For system_b mkpart Partition name? system_b File system type? ext2 Start? 4030 End? 7130 # For userdata mkpart Partition name? userdata File system type? ext4 Start? 7130 End? 24870
set 33 msftdata on set 35 msftdata on
Get GSI Image Installed
fastboot erase system fastboot flash system <system image>
For example, flashing a Havoc OS GSI should be successful:
Sending sparse 'system_a' 1/6 (524284 KB) OKAY [ 15.015s] Writing 'system_a' OKAY [ 3.536s] Sending sparse 'system_a' 2/6 (524284 KB) OKAY [ 14.823s] Writing 'system_a' OKAY [ 3.502s] Sending sparse 'system_a' 3/6 (524284 KB) OKAY [ 15.007s] Writing 'system_a' OKAY [ 3.539s] Sending sparse 'system_a' 4/6 (524284 KB) OKAY [ 14.670s] Writing 'system_a' OKAY [ 3.498s] Sending sparse 'system_a' 5/6 (524284 KB) OKAY [ 14.711s] Writing 'system_a' OKAY [ 3.489s] Sending sparse 'system_a' 6/6 (247960 KB) OKAY [ 7.016s] Writing 'system_a' OKAY [ 1.738s] Finished. Total time: 101.027s
Push Missing Libraries
Unfortunately GSI builds for Pixel (and Pixel XL) are missing some (mainly audio-related) libraries and will fail on booting. For Android 10 (Q), the following files should be extracted from factory images to
And the following file to
Set a correct permission:
chcon u:object_r:system_lib_file:s0 /system/lib/vndk-29/android.hardware.audio.common-util.so
Finally, flash Permissiver to fix SELinux permission on boot partition and we are go for launch.