[REFERENCE] LineageOS with full Substratum support - Closed until Oreo

Status
Not open for further replies.
Search This thread

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,754
50,020
27
Mesa, AZ
nathanchance.dev
Introduction

Hello everyone! I am one of the members of the Substratum team and we constantly have people asking how to add support to ROMs. I have made a repo regarding all of our documentation here, in which I include steps to add support. Normally, it is easy to add support to most ROMs; however, Lineage has made some underlying changes to AssetManager and PackageManager that makes adding the patches a little difficult if you do not have some solid programming background. To help people who are familiar with building and git but not necessarily Java and C, I have created a series of reference repos that you can use to cherry pick the commits into your forks or local builds to easily have theme support! Please read this entire thread, I go over a lot of info and I will be upset if you do not read it all :) enjoy!

Information

Substratum currently uses OMS (Overlay Manager Service), Sony's theming framework, that allows for real time swapping of resources via overlays. This is accomplished through a series of commits, which include the core OMS framework, exposures so themes can overlay hardcoded resources, and a second set of framework commits to allow Substratum to do all of its operations without root access. You can read more about this in the main Substratum thread. We have made it so that it is easy to merge OMS and all of our exposures on AOSP or close to AOSP ROMs. Lineage is not one of those ROMs as they have based on CAF, which modifies AOSP to suit a large range of devices. Lineage has also modified core components like Package Manager for security reasons and some of those changes will conflict with OMS changes. I have merged the changes on top of Lineage and verified everything has worked properly. I will continue to maintain this as long as time permits. I plan to try and rebase the changes every day on Lineage updates but I may need to do it weekly depending on how much free time I have.

What do I have to do?

All you need to do is merge the changes from our repos into yours! Link: https://github.com/LineageOMS

This can be done in one of four ways (ONLY ONE):

1. Cherry-pick our changes

This will be the best option if you have forked Lineage and made any changes (basically basing a ROM on Lineage). Once you have merged these changes, you can track our progress on Gerrit and merge patches as they come down. The patches you need to pick will be either "committed with nathanchance" or "nathanchance committed".

Code:
git fetch <url> cm-14.1
git cherry-pick <first_sha1>^..<second_sha1>

Example:
Code:
git fetch https://github.com/LineageOMS/android_frameworks_base cm-14.1
git cherry-pick d6b3f93bec61769fab7ebf31e78bf0acb42bb2e6^..1e00bba63c5b6facec5a8beef1bb39863b251183

2. Pull our changes

This will be a good option if you have either forked Lineage and made no changes or do straight builds from their repos, as this will fetch and merge automatically. You can still cherry-pick if you want but this should result in no conflicts (basically a clean merge).

Code:
git pull <url> cm-14.1

Example:
Code:
git pull https://github.com/LineageOMS/android_frameworks_base cm-14.1

3. Sync using our manifest

This is good if you are just building straight from Lineage's sources. The one issue with this is you will be fully reliant on me for updates; Lineage often merges patches across a few repos and you may run into errors if ALL repos are not up to date.

From the top of your Lineage repo folder:
Code:
mkdir LineageOMS && cd LineageOMS
repo init -u https://github.com/LineageOMS/android -b cm-14.1 --no-clone-bundle --depth=1
repo sync -j$( nproc --all ) --force-sync -c --no-clone-bundle --no-tags --optimized-fetch --prune


4. Use the provided local manifest

This is good if you are just building straight from Lineage's sources. As with the above option, you MAY run into errors if a patch is merged across several repos and I have not update my repos with the proper changes.

From the top of your Lineage repo folder:
Code:
cd .repo
mkdir -p local_manifests
cd local_manifests
wget https://raw.githubusercontent.com/LineageOMS/local_manifest/master/substratum.xml
cd ../..
repo sync --force-sync


4. Use the provided local manifest

I would only recommend doing this if you are building straight from Lineage's sources and willing to build only when I rebase my changes. Lineage often merges patches across several repos and without every repo being up to date, you may get build errors.

From the top of your Lineage repo folder:
Code:
cd .repo
mkdir -p local_manifests
cd local_manifests
wget https://raw.githubusercontent.com/LineageOMS/local_manifest/master/substratum.xml
cd ../..
repo sync --force-sync

That's it! Super easy as it should be.

Support

If you run into any issues with merging patches, ask in this thread.

If you PM me on XDA... I will ignore you.
If you PM me on Hangouts... I will ignore you.
If you PM me on Telegram... I will ignore you.

See a pattern? :p This thread is the place for support, nowhere else.

If you run into issues with using Substratum itself, ask in the main thread.
 

Attachments

  • Screenshot_20170328-004553.png
    Screenshot_20170328-004553.png
    209.2 KB · Views: 23,060
  • Screenshot_20170328-004618.png
    Screenshot_20170328-004618.png
    157.4 KB · Views: 22,450
  • Screenshot_20170328-004601.png
    Screenshot_20170328-004601.png
    132.8 KB · Views: 21,894
  • Screenshot_20170328-004608.png
    Screenshot_20170328-004608.png
    133.1 KB · Views: 18,859
Last edited:

Sachin ET

Senior Member
Dec 21, 2016
373
55
actually i didn't understand......can anyone explain it in simple words.......am not a tech guy, am just a beginner in this world of custom ROM.
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,754
50,020
27
Mesa, AZ
nathanchance.dev
Is it possible to do for this build. Can anyone HELP me with video tutorial plz..

---------- Post added at 06:56 AM ---------- Previous post was at 06:41 AM ----------



Iam using HTC desire 816.i have flash this build cm14.1-20161120-unofficial-a5dwg can u plz help me to how to do this.

You need to build for yourself, you cannot do this to an already compiled build.

actually i didn't understand......can anyone explain it in simple words.......am not a tech guy, am just a beginner in this world of custom ROM.

Unfortunately, if you cannot understand what I wrote, you need to do a lot of research into the world of git and custom ROMs, I cannot provide that to you in this thread. A good place to start would be my guide on how to compile from source: https://github.com/nathanchance/Android-Tools/raw/master/Guides/Building_AOSP.txt
 

rajatgupta1998

Senior Member
Jan 12, 2015
1,123
3,505
24
Shimla
Moto G4 Plus
OnePlus 6
Firstly thanks for this guide. :) I followed the THIRD way to add Substratum Support in my ROM and I'm getting some error Permissive domains not allowed and the make fails. I am building LineageOS for Moto G4 Plus (athene). Error: https://hastebin.com/keyacadezi.vbs
Full output: https://paste.ee/p/GvyYN Anyone who can help in this, I'd be thankful :)
Device tree: https://github.com/tywinlannister7/android_device_motorola_athene
Kernel tree: https://github.com/LineageOS/android_kernel_motorola_msm8952
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,754
50,020
27
Mesa, AZ
nathanchance.dev
Firstly thanks for this guide. :) I followed the THIRD way to add Substratum Support in my ROM and I'm getting some error Permissive domains not allowed and the make fails. I am building LineageOS for Moto G4 Plus (athene). Error: https://hastebin.com/keyacadezi.vbs
Full output: https://paste.ee/p/GvyYN Anyone who can help in this, I'd be thankful :)
Device tree: https://github.com/tywinlannister7/android_device_motorola_athene
Kernel tree: https://github.com/LineageOS/android_kernel_motorola_msm8952

Delete the file "sepolicy/themeservice_app.te" in your device tree. I removed CMTE's sepolicy as ours conflicts.
 
  • Like
Reactions: rajatgupta1998

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,754
50,020
27
Mesa, AZ
nathanchance.dev
dont work with touchwiz roms or?

Are TouchWiz ROMs LineageOS? Then no, this is not applicable for TouchWiz ROMs. If you mean Substratum as a whole, probably not as TouchWiz is nowhere close to stock Android and this should be asked in the main Substratum thread.

Sent from my Nexus 6P using XDA Labs
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 94
    Introduction

    Hello everyone! I am one of the members of the Substratum team and we constantly have people asking how to add support to ROMs. I have made a repo regarding all of our documentation here, in which I include steps to add support. Normally, it is easy to add support to most ROMs; however, Lineage has made some underlying changes to AssetManager and PackageManager that makes adding the patches a little difficult if you do not have some solid programming background. To help people who are familiar with building and git but not necessarily Java and C, I have created a series of reference repos that you can use to cherry pick the commits into your forks or local builds to easily have theme support! Please read this entire thread, I go over a lot of info and I will be upset if you do not read it all :) enjoy!

    Information

    Substratum currently uses OMS (Overlay Manager Service), Sony's theming framework, that allows for real time swapping of resources via overlays. This is accomplished through a series of commits, which include the core OMS framework, exposures so themes can overlay hardcoded resources, and a second set of framework commits to allow Substratum to do all of its operations without root access. You can read more about this in the main Substratum thread. We have made it so that it is easy to merge OMS and all of our exposures on AOSP or close to AOSP ROMs. Lineage is not one of those ROMs as they have based on CAF, which modifies AOSP to suit a large range of devices. Lineage has also modified core components like Package Manager for security reasons and some of those changes will conflict with OMS changes. I have merged the changes on top of Lineage and verified everything has worked properly. I will continue to maintain this as long as time permits. I plan to try and rebase the changes every day on Lineage updates but I may need to do it weekly depending on how much free time I have.

    What do I have to do?

    All you need to do is merge the changes from our repos into yours! Link: https://github.com/LineageOMS

    This can be done in one of four ways (ONLY ONE):

    1. Cherry-pick our changes

    This will be the best option if you have forked Lineage and made any changes (basically basing a ROM on Lineage). Once you have merged these changes, you can track our progress on Gerrit and merge patches as they come down. The patches you need to pick will be either "committed with nathanchance" or "nathanchance committed".

    Code:
    git fetch <url> cm-14.1
    git cherry-pick <first_sha1>^..<second_sha1>

    Example:
    Code:
    git fetch https://github.com/LineageOMS/android_frameworks_base cm-14.1
    git cherry-pick d6b3f93bec61769fab7ebf31e78bf0acb42bb2e6^..1e00bba63c5b6facec5a8beef1bb39863b251183

    2. Pull our changes

    This will be a good option if you have either forked Lineage and made no changes or do straight builds from their repos, as this will fetch and merge automatically. You can still cherry-pick if you want but this should result in no conflicts (basically a clean merge).

    Code:
    git pull <url> cm-14.1

    Example:
    Code:
    git pull https://github.com/LineageOMS/android_frameworks_base cm-14.1

    3. Sync using our manifest

    This is good if you are just building straight from Lineage's sources. The one issue with this is you will be fully reliant on me for updates; Lineage often merges patches across a few repos and you may run into errors if ALL repos are not up to date.

    From the top of your Lineage repo folder:
    Code:
    mkdir LineageOMS && cd LineageOMS
    repo init -u https://github.com/LineageOMS/android -b cm-14.1 --no-clone-bundle --depth=1
    repo sync -j$( nproc --all ) --force-sync -c --no-clone-bundle --no-tags --optimized-fetch --prune


    4. Use the provided local manifest

    This is good if you are just building straight from Lineage's sources. As with the above option, you MAY run into errors if a patch is merged across several repos and I have not update my repos with the proper changes.

    From the top of your Lineage repo folder:
    Code:
    cd .repo
    mkdir -p local_manifests
    cd local_manifests
    wget https://raw.githubusercontent.com/LineageOMS/local_manifest/master/substratum.xml
    cd ../..
    repo sync --force-sync


    4. Use the provided local manifest

    I would only recommend doing this if you are building straight from Lineage's sources and willing to build only when I rebase my changes. Lineage often merges patches across several repos and without every repo being up to date, you may get build errors.

    From the top of your Lineage repo folder:
    Code:
    cd .repo
    mkdir -p local_manifests
    cd local_manifests
    wget https://raw.githubusercontent.com/LineageOMS/local_manifest/master/substratum.xml
    cd ../..
    repo sync --force-sync

    That's it! Super easy as it should be.

    Support

    If you run into any issues with merging patches, ask in this thread.

    If you PM me on XDA... I will ignore you.
    If you PM me on Hangouts... I will ignore you.
    If you PM me on Telegram... I will ignore you.

    See a pattern? :p This thread is the place for support, nowhere else.

    If you run into issues with using Substratum itself, ask in the main thread.
    12
    I'm closing this thread for now. LineageOMS will be updated once we figure out what exactly is needed for Oreo in terms of exposures and rootless support.
    6
    I made my own manifest to build lineage with OMS here: https://github.com/DespairFactor/android
    5
    Repos are all up to date for Lineage's 7.1.2 merge.
    4
    dont work with touchwiz roms or?

    Are TouchWiz ROMs LineageOS? Then no, this is not applicable for TouchWiz ROMs. If you mean Substratum as a whole, probably not as TouchWiz is nowhere close to stock Android and this should be asked in the main Substratum thread.

    Sent from my Nexus 6P using XDA Labs