Kernel Development - Android Q&A, Help & Troubleshooting

Hi. I would like to learn how to develope and port kernels..
Before anybody starts posting guides, I know how to download a kernel source add a few tweaks and compile. But I do not know how to port kernels. Or make cyanogen or AOSP kernels..
So my question is, are there any guides I can read, That will help me get started.
I also understand that I won't get a specific guide I just want a general guide to help me get started.

gmillz said:
Hi. I would like to learn how to develope and port kernels..
Before anybody starts posting guides, I know how to download a kernel source add a few tweaks and compile. But I do not know how to port kernels. Or make cyanogen or AOSP kernels..
So my question is, are there any guides I can read, That will help me get started.
I also understand that I won't get a specific guide I just want a general guide to help me get started.
Click to expand...
Click to collapse
There is no general guide, or any specific how to for merging code to build a aosp kernel. You get the kernel source for HTC for example, then compare that kernel with either an aosp kernel with a comparable type, or look at the aosp devices and merge things are remove them until you have a kernel that can boot in aosp. Then you start tweaking and tweaking until the kernel is stable.

lithid-cm said:
There is no general guide, or any specific how to for merging code to build a aosp kernel. You get the kernel source for HTC for example, then compare that kernel with either an aosp kernel with a comparable type, or look at the aosp devices and merge things are remove them until you have a kernel that can boot in aosp. Then you start tweaking and tweaking until the kernel is stable.
Click to expand...
Click to collapse
Thank you. That gives me a better understanding.
Sent from my captivated jelly beans. waiting on my skyrocket to get back from its space journey.

Related

How to compile an i717 kernel(ICS)

what is the or where can i find the defconfig of the kernel for i717..i am stuck on compiling my own kernel based from Faux and Showp's repo..
i used this Guide to build the kernel..and hopefully i can release it here on XDA for our use..
OR if somebody can help me compile this kernel..
EDIT: i have seem to grasp the defconfig..lolz..
kairi_zeroblade said:
what is the or where can i find the defconfig of the kernel for i717..i am stuck on compiling my own kernel based from Faux and Showp's repo..
i used this Guide to build the kernel..and hopefully i can release it here on XDA for our use..
OR if somebody can help me compile this kernel..
EDIT: i have seem to grasp the defconfig..lolz..
Click to expand...
Click to collapse
Have you contacted any developers ? Or those users who build kernels on a regular basis ?
They would be your best source for information on the kernel subject..and based on what I've seen in the note section, the devs are very willing to help and assist....IMHO....g
gregsarg said:
Have you contacted any developers ? Or those users who build kernels on a regular basis ?
They would be your best source for information on the kernel subject..and based on what I've seen in the note section, the devs are very willing to help and assist....IMHO....g
Click to expand...
Click to collapse
i get no reply from those Geniuses..only a few are helpful yet those helpful ones are also too busy to teach me..for how am i suppose to innovate this stuff if some are lazy to teach stuff..thats why we get no love at all..
i tried contacting the i727 kernel maker to ask some stuff yet assistance..but i get no reply at all..also before i asked franco and was able to get no response too..the only thing we need is a beefed up kernel..all roms are great and are stable but the fact we lack a beefed up kernel makes the device work like sh!t..i am not satisfied at all and all i can say is I WANT to make this device FASTER and BETTER..
kairi_zeroblade said:
i get no reply from those Geniuses..only a few are helpful yet those helpful ones are also too busy to teach me..for how am i suppose to innovate this stuff if some are lazy to teach stuff..thats why we get no love at all..
i tried contacting the i727 kernel maker to ask some stuff yet assistance..but i get no reply at all..also before i asked franco and was able to get no response too..the only thing we need is a beefed up kernel..all roms are great and are stable but the fact we lack a beefed up kernel makes the device work like sh!t..i am not satisfied at all and all i can say is I WANT to make this device FASTER and BETTER..
Click to expand...
Click to collapse
I applaud your effort, and I can appreciate how busy our development community is ...
Perhaps you could search out several different development sites, and you may find the answers there.
I know that many developers are self taught, and they protect that knowledge due too the endless hours of having to test and start again. But I'm sure that you could find a kitchen to cook a kernel or two...
UOT kitchen perhaps ???
I wish I could help you further, and I certainly wish you well in your search ....g
Look in I think arch/arm/config for defconfigs, see if the original devs had a config. If so, do
make ARCH=ARM whatever_defconfig
Replacing with the defconfig name and adding a CROSS_COMPILER statement as necessary. This will create a .config file in the root kernel directory. If no defconfig provided, you can try h0tw1r3's config and edit as necessary.
Sent from my SAMSUNG-SGH-I717

Building a ROM from scratch, guide?

Are there any guides that show the user how to create a rom from scratch? I've seen multiple guides on creating a rom but they do so using the kitchen. I would prefer something that shows how to make a rom without a crutch.
please help
HydrogenPeroxide said:
Are there any guides that show the user how to create a rom from scratch? I've seen multiple guides on creating a rom but they do so using the kitchen. I would prefer something that shows how to make a rom without a crutch.
Click to expand...
Click to collapse
I would say the best way to make a ROM from scratch is to compile it from source. If your interested in learning how to compile a ROM from source I would recommend taking a look at this guide to building Jelly Bean from source, as well as Google's offcial documentation on building Android from source. Additionally this guide on Zip Based ROM tweaking is a good guide to take a look at. Let me know if you still have any questions .
HydrogenPeroxide said:
Are there any guides that show the user how to create a rom from scratch? I've seen multiple guides on creating a rom but they do so using the kitchen. I would prefer something that shows how to make a rom without a crutch.
Click to expand...
Click to collapse
Normally all device forums have tutorials on how to compile ROM from source(if someone has already compiled it).
If no development has yet started for your phone then you you need to create the device tree which is tough. Otherwise just google . There are lots of tutorials lying on xda.
shimp208 said:
I would say the best way to make a ROM from scratch is to compile it from source. If your interested in learning how to compile a ROM from source I would recommend taking a look at this guide to building Jelly Bean from source, as well as Google's offcial documentation on building Android from source. Additionally this guide on Zip Based ROM tweaking is a good guide to take a look at. Let me know if you still have any questions .
Click to expand...
Click to collapse
Thanks, I didn't even know there was an official guide
I'm wanting an AOSP ROM on my s5 g901f but there is no support at all. Could someone point me in the right direction? I'd like to have a go and have looked up porting but I don't think that is the way to go. If somebody could give me the steps what I need to do for this modal I will research.
Could I use the cm for note 4 as it has similar specs, ie
805, 420 etc. Or s5 g900 as a base ROM? Or would I need to build from scratch?
There is only one custom ROM for g901f and that's touchwiz so somebody please help before I go insane. Touchwiz really is that bad
Up for this. Really interested especially for us who has not so good programming skills
mikey187lfc said:
I'm wanting an AOSP ROM on my s5 g901f but there is no support at all. Could someone point me in the right direction? I'd like to have a go and have looked up porting but I don't think that is the way to go. If somebody could give me the steps what I need to do for this modal I will research.
Could I use the cm for note 4 as it has similar specs, ie
805, 420 etc. Or s5 g900 as a base ROM? Or would I need to build from scratch?
There is only one custom ROM for g901f and that's touchwiz so somebody please help before I go insane. Touchwiz really is that bad
Click to expand...
Click to collapse
Let's see if I can point you in the right direction! Because of the differences in specs between your S5 Plus and the regular S5 you can't use that to port ROM's. For the Note 4 idea, since you only have a Touchwiz ROM as your base (The one from your S5 Plus) it won't work properly for the port ROM (CM12 Note 4). I would recommend looking at compiling CM12 for your device, which I would recommend taking a look at this guide here. Let me know if you have any questions be happy to help you out.

[Q] How to compile CM10.1 (Kernel+ROM) with Linaro for GT-I9100

Hello everyone, I'm trying to compile a version of CM10.1 with Linaro Toolchain, but so far only managed to set the Linaro for part of the ROM (JAVA), while for the Kernel (C/C++) has not been successful.
In the link below, infected_ posted a brief tutorial on how to configure the environment to use Linaro, but only for part of the ROM (and works well :good. As for the kernel, it was unclear how to perform the configuration.
http://forum.xda-developers.com/showpost.php?p=42976693&postcount=12
Could anyone give me some help on how to configure Linaro to compile the Kernel CM10.1 along with the rest of the ROM?
Before someone politely send me to Google... I searched and got many errors... (I even "kill" my phone, but already revived her.).
Note: I have no interest in publishing my work, I'm just looking for knowledge because I am very curious!
New informations about Linaro configurations to compile the CM10.1 Kernel released by infected_:
http://forum.xda-developers.com/showpost.php?p=43649447&postcount=449
All information gathered here are authored by infected_, then give thanks to him!:good:
Sorry for my English and thank you!:highfive:
Someone, somewhere?
Ask the devs on here to help you mate. A few on here using that way of building . Im sure they will help out. Just ask really nice :thumbup:
andrewwright said:
Ask the devs on here to help you mate. A few on here using that way of building . Im sure they will help out. Just ask really nice :thumbup:
Click to expand...
Click to collapse
Thank you my friend, I tried to ask a few things for some devs via PM, but usually they do not respond, because there are many requests all the days.
I found it interesting to create this topic because I've seen some people with the same question that I, and perhaps could be kept here a discussion.
But anyway I appreciate your interest!:good:
To be honest mate that sounds like a great idea. Keep trying pms and when you have compiled a working rom come bk and tells us (me) how. Soon im going to build a rom and am looking for all the info I can get on it. If I find what you need il come bk here. I read its smoother ui and better battery this way. It that why you choose this way of building?
Precisely, I read about it, and as I understand, when using Linaro Toochain, we get a gain of over 30% in performance, but I believe that the secret of all this performace is in the compilation of Kernel. And it is this part that I "got stuck" hehehe...
Currently my environment works well with Linaro Toochain 4.8-13.06 (compiling part of the ROM), and with Official Google GCC 4.7 (compiling the kernel).
At that moment I did not notice a significant gain in performance compared to the CM10.1 Official Nightly Builds.

Building Unsupported Roms

Hello there forum users! This thread was created with the sole purpose of helping me (and others) find out how to build ROMs for unsupported devices.
Basically, I've built AOKP from source, but the device I was building for was already supported. What I'm trying to do now if build Dirty Unicorns 4.2.2 for my device, which is not supported by the ROM. From what I've read, I've already forked the "vendor_du", "
android_device_samsung_vibrantmtd", "vendor_samsung", "proprietary_vendor_samsung", "android_hardware_samsung", "android_packages_apps_SamsungServiceMode", and "android_build".
How do I build the ROM for the Samsung Vibrant T959, when it is not supported. If someone has miraculously found a post that I have missed, I would appreciate it very much. Additionally, a list of commands and explanations would greatly assist me. I'm pretty new to the whole Android building thing so I thank you all for help!
Ain't nobody is going to help you ^^ I am looking for that kind of knowledge too. I would like to start building roms from source and make some modifications to CM10's kernel
check out Legion modz team thread
it has a little info on it
http://forum.xda-developers.com/showthread.php?t=2314836
and make google your best friend
so much way to take...
theabnormalguy said:
Hello there forum users! This thread was created with the sole purpose of helping me (and others) find out how to build ROMs for unsupported devices.
Basically, I've built AOKP from source, but the device I was building for was already supported. What I'm trying to do now if build Dirty Unicorns 4.2.2 for my device, which is not supported by the ROM. From what I've read, I've already forked the "vendor_du", "
android_device_samsung_vibrantmtd", "vendor_samsung", "proprietary_vendor_samsung", "android_hardware_samsung", "android_packages_apps_SamsungServiceMode", and "android_build".
My github account is MaxusPrimus
How do I build the ROM for the Samsung Vibrant T959, when it is not supported. If someone has miraculously found a post that I have missed, I would appreciate it very much. Additionally, a list of commands and explanations would greatly assist me. I'm pretty new to the whole Android building thing so I thank you all for help!
Click to expand...
Click to collapse
Im starting to learn to build from source. Theres many tutorials on how to get started. Ill post links when I get to my pc later. First I would get the source code for kernel on samsung. If not available get stock rom to dump required files aswell as other files needed. I dont know if this will guide you in the right direction. Just keep in mind and always remember the kernel hardware devices is different then the operating system. You juz need to learn google how to merge the to.
---------- Post added at 08:51 PM ---------- Previous post was at 08:09 PM ----------
flipinfin said:
Im starting to learn to build from source. Theres many tutorials on how to get started. Ill post links when I get to my pc later. First I would get the source code for kernel on samsung. If not available get stock rom to dump required files aswell as other files needed. I dont know if this will guide you in the right direction. Just keep in mind and always remember the kernel hardware devices is different then the operating system. You juz need to learn google how to merge the to.
Click to expand...
Click to collapse
Heres some starting links that im using starting to build from source. the samsung open source page look for your model number http://opensource.samsung.com. Obviously. you can build your own kernel.
how to unpack repack img http://forum.xda-developers.com/showthread.php?t=1081239
http://www.kandroid.org/online-pdk/guide/index.html very useful link aswell as this one http://source.android.com/source/initializing.html.
heres a link to identify partition tables http://forum.xda-developers.com/showthread.php?t=1959445. . Heres another link that you prolly can pull files from if needed http://www.teamandroid.com/2013/04/...kp-build-6-android-422-jelly-bean-custom-rom/
Dont take this the wrong way but i think your getting confused how roms kernels etc r built its all open source. That rom is based off of jelly bean and alls they did was change the name. Though its open source so i would assume you can repo the rom at https://github.com/. In addition if i was you i would download the rom "which you prolly already have and do some investigating.. heres another useful link http://xda-university.com/as-a-developer/porting-aosp-roms-using-source-code. Never forget google is your best friend. Fogot to mention if you aint on linux i would switch os real soon. I think this link will be ver ver very helpful https://bitbucket.org/bigwillyg/buttered_toast_shooter
Is that Vibrant T-Mobile ? cuz if it is http://aokp.co/devices/vibrantmtd theres your starting point

Build instructions

We need build instructions in order for people to more easily make custom roms. Currently most roms here only provide a repo or two, hardly describing the build process if anything. Not sure if those repos contain all the sources/blobs you need either.
It's not that hard to build and you can always go on th cheap and hire a cloud vps for a few hours, so don't bother with local building unless you have the powerful hardware.
Anyhow, so far what I know is that some people just replace the kernel and firmware, it seems this is called repacking.
Others are building Lineage from source as per their instructions, which are not descriptive when you're porting to a new device.
We need concrete and concise information about how it's done.
Lineage wiki is pretty accurate and if someone ask here I can try to solve his doubt.
I am not the best developer but I know the basics xD
Can you describe the basic workflow?
Which repos to check out, what build scripts are there, how to combine them. Basically a short tutorial on stuff. Also how come you're using 821 kernel from zl1, i know 820 and 821 are alike, but when do you patch the kernel to work for 820, i read that you need some config changes and a different gpu blob.
I am a developer myself, but not an android rom one. Things look really fragmented and chaotic. Besides Lineage wiki, I haven't found anything that resembles docs. I really want to contribute on this and have the hardware to build, just need some info on where to begin.
Thanks for taking your time to reply.
randxor said:
Can you describe the basic workflow?
Which repos to check out, what build scripts are there, how to combine them. Basically a short tutorial on stuff. Also how come you're using 821 kernel from zl1, i know 820 and 821 are alike, but when do you patch the kernel to work for 820, i read that you need some config changes and a different gpu blob.
I am a developer myself, but not an android rom one. Things look really fragmented and chaotic. Besides Lineage wiki, I haven't found anything that resembles docs. I really want to contribute on this and have the hardware to build, just need some info on where to begin.
Thanks for taking your time to reply.
Click to expand...
Click to collapse
Thats thanks to codeworkx code. Basically you compile a rom for zl1 and works for zl0.
My workflow is
repo init/sync the rom
Fix libhidl and libbfquio if needed (Dont know why they fix an error creating a bigger one tho)
Take the device tree, vendor and kernel
Adapt the device tree for the rom (Like in cosmic where config is in root not in config folder, boardconfig...)
And just brunch or make or lunch depends on rom xD
Edit: Forgot u need like 200 frameworks/av commits to make zoom work https://github.com/mosimchah/frameworks_av/commits/o8.1 all the january 15th and this one http://gerrit.aicp-rom.com/#/c/54436/
You init the Lineage repos?
What are those libhidl and libfquio about, and how do you fix them?
Vendor is the firmware blobs?
Kernel is obvious
What is a device tree? And how it relates to the kernel?
How did you adapt it to the device?
Different devices have different partion layouts I assume. How do you make the zl1 rom work for both zl0 and zl1? Earlier people were reporting bricks because of flashing roms for zl1 on zl0
randxor said:
You init the Lineage repos?
What are those libhidl and libfquio about, and how do you fix them?
Vendor is the firmware blobs?
Kernel is obvious
What is a device tree? And how it relates to the kernel?
How did you adapt it to the device?
Different devices have different partion layouts I assume. How do you make the zl1 rom work for both zl0 and zl1? Earlier people were reporting bricks because of flashing roms for zl1 on zl0
Click to expand...
Click to collapse
Yout init the rom source you want to compile
You dont need to adapt anything codeworkx already did it for us we just compile zl1 roms with his device tree (Los one) or any of the forked ones (Like Aicp which I recommend).
Libhidl and libbfquio depends on the rom you are building. Libhidl is solved by reverting this changes https://github.com/PixelExperience/system_libhidl/commit/607e961b85eea8969503d8ff8437c014f04f0ca2 and libbfquio by taking this http://gerrit.aicp-rom.com/#/c/56488/
You dont adapt device tree to device you adapt it to the rom you are compiling see how other devs do it in their github (Every rom is different for example in cosmic you rename lineage/aicp.mk to cos.mk and change where to import things)
---------- Post added at 01:53 PM ---------- Previous post was at 01:49 PM ----------
Start by picking up a rom you want to compile that has 8.1 source working and better if a msm8996 device is there (zuk z2, oneplus 3...)
Thanks for the info. Will experiment a bit when I have free time. Planning on making an in-depth guide if I succeed and clarify the concepts.
Btw I see that everyone is using kernel 3.18.20, why can't we get a newer kernel? If we have the sources for it and the blobs? Is the reason being that the drivers are not in the mainline kernel so they need to be ported to a newer kernel?
randxor said:
Thanks for the info. Will experiment a bit when I have free time. Planning on making an in-depth guide if I succeed and clarify the concepts.
Btw I see that everyone is using kernel 3.18.20, why can't we get a newer kernel? If we have the sources for it and the blobs? Is the reason being that the drivers are not in the mainline kernel so they need to be ported to a newer kernel?
Click to expand...
Click to collapse
Np
Not sure dont know much about android kernels

Categories

Resources