OK , here are instructions for How to build MaruOS for devices supported by Lineage OS .
First you may have some questions so I try to quick respond to them .
Q. Why you use Maru Os ?
A. I want Ubuntu desktop on my external monitor .
Q. Do you use it as primary rom?
A. Yes for 2 years ,on a LG G4 and now on HTC 10
Q. Is Android and Ubuntu stable?
A. Very stable .I use it day by day no crash no problems .
Q. Why do you need to modify android framework and just dnt use a apk .
A. Because I want everything to be stable and best performances .
Q. Why do I need Lineage OS ?
A. Because you need to run a Android inside your phone ,and you need to have the source of that Android so you to integrate Maru OS mods into it . Device manufacturers do not release the source of the device tree for the phones and the mods they do to android ,but you can often find this on the Lineage Os project .
Q. What is a device tree and why I need it .
A. A device tree contains source code and some files that describe your device and contains device specific mods .This are not the same for every device , so it must be made for your phone model .Without this android do not know your partitions sizes and phone hardware like cpu , camera , display model etc. When a manufacturer build android for a device , they add to the AOSP a device tree that is custom build for that device .
Google give you device tree usually just for their Nexus phones and you can use that inside AOSP but others manufacturers do not publish the device tree they use .
Unless you're a expert and you can build yourself a device tree , you have to use one already build and you can find it in the Lineage Os project. But the device tree from Lineage Os do not works inside AOSP so you have to use Lineage OS too .
Q. My phone is not a Nexus can I compile the Google AOSP for it without to use any device tree?
A. No , your phone will miss camera ,wifi , bluetooth or will not start at all .You really need a device tree for your model .
Q. Why Maru Os use AOSP Andorid as base and not LineageOs .
A. Probably will use in future . When Maru Os started for Nexus 5 ,there was a existing device tree for Nexus 5 ,provided by google , and Preetam just decided to use the pure AOSP because he had all he need.
Also at that time there was no Lineage OS , was
CyanogenMod and that was not perfect like the official Google AOSP.
Q.Can I use MaruOs inside my phone model XYZ ?
A.You can use Maru os inside any phone model supported by Google AOSP and LineageOS , but I recommend you phones with slimport port cause using a wired HDMi out you dnt have lag like over wifi casting .
Q. How did you build MaruOs for HTC 10 ?
A . I just used https://wiki.lineageos.org/devices/pme/build . First I did all it say in that page and build it to be sure it compile , next I modified the kernel to support lxc , then I modified Android Framework to support MaruOs (I modified lineage os same Preetam modified : android_platform_frameworks_base ,android_platform_frameworks_native ,android_platform_packages_apps_Settings ) and last I added vendor_maruos as a dependecty of my device tree .
I followed Lineage Os instructions + Maru Os wiki , the patches that I did for Lineage Os framework I got from https://github.com/maruos/ .
Q. Can I modify Lineage Os framework line by line , same like Preetam modified AOSP ?
A. Starting with Lineage OS 14.1 you dnt need to write any code by yourself you can patch LineageOs exactly how Preetam patched AOSP , without you to add any extra code.
Ok , that is for now . Next I will put the source code so you dnt have to patch again the LineageOs with MaruOs mods , but you will still have to follow the Lineage Os instruction for your device model -> to put inside Lineage Os the device tree specific to your phone model .