[Treble-Enabled Device Development A/AB ROMS] AndyYan:
Background:

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.

Disclaimer:

This is still mostly a LineageOS team / PHH [MENTION=1915408]phhusson[/MENTION] 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.

Download:

https://sourceforge.net/projects/andyyan-gsi/files/

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)

Extra tip:

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 [MENTION=9553881]SnapTheRipper[/MENTION] 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:

device/phh/treble:

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

build/make:

Revert Enable dyanmic image size for GSI - fix building

external/tinycompress:

Revert tinycompress: Use generated kernel headers - remove dependency on generated kernel headers

frameworks/base:

Revert Initial support for in-display fingerprint sensors - use PHH's implementation

vendor/lineage:

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

vendor/qcom/opensource/cryptfs_hw:

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

And that's it. Doesn't look like much, but most are pretty hacky solutions, and I don't expect them to be merged anywhere. As I said, I'm only interested in getting it running, I don't care what it takes.

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.

Donate?

https://paypal.me/AndyCGYan

Thanks for reading - I hope this could be of use to fellow LineageOS lovers / home builders.