Introduction
Hello all, I am bringing you this thread as a jumping off point to compiling kernels and working with upstream Linux. I will include a guide, some links, and some terms that will help you get started with modifying kernel source. This is also a good reference point for existing developers as I have consolidated all upstream patches into one repo. Let's get down into it!
What in the world is upstream Linux?
When an OEM sets up a device, they will pick a stable longterm branch from the Linux kernel to base their modifications around (drivers and such). In the case of Bullhead, they picked 3.10.73. Currently, the Linux kernel's 3.10 is updated to 3.10.105, as you can see on kernel.org. This means that Google is "missing" versions 3.10.74 to 3.10.105. Now, why does this matter? Well, the way that the Linux kernel runs its stable branches, the only things that get merged into there are bug fixes and security updates. That's it, there are no wonky features or unstable patches. The only way you get a patch into a stable branch is by having it be in the mainline branch first. Some developers have an aversion to adding upstream because they claim it is excessive and not necessary and they are partially right since not all the patches that come in are relevant to our architecture (arm64). However, upstream Linux is not unstable and by adding each version one at a time, you can verify this. I found only two patches between 3.10.73 and 3.10.105 that gave me issues and it is easy enough to either fix/revert them. Being up to date is good since you keep yourself protected from bugs and security issues that crop up. Google has been better about doing this lately with their monthly security updates but it never hurts to take matters into your own hands.
I suggest watching one of these talks given by Greg Kroah-Hartman, it is really interesting to see how the process goes:
https://www.youtube.com/watch?v=SPY0LyTU53w | https://www.youtube.com/watch?v=L2SED6sewRw
What did you do?
All I did was fetch the latest kernel.org patches from here and cherry pick them on top of the latest kernel source from Google.
I merge these patches by cherry-picking each version individually (3.10.73 to 3.10.74, 3.10.74 to 3.10.75, etc), that way I can verify that the kernel compiles fine and that there are no merge conflicts. Google will sometimes pick certain commits from upstream that are of a higher importance than others which can result in conflicts if you try to pick it again. Additionally, upstream might fix a bug one way and Google has done it another (which is not really good, Google should be pushing their fixes back to upstream so everything stays in sync).
What do I do with this?
I have created two repos below: one with the latest N security update branch with the latest upstream patches picked up on top of it (the bullhead-upstream branch) and another one with a plain AnyKernel source for you to modify (bullhead-stock is the most basic, bullhead-decrypt contains an fstab file that will disable both forced encryption and dm-verity). You are free to fork these or base other branches on them, that's the whole point of this post. I have verified that all the patches contain no major detectable issues. I would like some credit if you do use it but it's not required since the kernel is licensed under GPL Another reason I offer this is I have seen a lot of developers picking in upstream in patch sets, so you get one single commit for an upstream version. This is detrimental as you start to add your own patches as you cannot fully tell what was modified and for what reason without the individual commits. It might look cleaner but you don't get full history which hurts you in the long run.
Links
Kernel source: https://github.com/nathanchance/bullhead/tree/upstream-7.1.2
AnyKernel source: https://github.com/nathanchance/AnyKernel2/tree/bullhead-stock-decrypt
Toolchain source: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
How to compile
This will be a quick, step by step guide on how to compile this kernel from source. By using this process, you can start to make modifications to the kernel source and make a flashable zip.
Clone the kernel source, the AnyKernel source, and toolchain source
Code:
cd ~
mkdir Kernel && cd Kernel
git clone https://github.com/nathanchance/bullhead.git source
git clone https://github.com/nathanchance/AnyKernel2.git anykernel
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 AOSP-4.9
Explanation:
First command: make sure you are in your home directory (or whatever directory you want to hold the kernel folder we are about to make.
Second command: make a Kernel folder and move into it
Third command: clone the kernel source from my repo into a folder named source
Fourth command: clone the AnyKernel source from my repo into a folder named anykernel
Fifth command: clone the Google 4.9 toolchain into a folder named AOSP-4.9
AnyKernel is the name of the zip we are going to make which allows the kernel to be flashed over any ROM.
A toolchain is a set of compiler tools that allow us to compile the kernel on any computer architecture.
Make sure you are on the correct branches
Code:
cd source && git checkout upstream-7.1.2
cd ../anykernel && git checkout bullhead-stock-decrypt
Explanation:
First command: move into the source directory and checkout the branch "upstream-7.1.2", which has all of the necessary patches in it.
Second command: move into the AnyKernel directory and checkout the branch "bullhead-decrypt". If you don't want to disable forced encryption, use the "bullhead-stock" branch.
Tell the compiler what you are are compiling
Code:
export CROSS_COMPILE=${HOME}/Kernel/AOSP-4.9/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64
make clean && make mrproper
make bullhead_defconfig
Explanation:
First command: point the compiler to the location of your toolchain. If you have done anything different with the folder locations, you will need to modify the "${HOME}/Kernel/AOSP-4.9" part.
Second command: tell the compiler which architecture we are compiling for. In this case, our device is an arm64 device.
Third command: clean out any compiled files and remove our previous defconfig.
Fourth command: tell the compiler which options we want in the kernel using the bullhead_defconfig.
A defconfig is a file that will tell the compiler which features we want in the kernel. No computer ever uses all of the options in the kernel since there are different drivers for various devices.
Make the kernel!
Code:
make -j$(nproc --all)
Explanation:
make tells the compiler to make the kernel (duh) and the -j$(nproc --all) tells the compiler to use the maximum number of cores your computer has available
Make the AnyKernel zip
Code:
cp -v arch/arm64/boot/Image.gz-dtb ../anykernel/zImage-dtb
cd ../anykernel
zip -r9 stock-upstream.zip * -x README stock-upstream.zip
Explanation:
First command: copies the completed kernel (Image.gz-dtb) into the AnyKernel folder
Second command: moves us into the AnyKernel folder
Third command: makes the zip file (named stock-upstream.zip) in the AnyKernel folder.
If you ever want to do this again, run these commands and go straight to step 3:
Code:
cd source && git clean -fxd && git pull
cd anykernel && git clean -fxd && git pull
NOTE: This thread is aimed to be a breeding ground for kernel development, a place to jump off if you will. I am happy to answer how to questions about building kernels or flashing the one I have provided but this is not supposed to be a general Q&A thread. Please use another thread or create your own in Q&A if you need assistance.
THIS. This is what I've been looking for ever since I bought and rooted my bullhead: an optimized stock kernel. I hope and pray that upstream patches are just the beginning, and later on, you'll have the time and inclination to add more optimizations. I don't care for other features. Just a kernel that works and performs is fine with me. If ever you need a tester for future builds, just give me a shout out and I'll be happy to assist. Thanks for sharing your work, mate.
I'd like to respectfully make a request. Talking a look at your Flash kernel thread and I found the optimizations I was referring to in my post above, namely:
Upstream Linux versions 3.10.74-3.10.103
Updated to the October security patch
Patches for some CVEs
Upstream patches from CAF and Linux
Compiled with the Linaro 6.2 toolchain, compiled regularly from Uber's source?*here
Makefile optimizations
Forced encryption and dm-verity disabled
If you can add these to the stock kernel, I'm pretty sure you'll find a user base for this setup (aside from me, of course). I'm sure a lot old timers like myself would a appreciate something that they can use right out of the box and not have to tinker with too much to get a good performance.
apatal said:
I'd like to respectfully make a request. Talking a look at your Flash kernel thread and I found the optimizations I was referring to in my post above, namely:
Upstream Linux versions 3.10.74-3.10.103
Updated to the October security patch
Patches for some CVEs
Upstream patches from CAF and Linux
Compiled with the Linaro 6.2 toolchain, compiled regularly from Uber's source?*here
Makefile optimizations
Forced encryption and dm-verity disabled
If you can add these to the stock kernel, I'm pretty sure you'll find a user base for this setup (aside from me, of course). I'm sure a lot old timers like myself would a appreciate something that they can use right out of the box and not have to tinker with too much to get a good performance.
Click to expand...
Click to collapse
This kernel is not meant to have anything other than the upstream Linux stuff, that's why it is labelled as reference. The only reason I include a kernel here at all is to prove that the additions are stable and cause no side effects. If you want those things, you can compile the kernel yourself (I can show you which patches and toolchain you would need).
Sent from my Nexus 6P using XDA Labs
The Flash said:
This kernel is not meant to have anything other than the upstream Linux stuff, that's why it is labelled as reference. The only reason I include a kernel here at all is to prove that the additions are stable and cause no side effects. If you want those things, you can compile the kernel yourself (I can show you which patches and toolchain you would need).
Click to expand...
Click to collapse
Noted with thanks! Great! When I get the time and resources to build my own kernel, I'll come back here for some pointers.
Btw, I saw a thread here about making your own ROM in the cloud. Is that something you can do as well for making a kernel?
apatal said:
Noted with thanks! Great! When I get the time and resources to build my own kernel, I'll come back here for some pointers.
Btw, I saw a thread here about making your own ROM in the cloud. Is that something you can do as well for making a kernel?
Click to expand...
Click to collapse
Definitely, I do all my building on a server.
The Flash said:
Definitely, I do all my building on a server.
Click to expand...
Click to collapse
Thanks! I'll take a look at it and see if I can figure it out.
Github and the kernel in the OP are updated to 3.10.104.
The Flash said:
Github and the kernel in the OP are updated to 3.10.104.
Click to expand...
Click to collapse
I supposed because of the upstream patch, third kernel already has the Dirty Cow fix, correct?
apatal said:
I supposed because of the upstream patch, third kernel already has the Dirty Cow fix, correct?
Click to expand...
Click to collapse
Yes.
Hi...Sir @The Flash,
This third command is Making FlashableZip?
OR
Non-FlashableZip?
•••
ZawZaw said:
Hi...Sir @The Flash,
This third command is Making FlashableZip?
OR
Non-FlashableZip?
•••
Click to expand...
Click to collapse
Flashable zip
The Flash said:
Flashable zip
Click to expand...
Click to collapse
Thanks Sir. :good:
3.10.105 released https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?id=refs/tags/v3.10.105
Sent from my Nexus 5X using XDA-Developers Legacy app
tuhinxp04 said:
3.10.105 released https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?id=refs/tags/v3.10.105
Click to expand...
Click to collapse
I am aware. I'm not actually doing this for this device anymore so there won't be an update.
Hi... @The Flash
I have one question, please reply me.
What is UBER?
UBER is a compliler as Google's ToolChain Prebuilt?
What different UBER and Google Toolchain?
I want to know,
Please explain me.
Thanks You Sir
•••
ZawZaw said:
Hi... @The Flash
I have one question, please reply me.
What is UBER?
UBER is a compliler as Google's ToolChain Prebuilt?
What different UBER and Google Toolchain?
I want to know,
Please explain me.
Thanks You Sir
•••
Click to expand...
Click to collapse
https://plus.google.com/+ChetKener/posts/YzMJEkzPQgp
The Flash said:
https://plus.google.com/+ChetKener/posts/YzMJEkzPQgp
Click to expand...
Click to collapse
Thanks You Sir.
•••
Hey @The Flash I've been reading through your "How to build Pure Nexus" thread and this thread and I believe that I have an understanding of how to properly setup an environment and compile a kernel for use. However, I still need some guidance as to how to pull commits from others sources and merge them into mine so that my kernel will have those features. The main features I want for my kernel are: LZ4 ramdisk compression (as seen in jollaman's and rachanta's kernels), F2FS compatibility, Overclocking for both the big and little clusters, and a kernel tick rate of 100Hz. If it is not too much to ask could you please show me an example of how to merge at least one of these features into my source so that when I compile my kernel it will have the feature?
HesThatGuy said:
Hey @The Flash I've been reading through your "How to build Pure Nexus" thread and this thread and I believe that I have an understanding of how to properly setup an environment and compile a kernel for use. However, I still need some guidance as to how to pull commits from others sources and merge them into mine so that my kernel will have those features. The main features I want for my kernel are: LZ4 ramdisk compression (as seen in jollaman's and rachanta's kernels), F2FS compatibility, Overclocking for both the big and little clusters, and a kernel tick rate of 100Hz. If it is not too much to ask could you please show me an example of how to merge at least one of these features into my source so that when I compile my kernel it will have the feature?
Click to expand...
Click to collapse
I can do overclocking because it is the easiest of those. Note that you will need some good git skills as well as fairly solid foundation of C to understand what is happening around the code when you run into conflicts.
1. Fetch the repo you want to get changes from (git fetch <url> <branch>)
Code:
git fetch https://github.com/Flash-Kernel/bullhead release-7.1.1
2. Find the commit hash you want to pick on Github and cherry-pick it
Code:
git cherry-pick e60c81d4839bb0f7efd3a79213467e7cbe77801d
3. If there are conflicts, it will make you resolved them first. You'll see conflict markers like so:
Code:
<<<<<<<<<< HEAD
STUFF THAT IS CURRENTLY THERE
==================
STUFF THAT IS EXPECTED TO BE THERE AFTER COMMIT
>>>>>>>>>>>>>
Sometimes, all the stuff that is currently there will be replaced by the stuff that is expected to be there. Other times, you'll have to be more fine about it and compare the diff on Github and see what is actually changing. It's a learned process, not really one that I can concretely teach.
Related
Hi all,
Following advices from the site I successfully compiled a custom kernel from sources, rebuilt boot.img and the ramdisk and flashed it on my S3: it works.
Now I want incrementally upgrade the Linux part using git and the sources at kernel.org, let say to patch the kernel on the disk with the linux online versions 3.0.50, 3.0.51 and so on up to the latest 3.0.100. Never used git before unfortunately
Can someone please point me to an example of the correct command-line to do that? From then on I'll sort the rest by myself, I promise, that would save me a lot of time and unnecessary troubles. Thank you very much.
PU
Look up "git-cherry-pick".
reS28raM said:
Hi all,
Following advices from the site I successfully compiled a custom kernel from sources, rebuilt boot.img and the ramdisk and flashed it on my S3: it works.
Now I want incrementally upgrade the Linux part using git and the sources at kernel.org, let say to patch the kernel on the disk with the linux online versions 3.0.50, 3.0.51 and so on up to the latest 3.0.100. Never used git before unfortunately
Can someone please point me to an example of the correct command-line to do that? From then on I'll sort the rest by myself, I promise, that would save me a lot of time and unnecessary troubles. Thank you very much.
PU
Click to expand...
Click to collapse
Look up "git merge". Also you have to add the tree from kernel.org.
Mine looks like such.
git merge linux/linux-3.4.y
CNexus said:
Look up "git-cherry-pick".
Click to expand...
Click to collapse
Hi mate, I am using your tools to build the images, thanks for that. I'll do
PwnCakes193 said:
Look up "git merge". Also you have to add the tree from kernel.org.
Mine looks like such.
git merge linux/linux-3.4.y
Click to expand...
Click to collapse
Thanks, I'll investigate both of your suggestions! Today it'll be a busy day.
reS28raM said:
Hi mate, I am using your tools to build the images, thanks for that. I'll do that
Thanks, I'll investigate both of your suggestions! Today it'll be a busy day.
Click to expand...
Click to collapse
No problem
You'll probably go with the suggestion after mine, git-cherry-pick is more to add one or a couple commits, rather than a whole mass of commits
Git-merge is for adding larger chunks of commits/merging branches, etc
almost compiled but one error????
make[1]: Nothing to be done for 'dtbs'
any solution...
and
zImage is not there. only "Image" and "Image.gz" present there
is "Image" is zImage? how to check that??
Thank you..
kernel source - Xiaomi mi4i official source
toolchain- NDK version 4.9
Ubuntu 64 bit?
[email protected] said:
OP
Click to expand...
Click to collapse
Change module to be y at defconfig
Also image it's the kernel
Image vs zImage ... You can google it
Also ,micode source code it's full of bugs
faizauthar12 said:
Change module to be y at defconfig
Also image it's the kernel
Image vs zImage ... You can google it
Also ,micode source code it's full of bugs
Click to expand...
Click to collapse
Yeah what he said. Checkout these repos if you need to compile a kernel:
http://gitlab.com/webhaikal/SenseiFerrari
http://github.com/Ferrari-Dev-Team/android_kernel_xiaomi_ferrari
haikalizz said:
Yeah what he said. Checkout these repos if you need to compile a kernel:
[url]http://gitlab.com/webhaikal/SenseiFerrari[/URL]
[url]http://github.com/Ferrari-Dev-Team/android_kernel_xiaomi_ferrari[/URL]
Click to expand...
Click to collapse
yeah i gone through your sensie kernel repo and found that i have to use dtbToolCM to make boot.img so i did it and stuck here...
DTB combiner:
Input directory: '/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/'
Output file: '/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dt.img'
Searching subdir: /home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/include/ ...
=> Found 0 unique DTB(s)
as i have read various threads but can not able to fix this. i have used dtbToolCm and dtbtool (version -3 and -2) also same result..
Really i should had not start making my first kernel with MI...
or it will make me learn more and more..
hahahaha:silly:
the easy steps to make a new kernel
use the entirely CM source code
then just type "make bootimage"
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? This thread is the place for support, nowhere else.
If you run into issues with using Substratum itself, ask in the main thread.
Great!
This is great!
wew...this is great bro
This is great!
Wow, great :laugh:
Awesome!
Awesome, build successfully. Thx.
Finding beautiful themes now.
通过我的 Mi 5s Plus 上的 Tapatalk发言
Great it can't be easier thn this.
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 ----------
akhilnarang said:
Great!
Click to expand...
Click to collapse
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.
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.
nareshnani142 said:
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.
Click to expand...
Click to collapse
You need to build for yourself, you cannot do this to an already compiled build.
Sachin ET said:
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.
Click to expand...
Click to collapse
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
I made my own manifest to build lineage with OMS here: https://github.com/DespairFactor/android
@cvxda @xamio
Sachin ET said:
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.
Click to expand...
Click to collapse
Bro lets wait our dev will do this for us,,,,
Thanks
[Thanks bro!!]
[¡Gracias, viejo!]
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
tywinlannister7 said:
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
Click to expand...
Click to collapse
Delete the file "sepolicy/themeservice_app.te" in your device tree. I removed CMTE's sepolicy as ours conflicts.
dont work with touchwiz roms or?
gtaelbordo said:
dont work with touchwiz roms or?
Click to expand...
Click to collapse
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
Preamble
Hey everyone!
Xiaomi JUST released their source on 17/5/17 for mm. THAT IS SO DAMN COOL, THE WAIT IS FINALLY OVER. You guys can expect a custom kernel from me sooner or later(i'm busy). However, if the custom kernel really comes out from me, it won't be on this thread. This thread will maintain active development though, repacks of other custom kernels!
What is a repack? A repack is essentially, in layman terms, porting a kernel. I can run a kernel for AEX on RRN and stuff like that, but please do take note that my repacks are tweaked towards battery life, while keeping some speed. I might add bonus scripts in future, but for now, i'm just trying to get this up and running.
Please flash at your own discretion. I try my best to test at every release, but sometimes i just don't have the time to do so. I have homework and revision and all,and i need sufficient sleep for growth(i'm 13) so just bear with me. I am NOT responsible for anything that happens with your device
Links
KernelsGit Repository
Source
- Stock MIUI Marshmallow Stable V8.2.5.0.MCFMIDL
- Stock MIUI Nougat Dev V7.5.19
Sauce released!
Requirements && Instructions
- TWRP
- Basic flashing skills
- A working human brain
- The will to void your warranty
Just flash the zip after flashing the rom. It'll do it's thing.
Features- Better battery life
- Snappier
- Runtime(Dalvik) optimisation
- Governor optimizations
- TCP tweaks
- 3G Tweaks
- Google DNS
- Faster internet
- Battery tweaks
- JIT as compiler
- Support both ipv4 && ipv6
- No ring delay
- Better voice quality
- GPU optimisation
- Faster boot
- 4 compile thread for dex2oat
- Better camera and image quality
- Purge assets(save battery)
- Logging and debugging disabled(save battery)
All these come from the tweaked ramdisks. All can be found on the git repo above.
Supported Roms- MIUI Marshmallow [V8.2.5.0.MCFMIDL]
- MIUI Nogat [V7.5.19]
- LineageOS 14.1
- Cypher OS V3.6.2
- AOSP Extended 4.2
- crDroidAndroid v3.1
- Android Ice Cold Project
- Xperia Open source Project(XSOP)
- DarkNess reDefined v1.5
- Resurrection Remix Nougat 5.8.3
More will be added based on requests and popularity
Credits
Jarius980 for teaching me how to do repacks and being cool
osm0sis for AIK
Lucas for being cool XDDD (Like the best tester and adviser ever)
CyanGreenMod for fixing the misplaced semicolon
Everyone who contributed/tested/supported
Notes
- WIpe dalvik cache and cache after flash, as dalvik's behavior and execution mode is changed
- Spot something wrong? Pull requests are always welcome!(just make sure you work on the latest upstream)
- Reporting bugs or failed boot are also contributions(VERY HELPFUL)
- Please attach log along with reports if possible
- Pre-release is available on git before release, go ahead and flash if you want
- Safetynet will still be intact since all modifications goes directly to the boot.img
- Thread is still under construction, it may look ugly for now
- NOT ALL THE RELEASES ARE STABLE, PLEASE DO A NAND BACKUP OF YOUR CURRENT BOOT
Thread rules
Do:
- You help one another
- You stay on-topic
- You READ and SEARCH
Don't:
- You do not demand
- You do not ask for ETAs
- You follow the RULES
Announcement:
Please report any issues with build #6
Changelog(please refer to git repo):
Build7:
Dalvik flags
Other tweaks and improvements
Base update
Firmware
Build6:
Update tweaks(dalvik and others)
Update base
Stabilisation
Clean dalvik cache && cache automatically
Build5:
Update tweaks(HUGE)
Fix setprop errors
Build4:
Hopefully fix all wifi issues
Update nogat base
Applied some tweaks
Build #3:
Support new roms (ACIP, RRN5.8.3, XSOP)
Wifi issues fixed for AEX
Build #2:
Fix wifi for some
Stabilisation checks
Build #1:
Compatibility build, so NA
Todo:
Take a huge break because of exams
Create build scripts(in meantime, manual is the only way out)
Dev Log:
[6/5/17]
-I'm too lazy to type it all out, just view my commits on git
[3/5/17]
- Added ACIP, RRN5.8.3, XSOP
- Update AEX Base
- Fix all wifi issues
(More detailed log look at git commits)
[1/5/17]
- Fix wifi for some
[30/4/17]
- Prerelease Build #1
- Complete compatibility checks
- Wrote update script
- Initialised git repo
- Added source unpacked boot files(ramdisk && split_img)
- Setup base and dependencies
Potential feature and support requests:
Known issues:
- Cast screen(Not kernel related unless explicitly proven)
FAQ:
How to NOT break safetynet?
- Just flash the build after the flashing the rom. You can flash mods like magisk and systemless supersu that does not modify /system
Why did i lose my root after flashing(SuperSU)?
- Because supersu patches boot.img and adds a script to start the SU daemon. Flashing a new boot.img will cause the script and patches to be overridden. Just flash the supersu zip again and everything will be reapplied
What can i report?
- After testing a build for a specific rom, you can state the rom your device is on, how old your device is, then the thing you wanna report. You can report failed boots, function bugs and SOT(battery)
Useful Links:
- Telegram Group Chat
https://t.me/joinchat/AAAAAEHQRgRmzU2eCxWK8w
- Whatsapp Group Chat
https://chat.whatsapp.com/7morKcwxExyAcc2deOoYu0
- Discord
https://discord.gg/HS8Ku
- Twrp 3.1.0-0
http://tinyurl.com/midotwrp
- Firmware
https://www.androidfilehost.com/?fid=817550096634766008
- LineageOS addons download
https://download.lineageos.org/extras
- OpenGapps
http://opengapps.org/
-BeanGapps
http://tinyurl.com/beangapps
Wanna donate?
I have to ask my mom again if she allows me to have her paypal donation link. But for now, i guess not
Got any examples of what can be added in? I assume it's mostly ramdisk related since the zImage can't be modified.
AutumQueen92 said:
Got any examples of what can be added in? I assume it's mostly ramdisk related since the zImage can't be modified.
Click to expand...
Click to collapse
yesh. and the ramdisk will be tweaked accordingly
like i can optimise governor values and stuff. the real development will start once sauce gets release(SAUCEEEEEE)
Edit: actually, ill just add this in OP
ala_mo said:
yesh. and the ramdisk will be tweaked accordingly
like i can optimise governor values and stuff. the real development will start once sauce gets release(SAUCEEEEEE)
Edit: actually, ill just add this in OP
Click to expand...
Click to collapse
Welp, is there any way to obtain the voltage values per frequency from there (Reading the values, not changing it)? I wanna read it and make a governor tweak.
AutumQueen92 said:
Welp, is there any way to obtain the voltage values per frequency from there (Reading the values, not changing it)? I wanna read it and make a governor tweak.
Click to expand...
Click to collapse
f im not wrong voltages are inside the kernel source, no way to change that if the kernel does not support it(its not by default)
Governor tweaks can be made. Values are found in init.qcom.rc
Whats rom this working?
Molniya said:
Whats rom this working?
Click to expand...
Click to collapse
Added in OP. I dont't want the first builds to fail, i need to go for class now. Will test myself tonight before release
Does it work on miui 8.2.2.0??
Prem2628 said:
Does it work on miui 8.2.2.0??
Click to expand...
Click to collapse
Miui MM is supported. will upload a build for this tonight.(10more hours) i will have to test before releasing since its the first build
Maybe this kernel will activate technology quick charge by Qualcomm? *Hopefully and I'll migration from Kenzo to Mido ?
Sent from my Redmi Note 3 using XDA Labs
NOS_bzone said:
Maybe this kernel will activate technology quick charge by Qualcomm? *Hopefully and I'll migration from Kenzo to Mido ?
Click to expand...
Click to collapse
QC requires kernel-side changes
AutumQueen92 said:
QC requires kernel-side changes
Click to expand...
Click to collapse
yeah...alot of stuff comes packaged if the kernel supports it(qc, voltage, more governers) but currently, the kernels from xiaomi are not meant for any customization, thus what i can do is to tweak whats currently in store. I cannot add features to the kernel now. I can only tweak the available features The real development starts when the sauce gets released
ala_mo said:
yeah...alot of stuff comes packaged if the kernel supports it(qc, voltage, more governers) but currently, the kernels from xiaomi are not meant for any customization, thus what i can do is to tweak whats currently in store. I cannot add features to the kernel now. I can only tweak the available features The real development starts when the sauce gets released
Click to expand...
Click to collapse
Heh, even with the kernel source I still can't add QC into my Xperia. It's a good thing the Note 4 has more devs. Also, are you experienced in kernel building?
The Carbon Rom that popped up last night listed Mido kernel sources, which I'm highly sceptical if it works. I just need someone to confirm since the OP isn't responding.
AutumQueen92 said:
Heh, even with the kernel source I still can't add QC into my Xperia. It's a good thing the Note 4 has more devs. Also, are you experienced in kernel building?
The Carbon Rom that popped up last night listed Mido kernel sources, which I'm highly sceptical if it works. I just need someone to confirm since the OP isn't responding.
Click to expand...
Click to collapse
from what i know, i suspect it's a partial source. That means that its not full, and there will be some limits
Pertaining to your first question, i can and will build kernels, but i will only do so in December, because my school projects require windows and linux would me more ideal compared to bash on win(always get that dpkg error)
where is the download link? oh, this is just pre-release?
Justin Timberlake said:
where is the download link? oh, this is just pre-release?
Click to expand...
Click to collapse
READ
ala_mo said:
from what i know, i suspect it's a partial source. That means that its not full, and there will be some limits
Pertaining to your first question, i can and will build kernels, but i will only do so in December, because my school projects require windows and linux would me more ideal compared to bash on win(always get that dpkg error)
Click to expand...
Click to collapse
Yeah, linux on windows is a pain. I ended up dual booting with Ubuntu and W10 too.
Introduction
Hello everyone, these are some arm and arm64 toolchains I have compiled using a script created by @USBhost and modified by @frap129 and me. I know the concept of toolchains is not a new one, as there have been many specialized/optimized variants. However, some people may want a pure/unaltered toolchain for certain projects. That's what this will be, a generic/simple toolchain configuration. These will be done on a semi-nightly basis. They have been tested on up to date Arch Linux and Ubuntu 17.04 systems. If you know how to use scripts or cross compile, feel free to skip straight to the downloads!
Configuration
The GNU (standard or unlabeled) toolchains are built from GNU's latest gcc-7-branch. The Linaro toolchains are compiled from the linaro-local/gcc-7-integration-branch branch.
These are the additional components:
Code:
binutils 2.29.1
gmp 6.1.2
mpfr 3.1.5
mpc 1.0.3
isl 0.18
bionic r15c
Latest Linux Kernel headers (7318413077a5141a50a753b1fab687b7907eef16)
These toolchains are statically linked so they should work on any 64-bit Linux system; let me know if there are any issues with this.
Build script
These were compiled with crosstool-NG, which is extremely versatile but a little complex for the average user. Instead, I offer a build script in this repo to compile very similar toolchains (they will not be statically linked but that's no issue if you are only compiling on your machine and they won't have bionic). It has been modified heavily from the original repo to support two different architecture configurations (more can easily be added upon request).
To learn more about the script, give the README a glance, as it will be more up to date than the thread.
Using the toolchains
Please see the README.
Issues?
If you run into any issues with either using or compiling these toolchains, please do one of the following:
Open an issue on Github. Use the toolchains repo for issues with using, use the script repo for issues with compiling.
Make a post on here.
In both cases, I will require a detailed explanation of your system configuration, what you are compiling, and a FULL terminal output; without these, your problem will be ignored.
Credits
@USBhost: For the initial script and permission to make this thread
@frap129: For his modifications to the script
@MSF Jarvis: For testing the arm option
@kantjer: For testing the Ubuntu versions on Linux Mint
Reserved
Great stuff
nice, thank you ?
Sent from my LGLS676 using Tapatalk
Dude it took me days to get arm to build because of weird errors and you just added a flag that builds it?
frap129 said:
Dude it took me days to get arm to build because of weird errors and you just added a flag that builds it?
Click to expand...
Click to collapse
Yeah, all I did was target arm-linux-gnueabi and build the arm Linux headers and everything compiled just fine.
So linaro or standard, what's recommended?
And what flags do you suggest to use for ROM and kernel?
Any support for x86/x86_64 platform?
neobuddy89 said:
So linaro or standard, what's recommended?
And what flags do you suggest to use for ROM and kernel?
Click to expand...
Click to collapse
I personally use Linaro given all the work they do for the arm architecture. These are the flag I use for my kernel. I'd love to claim credit for them but @kwoktopus helped me with most of them
zainifame said:
Any support for x86/x86_64 platform?
Click to expand...
Click to collapse
I do not currently plan on it but if there is enough demand I can consider it.
The Flash said:
I personally use Linaro given all the work they do for the arm architecture. These are the flag I use for my kernel. I'd love to claim credit for them but @kwoktopus helped me with most of them
I do not currently plan on it but if there is enough demand I can consider it.
Click to expand...
Click to collapse
Hope u support the x86/x86_64 platform
The Flash said:
I do not currently plan on it but if there is enough demand I can consider it.
Click to expand...
Click to collapse
X86_64 is theoretically already supported.
All you need to do is Target x86_64 and choose what version then done.
Like what was done for arm
USBhost said:
X86_64 is theoretically already supported.
All you need to do is Target x86_64 and choose what version then done.
Click to expand...
Click to collapse
True, I can add an option to the script. I assumed he was referring to the prebuilts
what's recommended? btw great stuff
Dreamstar said:
what's recommended? btw great stuff
Click to expand...
Click to collapse
I don't really recommend anything other than trying both variants and seeing which one you like.
Great stuff on XDA after a long time good work
Hi, can I use it to compile my rom based on LineageOS 14.1? I started to develop my own rom recently and now I wanted to try changing the toolchain.
zibiksior said:
Hi, can I use it to compile my rom based on LineageOS 14.1? I started to develop my own rom recently and now I wanted to try changing the toolchain.
Click to expand...
Click to collapse
Mostly will not be able to compile a ROM with this but give it a try. It for sure can compile the inline kernel.
Just a brief update, the build script still works perfectly fine but I will start compiling the provided toolchains with crosstool-NG as I can make the toolchains statically linked, meaning that they should work with all versions of Linux. It will also be easier for me to manage and tarballs will be smaller. I will try to have this done tomorrow, given Linaro just released their updated snapshot source
The Flash said:
Mostly will not be able to compile a ROM with this but give it a try. It for sure can compile the inline kernel.
Just a brief update, the build script still works perfectly fine but I will start compiling the provided toolchains with crosstool-NG as I can make the toolchains statically linked, meaning that they should work with all versions of Linux. It will also be easier for me to manage and tarballs will be smaller. I will try to have this done tomorrow, given Linaro just released their updated snapshot source
Click to expand...
Click to collapse
Ok, I undertstand can you instead point me some link with prebuild toolchains which I can use to compile my rom? I connot find any... Or meybe some manual how to compile appropriate version of toolchain?
20170520 toolchains are now uploaded!
As I mentioned before, they are compiled with crosstool-NG so that it's easier for me to update. Furthermore, the toolchains are much smaller now so they're easier to download and they're statically linked so they *should* work when any updated form of Linux. Let me know of any issues and enjoy!
Nice stuff indeed, thanks
Btw i've once been told that gnueabi and androideabi are slightly different, would it be okay to compile android kernels with gnueabi?