Backport Kernel for Xiaomi Mi A1 Based on CAF sources - Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De

After the liberation of the kernel by Xiaomi, and seeing what they have done, I have done a Backport of the kernel, over the CAF tag LA.UM.5.6.r1-04600-89xx.0.
You can see the backport code here:
https://github.com/mifl/android_[LIST] [/LIST]kernel_xiaomi_tissot.
You can see the Xiaomi original code here:
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/tissot-n-oss.
You can see the cm-14.1 code here:
https://github.com/mifl/android_kernel_xiaomi_tissot/tree/cm-14.1
Please: do not ask questions about Merges, Mods and Tweaks, because they will not be answered.
Greetings.

mifl said:
After the liberation of the kernel by Xiaomi, and seeing what they have done, I have done a Backport of the kernel, over the CAF tag LA.UM.5.6.r1-04600-89xx.0.
You can see the code here:
https://github.com/mifl/android_
kernel_xiaomi_tissot.
Greetings.
Click to expand...
Click to collapse
Does it build? I tried both yours and xiaomis and had a ton of errors

sooti said:
Does it build? I tried both yours and xiaomis and had a ton of errors
Click to expand...
Click to collapse
Please compile the kernel correctly.
You can get a compilation script in the following branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/build.
The original Xiaomi kernel and my Backport compile correctly using this script.
Greetings.

mifl said:
Please compile the kernel correctly.
You can get a compilation script in the following branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/build.
The original Xiaomi kernel and my Backport compile correctly using this script.
Greetings.
Click to expand...
Click to collapse
Script didn't work for me but I was able to build with your latest commits, cheers

Good work, thanks
It can be a very immortal device with the help of XDA
Sent from my Mi A1 using XDA Labs

sooti said:
Script didn't work for me but I was able to build with your latest commits, cheers
Click to expand...
Click to collapse
You can get the compilation script and apply it to your kernel source with this patch:
https://github.com/mifl/android_kernel_xiaomi_tissot/compare/build.patch

mifl said:
After the liberation of the kernel by Xiaomi, and seeing what they have done, I have done a Backport of the kernel, over the CAF tag LA.UM.5.6.r1-04600-89xx.0.
You can see the backport code here:
https://github.com/mifl/android_[LIST] [/LIST]kernel_xiaomi_tissot.
You can see the Xiaomi original code here:
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/tissot-n-oss.
Greetings.
Click to expand...
Click to collapse
Thank you very much! I appreciate your help.

@mifl kernel boots fine but can you point me to the needed commits for oreo? I can't seem to find the needed ones

sooti said:
@mifl kernel boots fine but can you point me to the needed commits for oreo? I can't seem to find the needed ones
Click to expand...
Click to collapse
The smartest thing, at the moment is to include all the commits that we can find from the caf or aosp sources, to reduce the initial commit "Kernel: Xiaomi kernel changes for Mi A1.". This will make the developers of LineageOS and others able to use these sources, and also make it easier to make a port to the CAF branch for Android Oreo.
This work I am starting to do now and will be uploaded to the branch of my kernel: "develop". This branch will be updated using force push, to reduce the aforementioned commit.
Greetings.

At the moment these are the changes I've found in caf or aosp sources, to reduce the initial commit "Kernel: Xiaomi kernel changes for My A1.":
https://github.com/mifl/android_kernel_xiaomi_tissot/compare/master...92c73b0
The final result can be seen in the branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/develop
Greetings.

mifl said:
At the moment these are the changes I've found in caf or aosp sources, to reduce the initial commit "Kernel: Xiaomi kernel changes for My A1.":
https://github.com/mifl/android_kernel_xiaomi_tissot/compare/master...92c73b0
The final result can be seen in the branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/develop
Greetings.
Click to expand...
Click to collapse
any kernel made for stock (8.0) with some mods
eg enabled Qcomm fast charge battery tweaks cpu throttling
etc? looking forward to it thanks ?

Nice job there! :highfive:
And thank you Xiaomi, for making devs work more harder than what they should have.
Sent from my Redmi Note 4 using XDA Labs

@mifl Can we use your modified kernel source to build Lineage OS, or does it need some modifications?
---------- Post added at 07:03 AM ---------- Previous post was at 06:59 AM ----------
[/COLOR @mifl Can we use this kernel to build Lineage 14.1 or does it require some more edits?

mifl said:
At the moment these are the changes I've found in caf or aosp sources, to reduce the initial commit "Kernel: Xiaomi kernel changes for My A1.":
https://github.com/mifl/android_kernel_xiaomi_tissot/compare/master...92c73b0
The final result can be seen in the branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/develop
Greetings.
Click to expand...
Click to collapse
Ya those look like the same commits I tried... I have no problem getting the kernel to boot but the data is encrypted... What am I missing?
---------- Post added at 09:51 AM ---------- Previous post was at 09:48 AM ----------
mifl said:
At the moment these are the changes I've found in caf or aosp sources, to reduce the initial commit "Kernel: Xiaomi kernel changes for My A1.":
https://github.com/mifl/android_kernel_xiaomi_tissot/compare/master...92c73b0
The final result can be seen in the branch:
https://github.com/mifl/android_kernel_xiaomi_tissot/commits/develop
Greetings.
Click to expand...
Click to collapse
I'm still at the same place as before... the kernel boots find (did also before) but the data is encrypted... What am I missing?

Isn't the tissot kernel source already based off LA.UM.5.6.r1-04600-89xx.0? It's obviously based on LA.UM.5.6.r1 coz Android 7.1.2 msm8953_64. Don't let the comment on the squashed commit fool you otherwise.

Sorry guys xda wasn't working for me hence it's showing multiple posts. Mod please remove duplicate posts like this one

Duplicate

Sorry guys xda wasn't working for me hence it's showing multiple posts. Mod please remove duplicate posts like this one

bgos10 said:
Isn't the tissot kernel source already based off LA.UM.5.6.r1-04600-89xx.0? It's obviously based on LA.UM.5.6.r1 coz Android 7.1.2 msm8953_64. Don't let the comment on the squashed commit fool you otherwise.
Click to expand...
Click to collapse
Xiaomi destroyed commit history on the released source, by squashing even the tags used as the base over an older, LA.UM.5.3-06310-89xx.0, as a single "Xiaomi kernel changes for Mi A1." commit.
Probably you've to run git diff HEAD~1 at least once and see what it mostly changed.
Sent from my Redmi Note 4 using XDA Labs

@Uvneshkumar. The kernel is open source, you can use this like you want.
Greetings.

Related

[ABANDONED]FIXED/MODIFIED][KERNEL][16 JULY] franco.Kernel | 2.6.35.10

So I compiled franco's kernel with his sources at github with incoming call fix from CM with other improvements. All Credit goes to franciscofranco who was so kind to compile this kernel even-though he has other devices, and also other developers for all these patches included in the kernel.
I decide what I want not you. No means no, if you ask me to add *insert feature here* IF I consider it useless etc etc
Also one thing to note that it doesn't have :
* (Since franco didnt release his sources for it)
Doubled busses frequencies - system will go faster but you'll possible lose some overclocking capabilities. Busses frequency OC > cpu OC.
* Your megaduper governors (people failed to realise that tuned stock governors(or they can tune them themselves) have almost same performance with smartass etc)
Click to expand...
Click to collapse
Changelog - other changes are in my source
#12 http://www.mediafire.com/?vdm3xs1hdjuh7ju
- revert "conservative from 3.2 kernel", use .38 kernel version instead (works correctly now)
- revert back to .35 cpuidle
- use latest linaro toolchain for fun and testing
Click to expand...
Click to collapse
Sources:https://bitbucket.org/cresqo/2.6.35.10-p500
Cresqo said:
So I compiled franco's kernel with his sources at github with incoming call fix from CM. Also one thing to note that it doesn't have :
If all goes well I'll update the kernel with camera flicker bug fix, 652, 672, 691, 710 cpu frequencies, recent LCD patch and maybe the bluetooth sleep bug fix
So here's the link: http://www.mediafire.com/?zi2k8yp7ilvpibc
I need tests on this. (camera and incoming calls)
Also white noise is back as expected.
Click to expand...
Click to collapse
Well done!
Sent from my LG-P500 using xda premium
Just updated the kernel with latest linaro toolchain and other things
Great job!
Why not move it to the Development section if you are planning on improving this kernel?
Sent from my LG-P500 using xda premium
RockR172 said:
Great job!
Why not move it to the Development section if you are planning on improving this kernel?
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
Well once I figure out how the heck do I use git (need help here)
Btw, this kernel with fix feels a bit faster than franco #3, but I don't think is nowhere near the speed of #4
nice, but why not compiled franco's kernel #4 ? why #3 ?
Edit: did u added Added tun.ko and cifs.ko ?
GonDr said:
nice, but why not compiled franco's kernel #4 ? why #3 ?
Edit: did u added Added tun.ko and cifs.ko ?
Click to expand...
Click to collapse
There are no sources for #4...
Sent from my LG-P500 using xda premium
Cresqo said:
Well once I figure out how the heck do I use git (need help here)
Btw, this kernel with fix feels a bit faster than franco #3, but I don't think is nowhere near the speed of #4
Click to expand...
Click to collapse
What kind of help do you need?
GonDr said:
nice, but why not compiled franco's kernel #4 ? why #3 ?
Edit: did u added Added tun.ko and cifs.ko ?
Click to expand...
Click to collapse
Added I guess, idk if working
DJNoXD said:
What kind of help do you need?
Click to expand...
Click to collapse
It sounds like a noob question, but how do you add alot of files as once and commit them, do I have to manually do it or do I need to use a git GUI like git-cola?
Cresqo said:
It sounds like a noob question, but how do you add alot of files as once and commit them, do I have to manually do it or do I need to use a git GUI like git-cola?
Click to expand...
Click to collapse
I did not find a gui (for linux) that I like. Therefor I only use the console git.
Adding all filles at once:
Code:
git add .
Commit all changed / modified / added files at onces:
Code:
git commit -a
Commit all changed / modified / added files at onces and set commit message (no editor opens).
Code:
git commit -a -m "my commit message"
Cresqo said:
So I compiled franco's kernel with his sources at github with incoming call fix from CM with other improvements. All Credit goes to franciscofranco who was so kind to compile this kernel even-though he has other devices. Also one thing to note that it doesn't have :
Click to expand...
Click to collapse
Dear Cresqo,
Please go thru following link it may be helpful to extract .config file from Franco kernel #4
Link:
http://droid-force.com/archive/index.php/thread-184.html
This what the thread says:
There is a simpler way to get the basic .config file, and this is to get it from a running kernel built by someone else. You can extract the .config from a running kernel with these commands:
Code:
cd ~/android/kernel/bravo_2.6.35_gb-mr
adb pull /proc/config.gz
zcat config.gz > .config
Now we can open menuconfig and add anything we need in addition.
Note: I think "bravo_2.6.35_gb-mr" is the working folder \ Home directory on PC
Cresqo said:
compiled with latest GCC 4.7.1 Linaro toolchain
Click to expand...
Click to collapse
Do you notice any advantages compiling kernel by using linaro toolchain?
Kanad said:
Dear Cresqo,
Please go thru following link it may be helpful to extract .config file from Franco kernel #4
Link:
http://droid-force.com/archive/index.php/thread-184.html
This what the thread says:
There is a simpler way to get the basic .config file, and this is to get it from a running kernel built by someone else. You can extract the .config from a running kernel with these commands:
Code:
cd ~/android/kernel/bravo_2.6.35_gb-mr
adb pull /proc/config.gz
zcat config.gz > .config
Now we can open menuconfig and add anything we need in addition.
Note: I think "bravo_2.6.35_gb-mr" is the working folder \ Home directory on PC
Click to expand...
Click to collapse
Honestly I don't think it will work and my .config is quite OK actually...so the only way is to ask Franco for it since he didn't enable the option for the config to be in config.gz
DJNoXD said:
Do you notice any advantages compiling kernel by using linaro toolchain?
Click to expand...
Click to collapse
Hmm, tough question, maybe a little smooth, maybe, but i'll revert as soon as there is any bug associated with it (didn't encounter static sound bug so far, perhaps it's due to compiling the ROM with linaro toolchain)
Btw i'm uploading my sources to bitbucket(though all changes are not visible as i've already modified the files and i'm lazy and don't have that much time to do it again...)
Cresqo said:
Btw i'm uploading my sources to bitbucket(though all changes are not visible as i've already modified the files and i'm lazy and don't have that much time to do it again...)
Click to expand...
Click to collapse
I'm curious about to see your sources.
DJNoXD said:
I'm curious about to see your sources.
Click to expand...
Click to collapse
My sources: https://bitbucket.org/cresqo/2.6.35.10-p500
Though the commits are wrong(was messed up with an earlier source from last time)
Cresqo said:
My sources: https://bitbucket.org/cresqo/2.6.35.10-p500
Though the commits are wrong(was messed up with an earlier source from last time)
Click to expand...
Click to collapse
Is your repo private?
DJNoXD said:
Is your repo private?
Click to expand...
Click to collapse
Oops sorry didn't know I enabled the option, just disabled it.
You have added lots of temp files, which (I think) you don't wont to upload (e.g. all *.o files).
Add a gitignore file to your repo and those files will be ignored.
DJNoXD said:
You have added lots of temp files, which (I think) you don't wont to upload (e.g. all *.o files).
Add a gitignore file to your repo and those files will be ignored.
Click to expand...
Click to collapse
Eh...gitignore file is gone...will recommit it again
Sorry Cresqo, i haven't repplied your PM cause i had exams... now two biggest exams now is gone! I've finished it! Now I can do everythings i want: learn C, C++, play badminton , play games, compile ROM or kernel ...
Love Tyn!

[KERNEL] [KEXEC] Kernel EXECution for locked devices [N900V] [WIP]

THIS THREAD IS WIP & FOR DEVELOPERS ONLY !
Technical information with sources & binaries is in post #2. It includes kernel building, kexec-module, kexec-tools, hijack script, required patches & current problems with logs.
Click to expand...
Click to collapse
What is kexec?​--------------------------------------------------------------------------------------------------------​
kexec or kernel execution is a module/mechanism of the kernel that allows live/hot booting of a new/custom kernel "over" the currently running kernel. For more info, read the useful threads/links bellow.
kexec could be used to load a custom kernel into memory & yes, we'll then be able to install AOSP ROMs or in general run a custom kernel compatible with our device.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Updates:​--------------------------------------------------------------------------------------------------------​
[09/01/2014]:​
kexec module has been successfully patched & loaded/inserted into both NC2 & NC4 stock kernels. Now, I'm working on compiling/loading a guest kernel & fixing possible problems/bugs.
Click to expand...
Click to collapse
[08/31/2014]:​
Two versions of HLTEVZW KK kernel have been compiled from source: one uses the default configurations & the 2nd adds custom capabilities & kexec boot options. Moreover, kexec-tools & module have been cross-compiled. Now, I'm working on patches for kexec module & guest kernel (the hardest part).
Click to expand...
Click to collapse
[08/01/2014]:​
I've successfully flashed a custom kernel on my device. This trips knox flag & isn't 100% related to kexec, but it has the same objective (loading custom kernel on the locked-bootloader devices). However, the bootloader makes security check & blocks the installed kernel with the "unauthorized software by VZW" warning. Then, I tried to patch the bootloader to remove this security check, but my device was HARD BRICKED. Now, I've created a General thread for how to recover from a HARD BRICK. This is promising info for testing bootloader exploits.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
​​
Status
--------------------------------------------------------------------------------------------------------​
Supported NC2 & NC4 kernels
Working kexec-tools
Loaded kexec module
WIP kexec/guest kernel​
Click to expand...
Click to collapse
Thanks to / Credits:
--------------------------------------------------------------------------------------------------------​
@sextape - for the leaked NC2 firmware
@Hashcode - for his great work on kernel/recovery
...
Please PM me if I forgot to add proper credits for your work!​
Click to expand...
Click to collapse
​
XDA:DevDB Information
KEXEC, Kernel for the Verizon Samsung Galaxy Note 3
Contributors
hsbadr, CalcProgrammer1, ryanbg
Kernel Special Features:
Version Information
Status: Testing
Created 2014-07-11
Last Updated 2015-02-15
Technical Information
This post is reserved for technical information with sources & binaries. This includes kernel building, kexec-module, kexec-tools, hijack script, required patches & current problems.
Kernel Building:
--------------------------------------------------------------------------------------------------------​
The first step for building working kexec-module & tools is to cross-compile the kernel from source with the correct configurations. I won't describe how to build a kernel from source, but you may find this thread very useful.
I've used two different sources for the NC4/NC2 HLTE_VZW KK kernels. The 1st one is a part of SM-N900V_NA_KK_Opensource.zip released by Samsung for N900V NC4 kernel while the 2nd is available on @Hashcode's Github profile with 3 branches: hltevzw-kk-nc2 branch is modified for N900V NC2 kernel + 15 commits for compiling kexec as a module & other kexec patches.
The instructions provided by Samsung to build the NC4 kernel are to update CROSS_COMPILE toolchain environment variable in the Makefile & build with the default configurations as follows:
Code:
export ARCH=arm
make VARIANT_DEFCONFIG=msm8974_sec_hlte_vzw_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig
make
However, I've patched the sources & used menuconfig interface to customize kernel configurations as follows:
Code:
export ARCH=arm
make VARIANT_DEFCONFIG=msm8974_sec_hlte_vzw_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig menuconfig
make
(menuconfig is added in the second line)
The default output is the kernel image (arch/arm/boot/zImage) & modules (drivers/*/*.ko). The kexec-module(s) will be built if you patched the sources & configured it as a module.
You may then use dtbTool to generate device tree dt.img & mkbootimg to pack the kernel in boot.img.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Kexec Module:
--------------------------------------------------------------------------------------------------------​
There're many different flavors of kexec-mod sources. @delewer in this thread uses a standalone kexec-mod source MOD'd for Sony Xperia Z1 to be cross-compiled against the precompiled kernel source while @Hashcode in his sources on Github patches the kernel source to cross-compile kexec-mod with the kernel. Some modules may or may not use/port the hardboot patches. The output for kexec module/drivers have different names (the standalone kexec-mod source generates kexec_load.ko & procfs_rw.ko while the kernel source patched by @Hashcode generates 3 modules: arm_kexec.ko, msm_kexec.ko & kexec.ko).
To test if the cross-compiled modules are loadable & have the correct kernel headers, use insmod in terminal emulator (or a safe point with terminal like Safestrap) to insert the module into the kernel (assuming you've kexec.ko in /system/lib/modules/):
Code:
insmod /system/lib/modules/kexec.ko
Then, use lsmod to list & show the status of loaded modules:
Code:
lsmod
Alternatively, you may check if system call of the kernel includes kexec functions using:
Code:
cat /proc/kallsyms | grep kexec
The kexec-modules I've compiled are loadable & have been successfully inserted into both NC4 & NC2 kernels.
I'm using my own sources for kexec-module based on others & I'll share the sources with binaries & modules after making some required tests.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Kexec Tools:
--------------------------------------------------------------------------------------------------------​
I'm using the latest version of kexec-tools from here (currently, kexec-tools-2.0.8.tar.gz) cross-compiled for arm with custom configurations. Three binaries are generated including kexec (directly boot into a new kernel) & kdump (display kernel trace data). For more info, check the manpage of each binary & kexec/kexec-tools manuals/guides.
To test your kexec-tools cross-compiled binaries for arm,
Code:
kexec --help
assuming that they're in your PATH (e.g., /system/xbin) with executable permissions (e.g., 755).
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Hijack Script:
--------------------------------------------------------------------------------------------------------
will be updated soon...​
Click to expand...
Click to collapse
Required Patches:
--------------------------------------------------------------------------------------------------------
will be updated soon...​
Click to expand...
Click to collapse
Current Problems/Logs:
--------------------------------------------------------------------------------------------------------
will be updated soon...​
Click to expand...
Click to collapse
Sent from my SM-G900V using Tapatalk
jr_718 said:
Sent from my SM-G900V using Tapatalk
Click to expand...
Click to collapse
My eyes about popped out the side of my head when I saw this! It says your in testing have you had any luck at all? Thank you thank you thank you BTW!
amebiasis said:
My eyes about popped out the side of my head when I saw this! It says your in testing have you had any luck at all? Thank you thank you thank you BTW!
Click to expand...
Click to collapse
I've tested several binaries for the same kernel version, but none works for now. I'll compile from source & see. However, please keep this this thread for devs discussions only until we release working kexec & guest kernel.
Trying to keep the n3 alive before the n4 arrives? Lol seriously though congrats and thank you. Hope you and the devs here the best of luck. We, the re owners, appreciate all you have done already for us.
bmwh0r3 said:
Trying to keep the n3 alive before the n4 arrives? Lol seriously though congrats and thank you. Hope you and the devs here the best of luck. We, the re owners, appreciate all you have done already for us.
Click to expand...
Click to collapse
Note 4 is useless until it gets root & custom ROMs. For me, it'll be better ONLY IF we can break its security & unlock bootloader!
What about surge & ryanbg and e.v.a. I been following them and they both have a good idea on how things work well I think they are good for the job
Just a thought I had when unlocking my spare RAZR hd, but the kernels on the Razr and my note 3 are 3.4.97 and 3.4.0. Is the exploit part of the kernel or is there a reason I'm a user and not a Dev? If it is, motopacalypse.apk is what unlocked my RAZR. I'm just trying to learn so please don't think I'm a moron. I just don't know the coding aspect of android at all.
Have you got an irc or hangout open for discussion?
Thanks for your efforts! !
tpike said:
Have you got an irc or hangout open for discussion?
Thanks for your efforts! !
Click to expand...
Click to collapse
There is #Galaxy-Note-3 on Freenode but it's really quiet in there most of the time.
Many forum lurkers like me have been anxiously waiting for this breakthrough! Don't give up! I also believe in donating to hardworking devs like you guys! Good luck...
I was an owner of a Motorola Defy and the day that it got KEXEC I was so exited.. so good luck for you guys! Nothing is impossible. :victory:
Feche said:
I was an owner of a Motorola Defy and the day that it got KEXEC I was so exited.. so good luck for you guys! Nothing is impossible. :victory:
Click to expand...
Click to collapse
Who was devs on kexec on defy?
ironfisted said:
Who was devs on kexec on defy?
Click to expand...
Click to collapse
Not sure
I've been working on kexec for a little while now with limited success. My biggest problem is the getting the 4 byte CRCs for the kernel symbols used by the kexec module. Same with a few other projects I'm working on. They compiled the NC2 kernel with MOD VERSION and CRC. I've compiled it from source, but there's so much work to be done my head is spinning.
ryanbg said:
I've been working on kexec for a little while now with limited success. My biggest problem is the getting the 4 byte CRCs for the kernel symbols used by the kexec module. Same with a few other projects I'm working on. They compiled the NC2 kernel with MOD VERSION and CRC. I've compiled it from source, but there's so much work to be done my head is spinning.
Click to expand...
Click to collapse
Good luck! Lots of us are waiting for this!
ryanbg said:
I've been working on kexec for a little while now with limited success. My biggest problem is the getting the 4 byte CRCs for the kernel symbols used by the kexec module. Same with a few other projects I'm working on. They compiled the NC2 kernel with MOD VERSION and CRC. I've compiled it from source, but there's so much work to be done my head is spinning.
Click to expand...
Click to collapse
Keep it up man, I understand the hard work involved in doing something like this, but it will definitely pay of in the end!!! Thank you for your hard work and dedication, you got a lot of people counting on you
Sent from my BajaRom "L" Themed Note 3
ryanbg said:
I've been working on kexec for a little while now with limited success. My biggest problem is the getting the 4 byte CRCs for the kernel symbols used by the kexec module. Same with a few other projects I'm working on. They compiled the NC2 kernel with MOD VERSION and CRC. I've compiled it from source, but there's so much work to be done my head is spinning.
Click to expand...
Click to collapse
I see. Let me know if you'd like to contribute to this thread. I'll update it soon with more details about the required patches & the preliminary results of my tests ––after releasing a new version of JasmineROM.
ryanbg said:
I've been working on kexec for a little while now with limited success. My biggest problem is the getting the 4 byte CRCs for the kernel symbols used by the kexec module. Same with a few other projects I'm working on. They compiled the NC2 kernel with MOD VERSION and CRC. I've compiled it from source, but there's so much work to be done my head is spinning.
Click to expand...
Click to collapse
I was told by a defy dev that we would have better luck contacting hp touch pad kernel devs. I guess their kernel is more like ours I guess. Idk. I never tried contacting dev from their yet

Guide for Building Custom Kernel XPERIA E1

This is not my work this a reply i got from a guy when i posted in the sony developers forum ...I hope someone finds this useful:angel: .And since i m a new user i can post links for some stupid reasons...so i will get creative
by fzort
Kernel source for the Xperia E1 is available as a tarball on the "Xperia open source archives" site. I'm running a custom-built kernel on my Xperia E1 (D2114). I documented what I did here:
[https://
github.com
/mpersano
/xperia-e1-kernel-patches
/blob
/master
/README.md]
https://github.com/mpersano/xperia-e1-kernel-patches/blob/master/README.md
This is for KK or JB4.3?
Since im starting development for this device, idk much and i not read actual progress. @Kizoky you can resume progress for me?
Caio99BR said:
This is for KK or JB4.3?
Since im starting development for this device, idk much and i not read actual progress. @Kizoky you can resume progress for me?
Click to expand...
Click to collapse
This is for KK kernel, but I couldn't not build kernel because I'm still a rookie
Camera drivers exists for MSM8610(Xperia E1's chipset) on sonyxperiadev Github
Recovery exists (you can find PhilZ recovery in this forum)
what is still missing is a working Device tree, and vendor libs (and of course a cm compatible kernel)
Kizoky said:
This is for KK kernel, but I couldn't not build kernel because I'm still a rookie
Camera drivers exists for MSM8610(Xperia E1's chipset) on sonyxperiadev Github
Recovery exists (you can find PhilZ recovery in this forum)
what is still missing is a working Device tree, and vendor libs (and of course a cm compatible kernel)
Click to expand...
Click to collapse
Ok, but for now a kernel working in Stock is good, so how i can unpack boot.img?
Enviado de meu E435 (L3 II Dual) usando Tapatalk
Use this:
Zsenyka said:
Use this:
Click to expand...
Click to collapse
Edited: The Bootloader is locked, so the boot.img is "Encripted", and no way to unpack this, i will unlock this.
Ok, i changed boot.img, now i have CWM from boot, and bootsrap.
I tried to boot it, but this get bootloop, the bootanimation is loaded but bootloop, maybe dt.img.
I cant access dmesg command. @Kizoky any tip?
---------- Post added at 10:44 PM ---------- Previous post was at 10:44 PM ----------
https://github.com/Caio99BR/android_kernel_sony_falconss
Caio99BR said:
Ok, i changed boot.img, now i have CWM from boot, and bootsrap.
I tried to boot it, but this get bootloop, the bootanimation is loaded but bootloop, maybe dt.img.
I cant access dmesg command. @Kizoky any tip?
Click to expand...
Click to collapse
Hi! I'm the owner of the github repo mentioned at the top of this thread.
Getting a working ramdisk took me a while. I think that what finally worked was downloading an official firmware image with XperiFirm (you don't even need to wait for it to finish downloading the full image - one of the first files downloaded is the kernel one, containing boot.img), then I extracted boot.img with the unofficial XPERIA flash tool, then extracted the ramdisk. (The kernel command line I used is the same one in the official boot.img, by the way.) As for the device tree image, you can build it from the kernel sources.
Note that boot.img on this phone has a device tree blob appended to the end. I wrote a small script to unpack the official boot.img and compare it to the one that I built and check if I was doing everything right (can't post links as I'm a new user, but it's linked in the README.md file linked above).
I'll try to add more details to those instructions when I have some time (I didn't think anyone else would be interested in building a kernel for this cheap phone ). By the way, I use the E1 with a custom kernel as my main personal phone and it works fine (for a 512M phone), kudos to Sony for not compromising the quality of even their lowest end model.
I think everyone is interested in making this phone better
Since July 2014 we tried porting Cyanogenmod without success, now last year we modified a Moto E ROM and made it work with E1, only the ril is not working
So sad that Sony didn't made this phone even better
So the device tree is located in the ramdisk?
Kizoky said:
I think everyone is interested in making this phone better
Since July 2014 we tried porting Cyanogenmod without success, now last year we modified a Moto E ROM and made it work with E1, only the ril is not working
So sad that Sony didn't made this phone even better
So the device tree is located in the ramdisk?
Click to expand...
Click to collapse
The device tree is located after the ramdisk in boot.img, but you can build it from the kernel sources provided by Sony. The `msm8610-v2-mtp.dtb` make target will build the device tree blob. Then mkqcdtbootimg will build a boot.img containing kernel + ramdisk + device tree blob. The only thing that you need for this which is not provided by Sony (well, other than more detailed build instructions...) is a ramdisk image, I had to extract it from the stock firmware...
If you want to split boot.img into kernel / ramdisk / device tree, you can use this script: github.com/mpersano/bootimg-tools/blob/master/split-bootimage.py
Good luck!
fzort said:
The device tree is located after the ramdisk in boot.img, but you can build it from the kernel sources provided by Sony. The `msm8610-v2-mtp.dtb` make target will build the device tree blob. Then mkqcdtbootimg will build a boot.img containing kernel + ramdisk + device tree blob. The only thing that you need for this which is not provided by Sony (well, other than more detailed build instructions...) is a ramdisk image, I had to extract it from the stock firmware...
If you want to split boot.img into kernel / ramdisk / device tree, you can use this script: github.com/mpersano/bootimg-tools/blob/master/split-bootimage.py
Good luck!
Click to expand...
Click to collapse
I've been trying to get that script work like ages
Does it require Linux, or just Python?
EDIT: nvm, I figured it out
So is CM for E1 finally possible or just custom kernel?
@fzort @Kizoky i make this booting with the stock dt blob (device tree means the Android Device Tree, and this is totally diff, use "dt blob")
See my changes in https://github.com/Caio99BR/android_kernel_sony_falconss
Ah, only with msm8610-v2-mtp.dtb this works too, i tested after.
("I not reply more earlier because the phone is from my father and yesterday ran out of energy.")
The ramdisks works and dt blobs too.
The screenshot
Caio99BR said:
@fzort @Kizoky i make this booting with the stock dt blob (device tree means the Android Device Tree, and this is totally diff, use "dt blob")
See my changes in https://github.com/Caio99BR/android_kernel_sony_falconss
Ah, only with msm8610-v2-mtp.dtb this works too, i tested after.
("I not reply more earlier because the phone is from my father and yesterday ran out of energy.")
The ramdisks works and dt blobs too.
The screenshot
Click to expand...
Click to collapse
I saw you are doing the device part of E1 too
If you need any help just ask me (or tests)
Kizoky said:
I saw you are doing the device part of E1 too
If you need any help just ask me (or tests)
Click to expand...
Click to collapse
Ok man, im trying to do kernel fully working (solved problem of dt blobs. We cant pack qrd dt, so comment build of then), and zip easy flashing, but not working at moment, my father will get crazy when him try to play FM Radio.
After i will merge code to a CAF Linux Kernel, so this is more easy to update.
By last finish the Android Device Tree with a E1 Caf Kernel.
I will try to post the custom kernel.
Im thinking in VeeSSKernel (Since my kernel of L3II is VeeKernel), what do you think?
Enviado de meu E435 (L3 II Dual) usando Tapatalk
Caio99BR said:
Ok man, im trying to do kernel fully working (solved problem of dt blobs. We cant pack qrd dt, so comment build of then), and zip easy flashing, but not working at moment, my father will get crazy when him try to play FM Radio.
After i will merge code to a CAF Linux Kernel, so this is more easy to update.
By last finish the Android Device Tree with a E1 Caf Kernel.
I will try to post the custom kernel.
Im thinking in VeeSSKernel (Since my kernel of L3II is VeeKernel), what do you think?
Enviado de meu E435 (L3 II Dual) usando Tapatalk
Click to expand...
Click to collapse
Would be really great
We still don't have a custom kernel (only Stock kernel with PhilZ)
I can't wait to see it
Kizoky said:
Would be really great
We still don't have a custom kernel (only Stock kernel with PhilZ)
I can't wait to see it
Click to expand...
Click to collapse
We have a problem, the TV is not working anymore, idk why
I will check it, we need TV Support working, or i need it, since my father use it
EDIT: The problem is inside kernel or ramdisk.
it's amazing .. Very good work .. Congratulations friends??
racer.z said:
it's amazing .. Very good work .. Congratulations friends����
Click to expand...
Click to collapse
@Kizoky TV is fixed
Edit: THANKS, i forget ever
---------- Post added at 10:59 PM ---------- Previous post was at 10:19 PM ----------
I will try to release tomorrow, since i want to make a new banner, based on my old VeeKernel banner.
For CM i will need to redownload CAF Kernel MSM (since im stupid and overwrited .git in tests).
I will start building TWRP (V3), merging it to stock ramdisk and update to make cwm and twrp side-by-side.
So i have done this in two weeks for make a custom kernel, thanks @fzort
Enviado de meu E435 (L3 II Dual) usando Tapatalk

Xiaomi kernel open source for MI Max!

https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/hydrogen-m-oss
Although the source tree name is hydrogen-m-oss, MI's staff Ivan says hydrogen and helium shares the same kernel source.
is this for real?? man I can't believe my eyes,this means real development, more ROMs...maybe I should stop dreaming and have some expert confirm,
@nijel8
 @ajsmsg78
:good:
Hmm hope it's the real deal..
Sent from my MI MAX using XDA-Developers mobile app
laolang_cool said:
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/hydrogen-m-oss
But seems only hydrogen source is released
Click to expand...
Click to collapse
Yes its kernel source for hydrogen (android M kernel).
Now we can have better CM13 and roms based on it.
And we can compile android N also.
Confirmed with Santosh M sir (compiled android N for redmi note 3 first).
I am very much noob at compiling, lets hope developers come up with great things.:good:
Nice to hear it, if it is true...
I hope Helium will coming soon.
小米Max*全网通版*3GB/64GB*银色 - Resurrection Remix 5.7.4 build 6.10.28 by ajsmsg78
Yep it's out... Too bad I can't do anything for two more months...
Looking forward to AOSP or slim for max. too bad only hydrogen's source is out, mine is helium...
Hmmm, i will back ?
nijel8 said:
Yep it's out... Too bad I can't do anything for two more months...
Click to expand...
Click to collapse
how come?
please more roms for xiaomi max hydrogen KERNEL SOURCE IS OUT
I asked MI's staff who is also rom developer Ivan, he says hydrogen and helium shares a same kernel source.
laolang_cool said:
I asked MI's staff who is also rom developer Ivan, he says hydrogen and helium shares a same kernel source.
Click to expand...
Click to collapse
That's probably true looking at the config files... The max cpu's are set to 8.
BTW I managed to build it after fixing some compile errors but it doesn't boot... I guess .config needs tweaking but I am not a kernel expert ... Also /arch/arm64/boot/dts/qcom directory is missing and to get it to compile I had to borrow stuff from /arch/arm/boot/dts/qcom which probably is wrong... Anyway no success...
nijel8 said:
That's probably true looking at the config files... The max cpu's are set to 8.
BTW I managed to build it after fixing some compile errors but it doesn't boot... I guess .config needs tweaking but I am not a kernel expert ... Also /arch/arm64/boot/dts/qcom directory is missing and to get it to compile I had to borrow stuff from /arch/arm/boot/dts/qcom which probably is wrong... Anyway no success...
Click to expand...
Click to collapse
Ivan confirmed helium uses the same config file hydrogen_user_defconfig, and no file is missing... dts in arm64/ and arm/ linked to a same directory.
This is incredible news! Fingers crossed this will lead to some great new ROMs!
Let's hope this leads to some custom kernels
It quits with
Code:
drivers/video/msm/msm_dba/msm_dba.c:25:30: fatal error: msm_dba_internal.h: No such file or directory
for a weird reason here. The file is there, but it quits.
Edit: It works after changing #include <msm_dba_internal.h> to #include "msm_dba_internal.h" in msm_dba.c, but just like nijel8 stated it won't finish because of dts.
TEKME said:
It quits with
Code:
drivers/video/msm/msm_dba/msm_dba.c:25:30: fatal error: msm_dba_internal.h: No such file or directory
for a weird reason here. The file is there, but it quits.
Edit: It works after changing #include <msm_dba_internal.h> to #include "msm_dba_internal.h" in msm_dba.c, but just like nijel8 stated it won't finish because of dts.
Click to expand...
Click to collapse
Copy /arch/arm/boot/dts folder to /arch/arm64/boot/ and /include/dt-bindings to /arch/arm64/include keeping all already existing files(don't overwrite) and it will compile but without cpu_ctl.ko and wifi.ko modules.
nijel8 said:
Copy /arch/arm/boot/dts folder to /arch/arm64/boot/ keeping all already existing files(don't overwrite) and it will compile but without cpu_ctl.ko and wifi.ko modules.
Click to expand...
Click to collapse
From Ivan: cpu_ctl.ko is private. And wifi.ko doesn't exist in kernel/, it's in vendor/qcom/opensource/wlan/ , so MI doesn't release their module source(will not in the future I think...)
We need to get the wifi module source from qcom i.g. https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-2.0/, but not sure if max uses qcald-2.0 or not.
Is it possible to use Kenzo sources to fill in the gaps? I swapped my Kenzo for a Hydrogen and I'm loving this huge phone, although MIUI is still a bit clunky. The Nougat AOSP and CM ROMs for Kenzo are pretty much ready for daily use, with camera support and VoLTE being a bit buggy right now.
Both Kenzo and Hydrogen devices use msm8952 with fpc1020 fingerprint sensors, I'm not sure about the camera sensors though.

[REFERENCE] Pixel kernel source with linux-stable (3.18.124)

Introduction
Hello everyone, this is a thread to introduce both users and kernel developers to the concept of linux-stable as well as give developers some tips and a tree to either merge into their own, use as a base, or just as a reference. Feel free to ask questions and enjoy!
What is it?
linux-stable is, as the name implies, the stable branch of the Linux kernel, the base of Android. The phone could not run without the Linux kernel (at least not without reworking a lot of stuff). The Android kernels are based on the longterm stable trees:
Longterm
There are usually several "longterm maintenance" kernel releases provided for the purposes of backporting bugfixes for older kernel trees. Only important bugfixes are applied to such kernels and they don't usually see very frequent releases, especially for older trees.
Click to expand...
Click to collapse
Source: https://www.kernel.org/category/releases.html
All Linux development happens on the master branch, which is governed by Linus Torvalds. When issues are discovered there, the fixes are applied then backported to these various stable trees for consumption. It is not uncommon for a fix to need to go back a few years.
There is a LOT more information available in the notes repo in the android-linux-stable organization if you care to learn more in-depth: https://github.com/android-linux-stable/notes
What does this mean for me?
If you are a developer, this means you should be merging these changes into your own tree. These are vetted, stable fixes to real world problems and they are being handed out for free. It does not take long to get up to date (as you can just merge this tree directly into your own or do it yourself using the tree as a reference) and once you are up to date, there is usually a release once every two weeks, give or take. I provide a rebuttal to a lot of various complaints here. If you still feel like there is a good reason not to do this, please let me know, I'll be happy to try and debate on it!
If you are a user, it means that you should be looking for and using kernels that have these fixes, as it shows the developers care for your security and stability. The current version for this device is 3.18.100 and the current version upstream is 3.18.124 so all you need to do is go into Settings > About phone and look at the kernel version to know if you are up to date.
How do I use?
If you are a developer, the reference tree is located in the android-linux-stable organization: https://github.com/android-linux-stable/marlin
This can either be merged into your existing kernel tree if you have one or be used as a fresh base. You do not need my permission to use it nor do you need to give me credit (although it would be appreciated).
If you are a user, use a kernel that has the changes added in!
Getting notified about updates
There are a few ways to get notified of linux-stable updates:
The linux-kernel-announce mailing list: http://vger.kernel.org/vger-lists.html#linux-kernel-announce
The android-linux-stable Telegram channel: https://t.me/alsupdates
Subscribe to this thread
Follow me on Google+ or Twitter
Getting help
If you have any issues with getting these changes into your tree or want to ask a question, there are a few different ways to do it:
Post in this thread
Join the linux-stable support chat on Telegram: https://t.me/joinchat/C1UAJ1EMSX31PCFdwLnOSg
File an issue either in the android-linux-stable notes repo or the android-linux-stable repo for this device
When requesting help, please give some solid details as to what you are struggling with, as I am happy to provide assistant and clarity but not to do something for you (unless I screwed up).
3.18.88 has been merged in.
3.18.89 has been merged in.
3.18.90 has been merged in.
3.18.91 has been merged in (conflict notes).
Hi Nathan, thanks for the code - built the kernel and flashed (wasn't easy at first). All working well, will use it at a later stage when I build the ROM. BTW, I am running the factory image. Credit also to Anykernel for the zip file
GeyerA said:
Hi Nathan, thanks for the code - built the kernel and flashed (wasn't easy at first). All working well, will use it at a later stage when I build the ROM. BTW, I am running the factory image. Credit also to Anykernel for the zip file
Click to expand...
Click to collapse
Not a Dev, but totally would like to give this a try if you have a zip. On the factory image + twrp 3.2.1
Sent from my [device_name] using XDA-Developers Legacy app
Hi, No problem. There you go... Just flash in TWRP and feedback if all went ok
3.18.92 has been merged in.
Hi, thanks for the code, compiled it against linaro 6.4 (built the cross-compiler following your thread). Tested for one day. All smooth. Sharing the job for those who might be interested. BTW, flashed it directly from fastboot....
Code:
fastboot flash kernel Image.lz4-dtb
Hi, added WireGuard support.
@ nathanchance, sorry, do not mean to hijack your thread...
GeyerA said:
Hi, added WireGuard support.
@ nathanchance, sorry, do not mean to hijack your thread...
Click to expand...
Click to collapse
No worries lol, gives it some life :silly:
Sent from my Pixel 2 XL using XDA Labs
GeyerA said:
Hi, added WireGuard support.
@ nathanchance, sorry, do not mean to hijack your thread...
Click to expand...
Click to collapse
Running this now, so far so good! Thanks!
Definitely interested in wire guard, but currently use WindScribe and am not sure how to properly configure it.
Will try and Frankenstein a config file together tonight and report back [emoji106]
Thanks again
Sent from my [device_name] using XDA-Developers Legacy app
Hi, question. Added DSPManager to my ROM and see that it always gets killed. Can you support the idea to build the kernel with
Code:
CONFIG_SECURITY_SELINUX=n
. Will this get me the kernel permissive and any disadvantages with this? I also see that Viper4android needs a permissive kernel.
3.18.93 has been merged in.
Somebody willing to do a build of the update to flash with fastboot?
I would if I could (still learning how to build myself)
Thnx in advance.
Cheers
Sent from my Google Pixel using XDA Labs
Sgace said:
Somebody willing to do a build of the update to flash with fastboot?
I would if I could
Thnx in advance.
Cheers
Sent from my Google Pixel using XDA Labs
Click to expand...
Click to collapse
Was just going to ask if someone could point me to a good resource on how to do so. Will post anything I manage to do [emoji106]
Sent from my [device_name] using XDA-Developers Legacy app
jimbub said:
Was just going to ask if someone could point me to a good resource on how to do so. Will post anything I manage to do [emoji106]
Click to expand...
Click to collapse
Hi,
I used this for the most part: https://forum.xda-developers.com/yureka/help/guide-compiling-64-bit-android-kernel-t3352728
And this:
https://forum.xda-developers.com/an...-how-to-compile-android-kernel-t3627297/page1
Was very helpful and am building right now
Credits to those guys offcourse.
Sent from my Google Pixel using XDA Labs
Sgace said:
Hi,
I used this for the most part: https://forum.xda-developers.com/yureka/help/guide-compiling-64-bit-android-kernel-t3352728
And this:
https://forum.xda-developers.com/an...-how-to-compile-android-kernel-t3627297/page1
Was very helpful and am building right now
Credits to those guys offcourse.
Sent from my Google Pixel using XDA Labs
Click to expand...
Click to collapse
If it's ok, here is my personal first ever self built kernel from source. It's 3.18.93 and flashable in fastboot (unzip the zip and then: fastboot flash kernel Image.lz4-dtb)
Offcourse thnx to @nathanchance for the source and all the work!
Cheers
Sgace said:
If it's ok, here is my personal first ever self built kernel from source. It's 3.18.93 and flashable in fastboot (unzip the zip and then: fastboot flash kernel Image.lz4-dtb)
Offcourse thnx to @nathanchance for the source and all the work!
Cheers
Click to expand...
Click to collapse
Thanks for doing this, very much appreciate it! For some reason though, this prevented my phone from booting. Ended up restoring my boot partition and things are well now!

Categories

Resources