Compile Kernel Questions - General Questions and Answers

Hi all. I have Questions for compiling a Kernel
I got a little bit know-how of how to compile a Kernel. I´m a beginner, and my first time imy first training was to download source, get toolchain, take an working kernel (for me it was BlueBolt OnePlus2 Kernel Oreo 8.0)
I compiled the kernel, and it start booting. After all works, i add a scheduler, and cpu governor. Compiled, and it is working. Now, and here comes the problem. Now, i want to learn to compile my self a kernel.
I downloaded Blue Bolt kernel source for 8.1. Test it with his defconfig. Works. Ok. So, how to start now. There are many defconfigs (msm8994_defconfig, msm8994_oneplus2_defconfig, msm8994-OnePlus2-perf_defconfig, msm8994-perf_defconfig). What defconfig it the right to start? I took the msm8994_oneplus2_defconfig (compiled with no errors), but phone doesn´t boot.
-How do i start to make it work?
-Why there are mulitple defconfig?
-After compiling there is no error. Why it doesnt boot?
-And when you got errors, how do you find the problem, and how do you correct them?
Hope someone could explain me a little bit how to start.
Thx

Related

[Q] Kernel source compiling for Xoom.

Hi I looked for sometime for answers but could not find anything relevant.
Looking to get the ftdi VCP drivers to install on Xoom. Which means I either have to compile a kernel or add them as a module. I can not for the life of me find the correct source tree.
I downloaded kernel 2.6.36.3 from google which matches my kernel version.
My kernel version on the tablet is 2.6.36.3-gb899258 .
When I cross compile the module and try to do an insmod its complaining about the magic version is different which leads me to believe that I have the wrong kernel.
Where can I get the right stock kernel?
If i can not find it there is another option to download the config.gz from the device and recompile another version of the kernel with native support for the ftdi drivers.. How do i just install just the kernel on the device? Is it a uImage bzImage and how do I just flash that?
cd
Thanks
edit:
scrap that ...
sorry, not really helpful in your case
I'm assuming you got your source from here? This is the link from the Android website:
git clone https://android.googlesource.com/kernel/tegra.git
If you decide to go the route of compiling another kernel source, the easiest way (and a good way to keep snapshots of various configs) would be to use Koush's AnyKernel to flash the kernel. I don't know anything about what you're trying to do but I hope that helps some.
Yep the code comes from there.....
I finally got it to work , I downloaded the stock kernel from google then when I make the modules I had to modify the Makefile to get it to match the kernel versions.
It seems to work for now...
Thanks for your help

Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX

I realize people gave up slightly on the whole kexec thing over radio worries, but I now have the module compiling and inserting without error into the Droid2/DroidX gingerbread kernel. Next comes cross compiling the kexec-tools for userspace, to allow us to attempt inserting a different kernel.
To build, you'll need a compiled DroidX kernel from source, as well as the android NDK.
To build, make sure you have downloaded the DroidX GB kernel source and compiled it. There are guides everywhere on how to build Android kernels. Just make sure you use the proper cross compiler.
http://sourceforge.n....l.tgz/download
When you build, make sure to use
Code:
make mapphone_defconfig
Once the kernel is built, clone my repo and edit envsetup.sh to reflect the correct paths to your kernel source directory and the android NDK.
https://github.com/i...kexec-mod-d2-dx
Then, source it:
Code:
source envsetup.sh
Then, just run
Code:
make
and cross your fingers. You should then have a fresh kexec_load.ko file!
To see if it loads, you'll need to copy it to your sdcard, and then on the phone, using a console, do the following:
Code:
su (click allow)
insmod /sdcard/path/to/kexec_load.ko
If you don't get any errors, it inserted! Now, of course, to actually use it, we'd need the kexec-tools built, which I haven't gotten ready yet...but they're coming! To remove the module (no reason to leave it in memory for now):
Code:
rmmod kexec_load
Happy hacking, and help is always appreciated!
This looks great! If you need any help just ask
Thanks! I probably could actually use some. I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there.
I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there, though I do have an atags module working, except it doesn't do anything without atags in the procfs (http://lists.infradead.org/pipermail/kexec/2011-January/004795.html).
kexec-tools:
https://github.com/i...xec-tools-dx-d2
To build, see the README.
Then, copy the binaries from /build/sbin/* to your device, and the move them to the /system/bin directory, and chmod them 770 to make them executable.
mod-atags:
https://github.com/i...mod-atags-d2-dx
Now, if I/we can just get atags and procfs stuff taken care of, we'll be able to go to the next step. I already have atags compiling as a module, but it won't stay inserted because we have no atags in the procfs. Note I can't just trace through code like this and know what everything is doing, but I know enough to hack at it and be dangerous
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
calebcoverdale said:
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
Click to expand...
Click to collapse
No idea. I haven't even gotten the kernel to change yet, so I haven't gotten to mess with radio yet. The method itself should/would work though, but radio will require reverse engineering...perhaps find a similar phone with an open bootloader and disassemble and attempt to clone it's modules.
The latest change I made may or may not work, it was an attempt to remove atags from the kexec module based on an old patch I found, which added the functionality. This at leaset made kexec -l zImage work, but when I run kexec -e, the kexec binary complains about atags not being there...hrmmmph.
I may have to revert it (and will if we can get atags somehow) ...but if we can get the kexec bin to ignore /proc/atags or just find a way to rip them out of the running kernel, we'll be in business.
The commit: https://github.com/ilikenwf/kexec-mod-d2-dx/commit/12dffe0ea286be0fe9ab0303a5a35ed92be4ee2c
I'm also looking into 2ndboot.
I like where this is going! Keep working!
Sent from my DROID2 using xda premium
Okies, so, I emailed aliasxerog (original kexec-mod writer), and I hope he'll get back to me. Even though his twitter says he's a "former android developer," maybe he'll be willing to give me some hints so I can pick up where he left off.
I also got the froyo version of the module building properly based on his module, yet again, (all after SBF'ing my phone back down to motoblur froyo - yech!) but neither currently work... (note there's a gingerbread and a froyo branch on my repo): https://github.com/i...kexec-mod-d2-dx
The froyo one throws the following error, which stops me dead in the water:
Code:
Could not find a free area of memory of 3007dc bytes...
The gingerbread one loads the kernel into memory but won't execute it due to our not having atags.
We've moved our git repos to an organization for easier collaboration:
https://github.com/organizations/D2-DX-Customboot
links are imcomplete.
use URL lable pls.
Cross compiler version ?
hello,
Sorry but I am not able to use the sourceforge link that you provided to download kernel source .. Also please share what cross compiler version is to be used....
Thanks in advance.

roll your own kernel package

I grabbed the initrd and kernel source from antonx's repos and tried building a kernel. It didn't work. It didn't really look like it was going to work from the build script because I didn't see the init being compressed and combined with the kernel and if I remember right that's how it's done. I know i've seen directions in some forum before but I can't find it now.
Help anyone?

[Completed] [Q] Trouble With Nexus 5 Kernel zImage

Haii guys!
So, i'm young "kernel developer".. I am actually not a coder, i just try to learn by making kernels and if they are stable enough i test them. So, till now i was working with Mako source - i had phone lg optimus g which i really close to mako and i based everything on Mako source.
Now i bought a new phone, Nexus 5. I am really satisfied by this phone on stock, but even more on custom ROM & Kernel.. But hey, it's me, i'm curious and i have to try to make stuff myself, so i choose to make my own kernel for Nexus 5.. More to learn than anything.
So, i started.. I forked this to my github and do some basic changes for me.. Just to start. I added graphite support and option to build with Linaro 4.9.4.. And i started to build. And it had some errors, so i also fixed them - fs/namespace.c error with 4.9 toolchains, so, i fixed it and it built with no trouble.
So, i was coming from world of Mako and took zImage, made a flashable zip with AnyKernel and flashed it.. And i was stuck at google logo with unlock icon. I restored twrp backup of previous kernel and started over and it booted normally...
Then i did some research and found out that i should use zImage-dtb because Nexus 5 uses something named device tree blob.. So, i did everything from scratch.
I forked same source as before, and did my changes over it.. Renamed kernel, added kernel build script, made my slightly modified defconfig, this time i used toolchain LinaroMod 4.9 from here and some other stuff.. I built with no trouble, used zImage-dtb as zImage in flashable zip as i saw in other kernels and flashed.. I was sure it will boot this time, none of those modifications was supposed to break anything.. But again, I am stuck at Google logo.
Have any of you guys any idea where i missed? Maybe wrong source? Wrong toolchain?
Here are some maybe useful links:
My source: https://github.com/Matthew-333/BlueMoon
My Changes: https://github.com/Matthew-333/BlueMoon/commits/master
Toolchain: https://github.com/hyper-toolchains/LinaroMod-arm-eabi-4.9
AnyKernel Template: https://github.com/koush/AnyKernel
I am using xUbuntu 15.04 64 bit..
Thank you if anybody manage to help me with this...
Matthew_333 said:
Haii guys!
So, i'm young "kernel developer".. I am actually not a coder, i just try to learn by making kernels and if they are stable enough i test them. So, till now i was working with Mako source - i had phone lg optimus g which i really close to mako and i based everything on Mako source.
Now i bought a new phone, Nexus 5. I am really satisfied by this phone on stock, but even more on custom ROM & Kernel.. But hey, it's me, i'm curious and i have to try to make stuff myself, so i choose to make my own kernel for Nexus 5.. More to learn than anything.
So, i started.. I forked this to my github and do some basic changes for me.. Just to start. I added graphite support and option to build with Linaro 4.9.4.. And i started to build. And it had some errors, so i also fixed them - fs/namespace.c error with 4.9 toolchains, so, i fixed it and it built with no trouble.
So, i was coming from world of Mako and took zImage, made a flashable zip with AnyKernel and flashed it.. And i was stuck at google logo with unlock icon. I restored twrp backup of previous kernel and started over and it booted normally...
Then i did some research and found out that i should use zImage-dtb because Nexus 5 uses something named device tree blob.. So, i did everything from scratch.
I forked same source as before, and did my changes over it.. Renamed kernel, added kernel build script, made my slightly modified defconfig, this time i used toolchain LinaroMod 4.9 from here and some other stuff.. I built with no trouble, used zImage-dtb as zImage in flashable zip as i saw in other kernels and flashed.. I was sure it will boot this time, none of those modifications was supposed to break anything.. But again, I am stuck at Google logo.
Have any of you guys any idea where i missed? Maybe wrong source? Wrong toolchain?
Here are some maybe useful links:
My source: https://github.com/Matthew-333/BlueMoon
My Changes: https://github.com/Matthew-333/BlueMoon/commits/master
Toolchain: https://github.com/hyper-toolchains/LinaroMod-arm-eabi-4.9
AnyKernel Template: https://github.com/koush/AnyKernel
I am using xUbuntu 15.04 64 bit..
Thank you if anybody manage to help me with this...
Click to expand...
Click to collapse
Hi, thanks for using XDA assist!
Please have a look here for some useful information:
http://forum.xda-developers.com/android/software/ultimate-guide-compile-android-kernel-t2871276
Good luck!

[Q] Trouble With Nexus 5 Kernel zImage

Haii guys!
So, i'm young "kernel developer".. I am actually not a coder, i just try to learn by making kernels and if they are stable enough i test them. So, till now i was working with Mako source - i had phone lg optimus g which i really close to mako and i based everything on Mako source.
Now i bought a new phone, Nexus 5. I am really satisfied by this phone on stock, but even more on custom ROM & Kernel.. But hey, it's me, i'm curious and i have to try to make stuff myself, so i choose to make my own kernel for Nexus 5.. More to learn than anything.
So, i started.. I forked this to my github and do some basic changes for me.. Just to start. I added graphite support and option to build with Linaro 4.9.4.. And i started to build. And it had some errors, so i also fixed them - fs/namespace.c error with 4.9 toolchains, so, i fixed it and it built with no trouble.
So, i was coming from world of Mako and took zImage, made a flashable zip with AnyKernel and flashed it.. And i was stuck at google logo with unlock icon. I restored twrp backup of previous kernel and started over and it booted normally...
Then i did some research and found out that i should use zImage-dtb because Nexus 5 uses something named device tree blob.. So, i did everything from scratch.
I forked same source as before, and did my changes over it.. Renamed kernel, added kernel build script, made my slightly modified defconfig, this time i used toolchain LinaroMod 4.9 from here and some other stuff.. I built with no trouble, used zImage-dtb as zImage in flashable zip as i saw in other kernels and flashed.. I was sure it will boot this time, none of those modifications was supposed to break anything.. But again, I am stuck at Google logo.
Have any of you guys any idea where i missed? Maybe wrong source? Wrong toolchain?
Here are some maybe useful links:
My source: https://github.com/Matthew-333/BlueMoon
My Changes: https://github.com/Matthew-333/BlueMoon/commits/master
Toolchain: https://github.com/hyper-toolchains/LinaroMod-arm-eabi-4.9
AnyKernel Template: https://github.com/koush/AnyKernel
I am using xUbuntu 15.04 64 bit..
Thank you if anybody manage to help me with this...

Categories

Resources