[DEV][TEMPLATE] Kerneller - Modify Ramdisk, dt, zImage, and SELinux on the fly - Sony Cross-Device General

༼ つ ◕_◕ ༽つIn the name of our great lord Helix!༼ つ ◕_◕ ༽つ
Kerneller, a flashable Zip template for ramdisk modifications
Google what a kerneller is​
Many of you have no doubt heard of osm0sis' Anykernel2 and previously koush's Anykernel. Kerneller is an alternative designed solely around Sony's Xperia lineup, taking into account the 'recovery-inside-ramdisk' situation we've found ourselves in. However, the script should also support other devices such as Nexus. (I say should because I can only test on the Xperia devices I own -- if anyone could help test, I would be very grateful!)
And with the release of Android 5.0 Lollipop, users have been facing a dilemma: To download a permissive or enforcing version of the kernel? Kerneller fixes that issue by combining the two in a single zip using a slightly modified version of keycheck, allowing the user to choose what will be installed at the time of flashing.
Source: https://github.com/someone755/kerneller
Any questions, tips, or comments are welcome!
Credits & Thanks: All authors of the included binaries. osm0sis for AnyKernel2 and porting the binaries. koush for the original AnyKernel concept. Everyone who helped test. Myself5 for the inspiration and oshmoun for the help.
XDA:DevDB Information
Kerneller, Tool/Utility for the OEM Cross Device Development
Contributors
someone755
Version Information
Status: Stable
Created 2015-12-26
Last Updated 2015-12-31

This is something, i was expecting.
Thank you very much.

Black_Eyes said:
This is something, i was expecting.
Thank you very much.
Click to expand...
Click to collapse
I'm glad you like it but I can't say that's the reaction I was expecting lol. Please do let me know if anything bothers you though.
Just by the way, I moved the thing into its own repo and added a small script to compress and sign it. Cheers!

work for lock or un lock?thank you

xsj said:
work for lock or un lock?thank you
Click to expand...
Click to collapse
I'm sorry to say I don't understand the question. This script cannot lock or unlock anything.
It modifies the boot sector of your device. For that to be possible in the first place, you need an unlocked bootloader.

thank you,Im lockbootloader now,and that's what I want to know

Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.

mariosenta said:
Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.
Click to expand...
Click to collapse
Your best bet would be using 'git clone', though you can also just download the whole repo as a zip file (here, if you're having trouble finding it). Note though that the packing script won't work in Windows unless you have a *nix shell emulator (such as Cygwin or win-bash)!
You can still zip the thing together yourself using 7zip or WinRAR, however it will not be a signed zip (so some recoveries -- like Cyanogen Recovery -- may refuse to flash it, but you could use the bash script to figure out what you have to do in Windows to sign your new zip).
If you do eventually get it to run, I'd be very glad if you could send me the recovery.log of the flash via PM!

TouchWiz?
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works

Pavan l said:
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works
Click to expand...
Click to collapse
I don't know if your device's boot image is assembled using mkbootimg (like Nexus devices). If so, you may be able to.
But you'll need to pack the device tree binary and zImage into the zip (just use unpackbootimg).

So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?

HaoZeke said:
So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?
Click to expand...
Click to collapse
It's not really meant for people who compile ROMs, but more for kernel devs or testers who only compile the kernel.
Instead of always having to extract the ramdisk from boot images (whenever the ramdisk changes, which we kernel people can't know and check for every single kernel, nor do we care) and then using mkbootimg (meaning you have to release one boot image for every ramdisk you need to support, i.e. if you want to support ROMs with vastly different ramdisk implementations, where mixing ramdisks would cause a bootloop).
With this, you go around the problem. Compile the kernel outside of the ROM tree (which takes a few minutes vs several hours that compiling the entire ROM can take), grab the zImage-dtb (or adjust the script to use zImage + dt.img), and package the thing together. (There are options to also include kernel modules in the zip, and scripts that will compress and sign the zip for you.)
The highlight of this project used to be being able to switch Selinux status when flashing the zip, instead of adding androidboot.selinux=permissive for each boot image, and then uploading two images. Nowadays compatibility of this switch with various devices and Android versions is questionable (I can't test personally because of how limited Xperia devices have become recently -- the 3.10 kernel does not work with enforcing selinux), but the core idea of using it to avoid having to create boot images is still alive and kicking.

Related

[Devs] Looking for a kernel base to work with? Start here.

Hello!
I'm hoping to get custom kernel & rom development up and running quickly for the G5 community, and have created a git repository which provides a kernel source base to start with.
What I've done is taken the v10a release sources and modified them to work with build directories and multiple variants. (should they be unlocked or receive the CodeFire treatment at any time)
Here's where to start: https://github.com/jcadduono/nethunter_kernel_g5/tree/stock-6.0
If you'd like a somewhat updated kernel, the stock-6.0.y branch will be patched from Linux 3.18.y branch at kernel.org, see:
https://github.com/jcadduono/nethunter_kernel_g5/tree/stock-6.0.y
Different from the absolute stock defconfigs, I've made the following changes:
Module signature verification disabled
Unnecessary debugging flags separated into debug_defconfig (use EXTRA_DEFCONFIG=debug_defconfig to enable them)
Flags that were previous set to module (=m) have been set to =y (built-in) in case incompatibilities are unable to load stock modules
Each known variant & target is listed in build.sh comments. The default variant when building with ./build.sh is h850 with debugging disabled.
When using the Makefile, VARIANT_DEFCONFIG=variant_xxx_defconfig adds the additional settings per variant to the target defconfig. (by default stock_defconfig)
build.sh is set up to automatically build a dtb.img after creating the kernel Image.gz based on whichever variant you've built for.
You can use ./menuconfig.sh to modify the stock defconfig, or you can copy the stock_defconfig to another name such as my_defconfig and use TARGET=my ./menuconfig or TARGET=my ./build.sh
It's easier to just set the default target in build.sh/menuconfig.sh - each have their configuration options near the top of the files.
Be sure to edit the config variables in build.sh and menuconfig.sh before using. The VERSION file gets appended to the kernel version shown in `uname` when using build.sh.
The toolchain must be pointed to the correct location before it can build. Be sure to have libncurses5-dev and colordiff packages installed for menuconfig.sh.
For a toolchain, I recommend using the GCC Linaro aarch64 5.3 2016.02 release. You can use basically any aarch64 toolchain though.
Download here: https://releases.linaro.org/compone...o-5.3-2016.02-x86_64_aarch64-linux-gnu.tar.xz
You can start by forking my repository on GitHub and giving it your own name if you like. Extra interesting commits are available in the other branches that you should be able to cherry-pick without issues should you be interested in them.
Looking to test your kernel Image.gz + dtb.img?
Look no further than my LazyFlasher repository!
See here: https://github.com/jcadduono/lazyflasher/tree/kernel-flasher
Simply do:
Code:
git clone -b kernel-flasher https://github.com/jcadduono/lazyflasher.git kernel-flasher
cd kernel-flasher
cp /path/to/Image.gz /path/to/dtb.img ./
make
(simply place your kernel Image.gz (optional) and dtb.img (optional) in the root of the repository and type make!)
And you'll have your own dynamic kernel flashing zip for custom recoveries!
The kernel-flasher repository is capable of great things. You can create scripts in patch.d to do anything you like.
Add files to the ramdisk-patch folder and create a script that copies them into the $ramdisk folder and they will be rebuilt into the ramdisk!
By default, no-verity-opt-encrypt is there as an example.
Using setprop in patch.d scripts allows you to set props in default.prop with ease.
Add functions to patch.d-env to make them globally usable across patch.d scripts.
See other branches for more examples, like how to add f2fs lines to the fstab, or patch for system mode SuperSU.
LazyFlasher is the installer used in the Kali NetHunter project. You can also find more examples in the kali-nethunter GitHub!
Good luck, and happy kernel developing!
Thanks so much for posting this.
Code:
./obligatoryn00bstatement
Sorry for not being too knowledgeable here (yet?) and if this sort of comment doesn't belong.
I am a Computer Science major who really wants to learn some skills to hopefully give back to the community.
Is this an area that I could be of use or should I perhaps spend more time going through material on the XDA-U site?
toefurkey said:
Thanks so much for posting this.
Code:
./obligatoryn00bstatement
Sorry for not being too knowledgeable here (yet?) and if this sort of comment doesn't belong.
I am a Computer Science major who really wants to learn some skills to hopefully give back to the community.
Is this an area that I could be of use or should I perhaps spend more time going through material on the XDA-U site?
Click to expand...
Click to collapse
I'm a little tired and somewhat intoxicated here at 3:45 AM so this is going to be a bit of rambling and so on...
While it's certainly a good idea to study up on what interests you before digging into it, sometimes it really can be easier just to dive in to your hobby.
I'm a high school drop out, never made it through college. Everything I've learned is by taking the great work done by the open source community and reading their code and applying it to other projects. That's the great thing about open source and nonrestrictive licenses. Everything is there for you to figure out, make changes, borrow code, run into problems, and the best part - search for solutions that others have already provided in their struggle to do exactly what you're doing.
Have an idea for a great feature? You can probably find it already implemented in another kernel somewhere.
Find the work someone else has done and modify it to fit your needs, but don't forget to give them credit for their work that you've used!
If you're going to start writing your own code, be certain to keep it tidy and variables/functions with meaningful names and comments so that not only others can understand and learn from it, but that you can return to the same code later on and understand it. Confusing code is how bugs tend to show up and become almost impossible to squash.
What I'm trying to get across here is don't be afraid to not be original. Don't be afraid to use others work to accomplish what you want, so long as they receive some attribution. The quickest way to learn how things work is by understanding what's already there and available to you.
You'll notice that there's projects all over XDA with special features ported from one device to another. Isn't it great having the all the best features people have added to other devices on one really nice device that you have?
PS I've never been on the XDA-U site before, so I can't give an opinion there.
I forgot what I was on about so I'll end this here lol.
?jcadduono you're on fire man thank you for everything you've been doing so far with such little resources.
Sent from my LG-H820 using XDA-Developers mobile app
jcadduono, thanks for the info and wonderful words of wisdom!
I totally agree on what you're saying and my goal is to try diving into this as a hobby. The hardest part for me isn't so much the coding part, but just figuring out a starting point to get grounded and build upon and I feel like what you've provided here is perhaps the starting point I need. Now it's just up to me to push myself in my free time.
Hi, i am new to kernel developing, but i did some roms myself before, so no total linux noob.
I cloned your 6.0.y and want to start from there, but im a little bit lost. Do i need to follow the steps @ github, or is your branch kinda pre setup ?
Toolchain path is also set to the one you gave a link too.
Pinu'u said:
Hi, i am new to kernel developing, but i did some roms myself before, so no total linux noob.
I cloned your 6.0.y and want to start from there, but im a little bit lost. Do i need to follow the steps @ github, or is your branch kinda pre setup ?
Toolchain path is also set to the one you gave a link too.
Click to expand...
Click to collapse
Hopefully once the toolchain path is set you should only need to run ./build.sh to actually build the kernel and dtb.
You may be missing some items for menuconfig.sh, which should just be solved by apt-get install colordiff libncurses5-dev
If building inside a ROM tree, it should be fairly simple for developers to adjust their ROM configs to add more to the kernel make command line, such as VARIANT_DEFCONFIG.
No matter what i do, kernel builds, but no dtb.img will be created. Any ideas where to look / what to test ?
I have stock-6.0.y, and did the h850 one.
Hi, is the stock-6.0.y branch removed?
I didnt find it. and need the right defconfig
greetz
mericon

Sources

I'm here to question the device owner. There are few sources around about this device. They are raw and they are as common always experimental. Does anyone need them?
Furthermore, I can sum up here any sources I or other get to find about this device or its periphery.
If you are eager to Void your Warranty please Mind and Acknowledge that every modification only affects you and your contract and noone else.
custom rom
http://forum.xda-developers.com/xperia-xa/development/f3112-f3116-cyanogemod-13-project-t3488890
Silversniper said:
I'm here to question the device owner. There are few sources around about this device. They are raw and they are as common always experimental. Does anyone need them?
Furthermore, I can sum up here any sources I or other get to find about this device or its periphery.
Click to expand...
Click to collapse
Very good thing, I'm trying to build a CM13 rom from sources and I'm not sure if I have all required sources. For now I have, kernel sources with some "vendor" files from Sony and I found all build parameters like offsets/adresses and correct cmdline (no thanks to Sony because never released or mentioned them), the device tree dumped from my device, and I will dump the vendor tree too.
Now I need the defconfig for CM (very not sure if the stock one will work) , and some files like the boardconfig and some config files. I'm using the Elephone P9000 sources for sample, almost the same device (hardware side) and source files.
If I have some time I will try to upload files to git but I never tried before (sync only)...
rrvuhpg said:
Very good thing, I'm trying to build a CM13 rom from sources and I'm not sure if I have all required sources. For now I have, kernel sources with some "vendor" files from Sony and I found all build parameters like offsets/adresses and correct cmdline (no thanks to Sony because never released or mentioned them), the device tree dumped from my device, and I will dump the vendor tree too.
Now I need the defconfig for CM (very not sure if the stock one will work) , and some files like the boardconfig and some config files. I'm using the Elephone P9000 sources for sample, almost the same device (hardware side) and source files.
If I have some time I will try to upload files to git but I never tried before (sync only)...
Click to expand...
Click to collapse
Don't need to hesitate. I'll try to put the directions I've gathered here up today so it is done.
I finished to upload my files to Github:
https://github.com/rrvuhpg
You will find the device, kernel and vendor files to build CM13 for F3112/F3116. For now it will not work, it's just to share and help. I successfully built and booted the Cyanogen recovery with the kernel from sources, the doors for porting new roms are open?? :fingers-crossed:
My next step is to finish the device tree, verify the vendor tree and build the rom
rrvuhpg said:
I finished to upload my files to Github:
https://github.com/rrvuhpg
You will find the device, kernel and vendor files to build CM13 for F3112/F3116. For now it will not work, it's just to share and help. I successfully built and booted the Cyanogen recovery with the kernel from sources, the doors for porting new roms are open?? :fingers-crossed:
My next step is to finish the device tree, verify the vendor tree and build the rom
Click to expand...
Click to collapse
cool.. if work I would like to have it on my f3111 !!
rrvuhpg said:
I finished to upload my files to Github:
https://github.com/rrvuhpg
You will find the device, kernel and vendor files to build CM13 for F3112/F3116. For now it will not work, it's just to share and help. I successfully built and booted the Cyanogen recovery with the kernel from sources, the doors for porting new roms are open?? :fingers-crossed:
My next step is to finish the device tree, verify the vendor tree and build the rom
Click to expand...
Click to collapse
Can you publish some brief preview?
Need to say the sources I had just seem to be down, so can't share them.
Through which Program are these to flash? If you're that far I can hold a look at it and may join in your development.
Verification of the Vendor Files is something I was not very good at it, not even a yolk I managed.
Silversniper said:
Can you publish some brief preview?
Need to say the sources I had just seem to be down, so can't share them.
Through which Program are these to flash? If you're that far I can hold a look at it and may join in your development.
Verification of the Vendor Files is something I was not very good at it, not even a yolk I managed.
Click to expand...
Click to collapse
For now the only preview I can publish are the CM13 boot and recovery "as is", I'm not sure if it can help but I will release them if someone want to port others MTK Roms on XA. ( Never booted any ported rom with the stock kernel, stuck at Sony logo)
Flashing is easy: the recovery with fastboot and Rom/boot in a single flashable zip on the SD.
The kernel sources are coming from 33.2.B.2.95 open source archive from Sony but built from the lastest CM13 and Google git sources.
The vendor tree from 33.2.B.2.93 dumped from my phone, only common files with the P9000 are on my git for now.
The device tree from P9000 sources (from @Deepflex git) but seem OK.
CM13 have Android 6.0.1, I don't know if the security patch is the last one but August for sure.
I'm not so far from a finished build (not mean fully bootable), for now I successfully build a full CM13 for the Elephone P9000 (the twin of the XA, I'm using it as base). It mean my "kitchen" is working Now I'm trying to identify the last proprietary files from all others stock/cm13 libs, modify make files and cross my fingers it will fully build without errors.
You can join me no problem all people are welcome because I can't do all alone
rrvuhpg said:
For now the only preview I can publish are the CM13 boot and recovery "as is", I'm not sure if it can help but I will release them if someone want to port others MTK Roms on XA. ( Never booted any ported rom with the stock kernel, stuck at Sony logo)
Flashing is easy: the recovery with fastboot and Rom/boot in a single flashable zip on the SD.
The kernel sources are coming from 33.2.B.2.95 open source archive from Sony but built from the lastest CM13 and Google git sources.
The vendor tree from 33.2.B.2.93 dumped from my phone, only common files with the P9000 are on my git for now.
The device tree from P9000 sources (from @Deepflex git) but seem OK.
CM13 have Android 6.0.1, I don't know if the security patch is the last one but August for sure.
I'm not so far from a finished build (not mean fully bootable), for now I successfully build a full CM13 for the Elephone P9000 (the twin of the XA, I'm using it as base). It mean my "kitchen" is working Now I'm trying to identify the last proprietary files from all others stock/cm13 libs, modify make files and cross my fingers it will fully build without errors.
You can join me no problem all people are welcome because I can't do all alone
Click to expand...
Click to collapse
good work , but I am noob to create rom with kitchen .. only zip edit I know
Yesterday I successfully built CM13 for XA from sources
But news are not good, the CM recovery is fully working as expected but the rom is stuck just after the Sony logo (Mediatek screen with "loading...") like on my previous attempts to port other roms. The kernel built from CM kitchen do the same... I will upload my git and my rom to see if someone have an idea on the problem. Now I will focus on the "vendor" files, but I'm not sure if it's the real problem. Can it be a locked preloader/kernel or something like that?
EDIT: I think the boot problem is related to the defconfig file from Sony kernel sources, I will try to change some settings. (the door for adding kernel features :good
rrvuhpg said:
Yesterday I successfully built CM13 for XA from sources
But news are not good, the CM recovery is fully working as expected but the rom is stuck just after the Sony logo (Mediatek screen with "loading...") like on my previous attempts to port other roms. The kernel built from CM kitchen do the same... I will upload my git and my rom to see if someone have an idea on the problem. Now I will focus on the "vendor" files, but I'm not sure if it's the real problem. Can it be a locked preloader/kernel or something like that?
EDIT: I think the boot problem is related to the defconfig file from Sony kernel sources, I will try to change some settings. (the door for adding kernel features :good
Click to expand...
Click to collapse
Love you!
I will buy this phone thanks to you :highfive:
Thank you for your work on our phone, it's very cool.
I would have helped if i could develop myself. If you need help get in touch with me i know some great devs who could maybe help you
any news @rrvuhpg ?
Yes I have some news but I want to create a dedicated thread for the CM13 project with updates, explanations and downloads to avoid off topic here. I am on holiday on next week and I will have time to work on it and give explanations. For now I'm stuck on boot because of Sony extra settings in the boot process, it's the first time I see a bootstrap and TA partition mount on a MTK device. If you know a dev for helping me passing the Sony part in the boot init it can be great :angel:
Other thing, I updated my git with parts of the update made by @Deepflex on the P9000 sources and my recent changes.
rrvuhpg said:
Yes I have some news but I want to create a dedicated thread for the CM13 project with updates, explanations and downloads to avoid off topic here. I am on holiday on next week and I will have time to work on it and give explanations. For now I'm stuck on boot because of Sony extra settings in the boot process, it's the first time I see a bootstrap and TA partition mount on a MTK device. If you know a dev for helping me passing the Sony part in the boot init it can be great :angel:
Other thing, I updated my git with parts of the update made by @Deepflex on the P9000 sources and my recent changes.
Click to expand...
Click to collapse
sorry first time I use sony ... I wish you to have nice holiday !

[Solved][help] from custom kernel developers

Regarding this thread https://forum.xda-developers.com/moto-g4-plus/development/kalilinux-nethunter-t3639411
The OP tywinlannister did not patch the kernel source code with Android USB HID PATCH To use the Android device as keyboard or mouse..This should be applied for nethunter ROM, But he didn't..
And I asked resurrection remix ROM maintainer Jleeblanch for Athene to look at this issue he did it , after applying the patch it didn't successfully compile ,there were errors..By seeing the error he said that the official kernel is partially patched already,so it is causing those errors..
If anybody looks into the problem it would be appreciated just in your free time only ...
The link to kernel source of Jleeblanch is the "Kali branch" https://github.com/Jleeblanch/android_kernel_motorola_msm8952
Any problem or suggestions regarding to this can be discussed here itself , that others can address the issue..
I too have been waiting for a working kernel so I am going to attempt to compile a working kernel with hid with my limited kernel development knowledge. I think it probably won't work as two far better devs than me have yet been unable however I will try anyway
Any help from fellow devs would be greatly appreciated
Dougleplex said:
I too have been waiting for a working kernel so I am going to attempt to compile a working kernel with hid with my limited kernel development knowledge. I think it probably won't work as two far better devs than me have yet been unable however I will try anyway
Any help from fellow devs would be greatly appreciated
Click to expand...
Click to collapse
I am also a newbie to kernel development but I manually patched the hid sources to kernel source..
But when we complied it all those errors.
First I think we should delete all those hid patches all applied to the stock kernel source. Then compile it and then apply the patch by pelya...
My ROM s kernel developer say MM kernel will be easy but it is also partially patch
You may give it a try
Dhanush-raj said:
I am also a newbie to kernel development but I manually patched the hid sources to kernel source..
But when we complied it all those errors.
First I think we should delete all those hid patches all applied to the stock kernel source. Then compile it and then apply the patch by pelya...
Click to expand...
Click to collapse
I'm going to attempt to patch jleeblanch's rr kernel and then work backwards depending on the errors as last time I did something like this (s7 edge nethunter kernel) the error was a corrupted source and could easily have been fixed by finding a different repository rather than starting from scratch (what we did). I'm unsure as to what will happen after that however your idea is just as valid and I will try straight after (if you haven't already)
Test this kernel
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Kernel version 3.10.105 was initially the kernel I tried patching. I was easily able to merge the patch, but compiling it was a different story. According the errors I got, a lot of thing we're duplicated. I told the guy above that the MM based kernel (3.10.84 - which is the same version for MM thru Nougat on stock) would probably be the best bet. Looks like you had little trouble at all with merging into your Invicta Kernel (which is also kernel version 3.10.84).
Good job and thank you [emoji41]
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Thanks @Silesh.Nair I have been waiting long time for this patch. Once again thank you sir...
The patch is working perfectly in 3.10.105 i.e jleeblanch kernel source..
Linux version 3.10.107-lineageOS ([email protected]) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #1 SMP PREEMPT Sat Aug 5 04:20:04 PDT 2017
And thank you @Jleeblanch Also
boot tool
Silesh.Nair said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Code:
git clone https://github.com/LineageOS/android_kernel_motorola_msm8952.git
cd android_kernel_motorola_msm8952
git checkout cm-14.1
git remote add invicta https://gitlab.com/sileshn/android_kernel_motorola_athene.git
git fetch invicta
git cherry-pick 04aa0b10521b76e57226b2d1633e2b91cfa40263
If you don't get errors, you are good to go. If it errors, it needs more changes.
Click to expand...
Click to collapse
Hey which tool did you used to make boot.img.
Marella ram_youtubr said:
Note that this is the Invicta kernel. You need a revert before the actual patch. Both commits are available on my gitlab.
Merged both into a single commit. Note that Invicta kernel is still 3.10.84. Upstream kernels may need additional changes. Test and let me know.
If you want to apply the patch to your kernel, you can use the attached patch file or use the commands below. ( using lineage kernel as example )
Hey which tool did you used to make boot.img.
Click to expand...
Click to collapse
I am using lazyflasher
https://github.com/jcadduono/lazyflasher
Just clone this repo and place the zimage in there and type make, you will get a zip file. Just flash it through twrp recovery. Because only the kernel is changed , so i am just replacing the zimage. No need of unpacking and repacking of boot image.:good:
i have compiled a zimage from kali_defconfig from above source.but when i flased it to phone the phone is not booting.
I NEED A FIX FOR THIS
Marella ram_youtubr said:
i have compiled a zimage from kali_defconfig from above source.but when i flased it to phone the phone is not booting.
I NEED A FIX FOR THIS
Click to expand...
Click to collapse
Which toolchian did you use, and what kernel source and rom you are using .
Give me as detailed information as possible!
Dhanush-raj said:
Which toolchian did you use, and what kernel source and rom you are using .
Give me as detailed information as possible!
Click to expand...
Click to collapse
Kernel Source:-https://github.com/Jleeblanch/android_kernel_motorola_msm8952/tree/kali-nougat
toolchain:- https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 nougat-release
rom:- lineage 14.1 official
Marella ram_youtubr said:
Kernel Source:-https://github.com/Jleeblanch/android_kernel_motorola_msm8952/tree/kali-nougat
toolchain:- https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 nougat-release
rom:- lineage 14.1 official
Click to expand...
Click to collapse
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Dhanush-raj said:
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Click to expand...
Click to collapse
thanks buddy
Dhanush-raj said:
Don't use that source it isn't patched correctly, although i said mr. Jleeblanch to try , so he created it. The hid patch is merged into his resurrected kernel, but for mac injection i dont remember. So you better start from the first.
Use lineage kernel source and apply the patch from this thread #6th post, and see what toolchain is used to build lineage 14 kernel and use it. And additionally you have to make some changes in the defconfig, which is explained in the kali-nethunter github page.
Click to expand...
Click to collapse
sileshn has removed his source
Marella ram_youtubr said:
sileshn has removed his source
Click to expand...
Click to collapse
https://forum.xda-developers.com/mo...ustom-kernel-developers-t3641363/post73257121
Dhanush-raj said:
https://forum.xda-developers.com/mo...ustom-kernel-developers-t3641363/post73257121
Click to expand...
Click to collapse
He had deleted his repo from gitlab
Marella ram_youtubr said:
He had deleted his repo from gitlab
Click to expand...
Click to collapse
use this bro...
Dhanush-raj said:
use this bro...
Click to expand...
Click to collapse
Actually my orginal phone is honor 6x.I love portable hacking.Like with nethunter.I tried to build nethunter kernel for honor 6x.But i failed at HID.So i took by brothers old phone That is moto g4 plus.later i found that moto g4 plus at android 7 is 32 bit.As there is no nethunter for 32 bit i have decided that atleast i should use linux deploy.But later i suck at wifi drivers.When i enable wifi drivers in kernel then phone doenst boot.
The final thing is can anyone help me in fixing this so that i can build a complete usable kernel with Net Hunter support

X compact stock kernel compilation

Hi all,
I like to try tweaking and hacking my phone. I've tried some ROMs on my kugo for some time, but I figured I wanted to make my own personalized build. Right now, I'd like to use the 'Night Light' app from F-Droid, which requires KCAL support. In order to enable KCAL I'd need to edit the stock kernel (I know this can be done, it was the case for Genesis Kernel on Nougat).
Hence I'd want to learn to compile a kernel, but I can't get to the end of Sony's tutorial. I've downloaded the kernel source but I am totally lost with defconfig files. How should I configure the kernel ? There is no obvious choice for a defconfig, and I can't get past point #6 in the tutorial..
Given that I've just discovered kernel compilation today, would someone be kind and take some time to maybe point me to useful doc, give me a clue as to what my next step could be, or teach me how they compile kernels for their device ?
Many thanks for any help,
Cheers
TLDR. How to compile a kernel? I have Sony's source for kugo, but don't understand how to configure the kernel compilation.

Regarding Android 10 on the HP Touchpad

Hello
For the past couple (weeks) I've been trying to compile Android 10 for tenderloin using the Android 9 sources but it's not going so well. First thing I ran into multiple sepolicy errors and I feel as if I fixed them in inappropriate ways but the errors went away. Other errors regarding camera and audio and such, that are regarding that tenderloin no longer uses the legacy audio format. Made me confused because I used the device sources form Evervolv and DIrty unicorns and if i'm correct they built it exactly the same way they uploaded it. After these errors were wrapped up, I got a error at zipping the rom that it could not zip due to failure of being able to read build.prop. This made me believe that the sources are not correctly formatted. If anyone can help me find a manifest, I can build for all you guys. Please keep tenderloin alive!
Now, I did something and I'm getting plenty of perl errors. Maybe I'm just very unlucky. I'm gonna attempt to reinstall on a fresh drive on my server.
If its anyone's concern, I was building lineage 17.1. I noticed for example, Lineage's "qcom-device" repo was shaped completely differently than Evervolvs qcom-device repo.
This led me to thought that Android 10 is going to be extremely difficult because of all the upstream dev changes that was pushed to Q. If any of you would like, I could probably push out March patches Pie rom because over there I'm mostly safe of complying with the source.
My manifest shape
DirtyUnicorn's device-tree
DirtyUnicorn's device-tree-common
DirtyUnicorn's htc-msm8960-kernel
Evervolv's vendor
And dirty unicorn's atheros wlan driver
I have been changing up the device tree so much, it almost looks ridiculous . From what I heard lots of properties on the device tree haven't been touched for years. Maybe tomorrow I can try Evervolv's Q rom. If you guys can help me build up my manifest, we can push out a fully working Q rom for tenderloin. And it would be just in time when Android 11 comes out. Thank you everyone!
I wish that I could offer any help, but I never tried to compile any Android ROM or for the HP_TP.
To my knowledge the only users that I know that could offer some insight on the process would be:
 @flintman
 @elginsk8r
Also the LuneOS project could offer some help:
https://pivotce.com/tag/luneos/
If Android Q(10) can not be ported to the HP_TP, then at least P(9) is a good ROM to keep updating that could provide many years of App support.
Theres no reason why exactly it cant,, because lots of roms I hear were built off the original TP sources (From 2011!). It was only around 2016 when guys around here had to change it up so much that they should've been so surprised that it worked. I can try and temporarily maintain P roms until the boys around here push out sources for Q!
djared704 said:
Theres no reason why exactly it cant,, because lots of roms I hear were built off the original TP sources (From 2011!). It was only around 2016 when guys around here had to change it up so much that they should've been so surprised that it worked. I can try and temporarily maintain P roms until the boys around here push out sources for Q!
Click to expand...
Click to collapse
To my limited knowledge is all about Hardware -->> Drivers -->> ( Kernel ).
The reason that Bluetooth and camera does not work on newer Android version is due to the old (proprietary drivers) and the Kernel. That takes more dedication and work than the ROM. The same rules applies to the desktop, older processors does not support certain features and the Operating System will not run. It is possible to disable the features in the kernel so that it does not check the hardware and make it run, but it will be unstable.
Everything could be possible with plenty of time, knowledge and dedication.
HP_TOUCHPAD said:
To my limited knowledge is all about Hardware -->> Drivers -->> ( Kernel ).
The reason that Bluetooth and camera does not work on newer Android version is due to the old (proprietary drivers) and the Kernel. That takes more dedication and work than the ROM. The same rules applies to the desktop, older processors does not support certain features and the Operating System will not run. It is possible to disable the features in the kernel so that it does not check the hardware and make it run, but it will be unstable.
Everything could be possible with plenty of time, knowledge and dedication.
Click to expand...
Click to collapse
When I look at the tenderloin source, the script to gather the camera driver is disabled. Camera isnt a huge deal though because its only 1.3 MP. However we use the MSM 8960 kernel from HTC and that is the one m7,, but the one m7 is a SD 600 device so it loses sense. I was gonna get some help with one of my kernel developer buddies to dev a kernel for android 10 for tenderloin. If you see the one m7 has Lineage 17.1 available and even though it doesnt have same chipset, if im correct both chipsets went off of the same assembly line process. Lineage 17.1 for the one m7 also packages it as a "uimage" which is what we use. I believe this was only a very small select of devices. Yeah about that ive been getting so many complaints during build about "mkimage" which should've been a prebuilt tool in the lineage source. Don't know why they removed it, or if our developers added it in by their selves, etc. Anyways I fixed that error by just "allowing" mkimage in one of the permission files in my environment. But yeah i went as far as the build packaging the ROM and it complaining it cannot read build.prop. Note the build.props are generated by the environment , not the source (even though the device data is gathered by the source, its not what im talking about). I even go to the directory it was complaining about and it was all there. One of my friends suggested a permission error. I changed permissions to 777 (rw to all users) and it would still output that error. By that point I trashed my build meaning I may of done something wrong early on. I will let someone else continue building 10 but I will continue building 9 with latest patches.
It will be extremely impressive if any kernel developer will update the HP Touchpad Kernel or tweak it for future release, well everything will stop once Android becomes 64 only.
I am sure you are very well aware, but I will suggest using this built:
https://forum.xda-developers.com/hp-touchpad/development/rom-evervolv-hp-touchpad-t3923512
I was able to do the following playing around recompiling the Kernel. I recompile almost all the ROM and incorporated the same kernel changes.
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773
The Ramdisk is also very easy to unpack and repack:
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-novacom-repair-android-t3960435
There is no need to get the original Camera or Bluetooth working, only sound and WiFi.
HP_TOUCHPAD said:
It will be extremely impressive if any kernel developer will update the HP Touchpad Kernel or tweak it for future release, well everything will stop once Android becomes 64 only.
I am sure you are very well aware, but I will suggest using this built:
https://forum.xda-developers.com/hp-touchpad/development/rom-evervolv-hp-touchpad-t3923512
I was able to do the following playing around recompiling the Kernel. I recompile almost all the ROM and incorporated the same kernel changes.
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773
The Ramdisk is also very easy to unpack and repack:
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-novacom-repair-android-t3960435
There is no need to get the original Camera or Bluetooth working, only sound and WiFi.
Click to expand...
Click to collapse
I think I probably stated somewhere, but Evervolvs "device" tree would just spit out hundreds of errors, and I fixed this by switching to Dirty Unicorns device tree. I also tried flintman's device tree and it didn't spit out many errors. Thanks for this though.
djared704 said:
I think I probably stated somewhere, but Evervolvs "device" tree would just spit out hundreds of errors, and I fixed this by switching to Dirty Unicorns device tree. I also tried flintman's device tree and it didn't spit out many errors. Thanks for this though.
Click to expand...
Click to collapse
I have only recompile the Kernel and all of them work, but the correct branch must be use. I can not say about building a ROM, never done it.
But Evervovs Pie by elginsk8r works very well and stable as it uses the same kernel, but the framework is different. I guess elginsk8r will be the only that can guide you on the right direction or flintman.
Have fun learning, it takes a lot of TIME!

Categories

Resources