We've been offered LOS 16 GSIs in the past (here, and here), but they haven't been updated in quite a while, so as a LineageOS lover, I decided to step up and do it myself. Turns out it wasn't so easy - there were a number of hurdles that prevented it from building properly, booting or being feature-complete. But here I am, having figured out most if not all what's needed, and verified booting on an arm64 ab device I own, I'm ready to share my findings as well as some builds with you.
This is still mostly a LineageOS team / PHH @phhusson effort, credits to them and all associated for making all this possible.
No instructions will be offered. If you're here in this forum, you should know what you're doing.
No guarantees that everything would work. This is a GSI, bugs are bound to happen.
Do not report hardware-related bugs in this thread. I am selfish and only care about getting it running on my device with whatever features I need working. Plus I'm not PHH and can't solve any either.
Compressed as .xz archives - extract first.
Vanilla except for these changes:
- Modifications needed to make it build/boot/feature-complete, see below
- Disabled "vendor mismatch" warning on boot
- Re-enabled lockscreen shortcuts
- Default stretch-to-fullscreen (force apps to render in 18:9)
If you have a relatively low-end device and experience UI stutters, try this simple build.prop trick (technically a debug property, so use at your own risk). Thanks @SnapTheRipper for bringing it up!
Modifications needed (builders-only):
Now for the juicy part. On top of PHH's already fantastic build script, you'll need these:
- Revert Update lineage.mk for LineageOS 16.0 - add back LOS sepolicy, so that LOS-specific features like Profiles, LiveDisplay, Styles, Trust would work
- Revert exfat fsck/mkfs selinux label - fix a conflict in doing so
- Revert Enable dyanmic image size for GSI - fix building
- Revert tinycompress: Use generated kernel headers - remove dependency on generated kernel headers
- Revert Initial support for in-display fingerprint sensors - use PHH's implementation
- Apply build/soong/Android.bp: Disable generated_kernel_* - disable generating kernel headers, since GSIs don't have a kernel
- Revert lineage: Enforce privapp-permissions whitelist, or change it to log
- Revert cryptfs_hw: Use generated kernel headers - remove dependency on generated kernel headers
- Apply [TEMP]: Header hack to compile for 8974 - fix a missing header
Stuff on GitHub (builders-only):
I've also collected necessary scripts/patches and uploaded them: treble_build_los, treble_patches (PHH's treble_patches adjusted for LOS). Not the cleanest code, but should help if you still need more clues.
Thanks for reading - I hope this could be of use to fellow LineageOS lovers / home builders.