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

Status
Not open for further replies.
Search This thread

Xeon721

Senior Member
Jun 28, 2013
78
16
Hi there :)

I used the third method to include OMS to my LOS ROM for my OnePlus 3.
I don't know why, but when I install Substratum, it tells me that I'm using Legacy, and not OMS...

Did I miss something to install OMS and not Legacy..?
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Hi there :)

I used the third method to include OMS to my LOS ROM for my OnePlus 3.
I don't know why, but when I install Substratum, it tells me that I'm using Legacy, and not OMS...

Did I miss something to install OMS and not Legacy..?
Try clearing Substratum data in Settings > Apps > Substratum > Data.

Sent from my Nexus 6P using XDA Labs
 

rajatgupta1998

Senior Member
Jan 12, 2015
1,126
3,509
25
Shimla
Moto G4 Plus
OnePlus 6
Thanks

Delete the file "sepolicy/themeservice_app.te" in your device tree. I removed CMTE's sepolicy as ours conflicts.
Thanks for the help, it worked and substratum works fine. This was my second build and I am happy that I was able to add OMS/Substratum support. Since I'm a beginner I'll try the first method soon. :) Thank you alot. :) :good:
 

Attachments

  • photo_2017-03-30_16-08-35.jpg
    photo_2017-03-30_16-08-35.jpg
    64.4 KB · Views: 842
  • photo_2017-03-30_16-08-52.jpg
    photo_2017-03-30_16-08-52.jpg
    67.2 KB · Views: 841
Last edited:
  • Like
Reactions: nathanchance

theandroidguy

Senior Member
Aug 20, 2016
1,590
362
Kolkata
HTC Desire 816
Nokia X
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.
I use the same......Let @bigsupersquid try this out
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
It stays on Legacy after cleaning Data and Cache. :(
(And I cannot screenshot you the settings page, it FC when I click on Settings).
All I can recommend is either waiting for the Play Store to update or building a debug APK to test: https://github.com/substratum/documentation/blob/master/BuildingSubstratum.md

@Xeon721, Maybe because it's missing the build.prop entry that Substratum read.
That build prop entry has been deprecated since 7.1.1 dropped.

Sent from my Nexus 6P using XDA Labs
 
  • Like
Reactions: bigsupersquid

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
For those who are going to be consistently merging or want a quick way to do it once, I have made a script to do so: https://github.com/LineageOMS/merge_script

Some caveats:

1. This is going do everything automatically in one shot; make sure your repos are clean and not heavily modified when doing this as you may get errors. Pay attention to the output.
2. Run
Code:
bash lineage_oms_merge.sh -h
to see how the script works.
3. If OMS commits are detected, the script will error out to protect you from creating merge conflicts. Do not use this as a way to stay up to date with Substratum commits unless you are straight building from Lineage and can force sync your additions away.

Let me know of any issues, enjoy!
 
  • Like
Reactions: Roach2010 and Gawd

FeintDoxx

Senior Member
Feb 24, 2013
350
114
Aurora
For those who are going to be consistently merging or want a quick way to do it once, I have made a script to do so: https://github.com/LineageOMS/merge_script

Some caveats:

1. This is going do everything automatically in one shot; make sure your repos are clean and not heavily modified when doing this as you may get errors. Pay attention to the output.
2. Run
Code:
bash lineage_oms_merge.sh -h
to see how the script works.
3. If OMS commits are detected, the script will error out to protect you from creating merge conflicts. Do not use this as a way to stay up to date with Substratum commits unless you are straight building from Lineage and can force sync your additions away.

Let me know of any issues, enjoy!
Not a beginner to programming and terminal, but beginner to building android from source, got this when merging:


===============================
== Merging frameworks/base ==
===============================

remote: Counting objects: 535, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 535 (delta 353), reused 516 (delta 336), pack-reused 0
Receiving objects: 100% (535/535), 360.09 KiB | 622.00 KiB/s, done.
Resolving deltas: 100% (353/353), completed with 113 local objects.
From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


I followed the lineage wiki on how to build from source and attempted to merge after initializing the source repo and then downloading the source with repo sync. I had gotten interrupted once and had to fc terminal and run repo sync once more. Once I had that all done, I figured I would need to pull from the repo before I prepared the device specific code. Currently running repo sync once more then attempting once more and if not I will just delete my current repo download and start from scratch again without any interruptions.

edit: after running repo sync and running the bash script i get this:


===============================
== Merging .repo/manifests ==
===============================

From https://github.com/LineageOMS/android
* branch cm-14.1 -> FETCH_HEAD
On branch default
Your branch is ahead of 'origin/cm-14.1' by 1 commit.
(use "git push" to publish your local commits)
You are currently cherry-picking commit f13d8ea.

nothing to commit, working directory clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

git commit --allow-empty

If you wish to skip this commit, use:

git reset

Then "git cherry-pick --continue" will resume cherry-picking
the remaining commits.


===============================
== Merging frameworks/base ==
===============================

From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


Not sure what to do here as when I attempt git reset and then git cherry-pick --continue
I just get this everytime: fatal: Not a git repository (or any of the parent directories): .git
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Not a beginner to programming and terminal, but beginner to building android from source, got this when merging:


===============================
== Merging frameworks/base ==
===============================

remote: Counting objects: 535, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 535 (delta 353), reused 516 (delta 336), pack-reused 0
Receiving objects: 100% (535/535), 360.09 KiB | 622.00 KiB/s, done.
Resolving deltas: 100% (353/353), completed with 113 local objects.
From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


I followed the lineage wiki on how to build from source and attempted to merge after initializing the source repo and then downloading the source with repo sync. I had gotten interrupted once and had to fc terminal and run repo sync once more. Once I had that all done, I figured I would need to pull from the repo before I prepared the device specific code. Currently running repo sync once more then attempting once more and if not I will just delete my current repo download and start from scratch again without any interruptions.

edit: after running repo sync and running the bash script i get this:


===============================
== Merging .repo/manifests ==
===============================

From https://github.com/LineageOMS/android
* branch cm-14.1 -> FETCH_HEAD
On branch default
Your branch is ahead of 'origin/cm-14.1' by 1 commit.
(use "git push" to publish your local commits)
You are currently cherry-picking commit f13d8ea.

nothing to commit, working directory clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

git commit --allow-empty

If you wish to skip this commit, use:

git reset

Then "git cherry-pick --continue" will resume cherry-picking
the remaining commits.


===============================
== Merging frameworks/base ==
===============================

From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


Not sure what to do here as when I attempt git reset and then git cherry-pick --continue
I just get this everytime: fatal: Not a git repository (or any of the parent directories): .git

I would try running a repo sync --force-sync to get rid of any previously picked OMS commits.
 
  • Like
Reactions: FeintDoxx

GtrCraft

Recognized Developer
Jun 3, 2013
6,818
17,854
Moto G5 Plus
Xiaomi Poco F1
Not a beginner to programming and terminal, but beginner to building android from source, got this when merging:


===============================
== Merging frameworks/base ==
===============================

remote: Counting objects: 535, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 535 (delta 353), reused 516 (delta 336), pack-reused 0
Receiving objects: 100% (535/535), 360.09 KiB | 622.00 KiB/s, done.
Resolving deltas: 100% (353/353), completed with 113 local objects.
From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


I followed the lineage wiki on how to build from source and attempted to merge after initializing the source repo and then downloading the source with repo sync. I had gotten interrupted once and had to fc terminal and run repo sync once more. Once I had that all done, I figured I would need to pull from the repo before I prepared the device specific code. Currently running repo sync once more then attempting once more and if not I will just delete my current repo download and start from scratch again without any interruptions.

edit: after running repo sync and running the bash script i get this:


===============================
== Merging .repo/manifests ==
===============================

From https://github.com/LineageOMS/android
* branch cm-14.1 -> FETCH_HEAD
On branch default
Your branch is ahead of 'origin/cm-14.1' by 1 commit.
(use "git push" to publish your local commits)
You are currently cherry-picking commit f13d8ea.

nothing to commit, working directory clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

git commit --allow-empty

If you wish to skip this commit, use:

git reset

Then "git cherry-pick --continue" will resume cherry-picking
the remaining commits.


===============================
== Merging frameworks/base ==
===============================

From https://github.com/LineageOMS/android_frameworks_base
* branch cm-14.1 -> FETCH_HEAD

PREVIOUS COMMITS FOUND; SCRIPT MUST BE RUN ON A CLEAN REPO! EITHER REPO SYNC OR PICK COMMITS MANUALLY!


Not sure what to do here as when I attempt git reset and then git cherry-pick --continue
I just get this everytime: fatal: Not a git repository (or any of the parent directories): .git

Sound like lineage is already ahead of @The Flash with commits. So the script doesn't work anymore
 

FeintDoxx

Senior Member
Feb 24, 2013
350
114
Aurora
Sound like lineage is already ahead of @The Flash with commits. So the script doesn't work anymore

Hmm, at this point it would be the waiting game before I can merge and build or would there be a work around for this? :eek: thanks for the info though.

---------- Post added at 02:52 AM ---------- Previous post was at 02:50 AM ----------

I would try running a repo sync --force-sync to get rid of any previously picked OMS commits.

I'll try this if the error shows up again. I had just started to download the source over again, if it shows up again I will attempt what you suggested. Thanks for the response.:good:
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Hmm, at this point it would be the waiting game before I can merge and build or would there be a work around for this? :eek: thanks for the info though.

---------- Post added at 02:52 AM ---------- Previous post was at 02:50 AM ----------



I'll try this if the error shows up again. I had just started to download the source over again, if it shows up again I will attempt what you suggested. Thanks for the response.:good:

Thanks to @GtrCraft, I found I had derped the logic of finding previous commits. I just pushed a commit that fixed it, give it a go when your sync is done :good:
 
  • Like
Reactions: FeintDoxx

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
i saw the topic : OMS7 in the Gerrit Code Review of lineageos.
is lineageos will support OMS officially soon ?

That's totally up to them. Someone other than an official team member pushed the patches to Gerrit and they've gotten some buzz but it does not sound like Lineage is too keen on it yet but we'll see. I want to make sure they are always up to date and proper which is why I did it this way rather than going through their Gerrit.
 

FeintDoxx

Senior Member
Feb 24, 2013
350
114
Aurora
Thanks to @GtrCraft, I found I had derped the logic of finding previous commits. I just pushed a commit that fixed it, give it a go when your sync is done :good:

So grateful for this though, had recently switched from S7 Edge to Nexus 6P, I had gotten used to being able to apply themes at a breeze with the samsung themes so when I saw the Lineage didn't support OMS officially I was heartbroken once I had found out about Substratum and then faith was revived when I saw this post. :D
 
  • Like
Reactions: nathanchance

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
So grateful for this though, had recently switched from S7 Edge to Nexus 6P, I had gotten used to being able to apply themes at a breeze with the samsung themes so when I saw the Lineage didn't support OMS officially I was heartbroken once I had found out about Substratum and then faith was revived when I saw this post. :D

Welcome to the Nexus side of life and enjoy the support :) feel free to ask me any questions you may have!
 
  • Like
Reactions: FeintDoxx
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