[Q] Compiling Kernel From Source - Android Q&A, Help & Troubleshooting

Hi everyone, I am looking for a point in the right direction or any advice.
My device is Samsung Galaxy Note 3 SM-N9005. I know there is a forum for that device but I feel I need help from experienced kernel devs and I am unsure where to ask for help
I have downloaded the source files from Samsung for this device (it has kernel and platform archives).
I have a linux dev environment setup in virtual machine. I successfully compiled the kernel zImage. I managed to unpack the current boot.img and replace the zImage and repack and the phone boots. So that is a success for a first time hey?
However, WIFI does not work. I have read that I have to compile the wifi module for it, but I am clueless.
Do I, or don't I, need the Android 4.3 source code from Google?
Do I have to run "make menuconfig" and enable modules (currently not enabled)?
Do I have to somehow compile a wifi module?
Any help will be massively appreciated!!!
Thanks
Dan

Related

[Q] Compile modules withouth kernel source ?

Hi guys,
I'm basically a total noob on Linux territory so my question may appear stupid
Is it possible to compile Kernel modules without having the kernel source code of the device ?​
I want to compile some kernel modules (most important: bluetooth.ko, btusb.ko and ntfs.ko), but my device is a no-name Brand, so i won't get the kernel source code :-(
Thanks in beforehand
bump
It is possible if i have the whole system image, the kernel must be somewhere inside there ?
(as i said i'm a linux noob)
If you have the whole image then yes. I would send the OEM an EMAIL asking for the kernel source as by law they have to under the GPL.

[Q] Kernel Compiling

Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
gigoo25 said:
Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
Click to expand...
Click to collapse
Hey Rob, I wish you the best of luck and don't give up!
The one thing I can say is when I was compiling my own kernels a while back and when I was trying to do the exact same thing and add different frequencies, if I remember correctly, there is a couple files that need to be changed, not just one, but don't quote me on that
I would also try getting help from other phone developers too. Post in the Q&A section of the phones, you might get more help that way.
Other then that good luck!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

[Q] Compiling kernel problem!!

Hello, i'm trying to compile kernel for Nexus 4 on debian 7,
i've downloaded ndk with toolchains, sources from android site, and followed many guides to compile kernel, but after make command, i can't find anywhere the zImage file, it should be in arch/arm/boot/ but it isn't there, no errors during compiling.
I've already compiled kernel for linux, and this seems strange :/
can anybody help me please?
thanks in advance

[Q] Where to start for Android Kernel Development?

Hello Guys,
I see a lot of threads for starting with android rom development, but can anyone give me pointers for kernel development? I would like to start kernel development and do not know where to start. I am not interested in rom development at the moment, but that is because I assume that the android rom is like a user space app over the kernel. Please correct me if I am wrong. It would be great if you guys could point me to some beginner friendly kernel development tutorials. I am looking through Linux Device Drivers (LDD) book but am having a hard time comparing that with android. I have cloned mediatek 6589 source from android repository. I am submitting partial url cos I am not allowed to submit full url yet. URL(android.googlesource.com/kernel/mediatek/+/android-5.1.0_r0.2) since I am running a mtk6589 device (Walton X1/ Gionee Dream D1) and would like to understand where to start coding kernels for android. Any help would be greatly appreciated.
Oh and I would like mediatek specific help if possible. I have gone through some of the general kernel building and overclocking tutorials. I want to do some more enhancements if possible. Since mediatek seems to be the mysterious one with bare minimum source availability, I would like to take up that challenge
Thanks.
I don't have a tutorial for you but a small checklist. You need:
* Kernel source tree
* A config for your device (e.g. arch/arm/configs/*defconfig*)
* A cross compiler toolchain to generate ARM code (you can use the precompiled one from the Android source tree)
* A way to package your kernel into a boot image for your device - usually an Android boot image contains a compiled kernel (zImage), a compressed ramdisk for the root filesystem, and probably a device tree binary (dtb). Mediatek may do things differently.
* A way to install that boot image on your device - this requires an unlocked bootloader that allows custom boot images to be installed and started. Most devices use the fastboot tool for this.
Your first step should be to build a working kernel from unmodified sources. When you got that working, you can think about starting actual coding.
Thanks for the Pointer Mate
_that said:
I don't have a tutorial for you but a small checklist. You need:
* Kernel source tree
* A config for your device (e.g. arch/arm/configs/*defconfig*)
* A cross compiler toolchain to generate ARM code (you can use the precompiled one from the Android source tree)
* A way to package your kernel into a boot image for your device - usually an Android boot image contains a compiled kernel (zImage), a compressed ramdisk for the root filesystem, and probably a device tree binary (dtb). Mediatek may do things differently.
* A way to install that boot image on your device - this requires an unlocked bootloader that allows custom boot images to be installed and started. Most devices use the fastboot tool for this.
Your first step should be to build a working kernel from unmodified sources. When you got that working, you can think about starting actual coding.
Click to expand...
Click to collapse
Thanks man. Really appreciate the pointers. I do have some of the checklists done. Like
* Kernel source tree
** A cross compiler toolchain to generate ARM code (using the precompiled one)
* A way to install that boot image on your device
Now the problem is, my device still does not have its source code available. I got the general source tree from google which is not my device's so I dont have the defconfig. Is there a way to rip it out from a compiled kernel? Like using some sort of a decompiler? Also I will look around for zimage packaging tools. Thanks mate. Mediatek is apparently one hell of a problem child XD
syko_kickass said:
Now the problem is, my device still does not have its source code available. I got the general source tree from google which is not my device's so I dont have the defconfig. Is there a way to rip it out from a compiled kernel? Like using some sort of a decompiler? Also I will look around for zimage packaging tools.
Click to expand...
Click to collapse
If you're lucky, your existing kernel exposes its config in the file /proc/config.gz. If not, I don't know how to get a matching config - best is to avoid buying anything from GPL violators.

i Have successfully compiled Samsung's SM-T580 kernel, how do i make the boot.img?

Hello,
First of all, this is my first post in the forum and my first time trying to compile an Android kernel.
My intention was to port Nethunter for my tablet, Samsung SM-T580 (Galaxy Tab A6 10.1 only wifi).
I have successfully compiled the original kernel offered by samsung and i have ended up with a file called Image, a file called Image.gz and a dts folder
I have extracted the original rom boot.img with mkbootimg_tools and i see a kernel file, a ramdisk folder, a ramdisk.packed file and a dt.img
For what i have found is that this must be a non standard thing, the way samsung manages this, and despite i have seen various guides on compiling samsung kernels, i haven't found anyone doing it straight from samsung sources.
I think that the dt.img part is solved with the dtbTool, but i haven't been able to figure out what to do with Image and Image.gz to get the kernel and ramdisk.
¿Can someone give me a lead on this? ¿Is it doable? ¿Should i look for other kernel instead?
Its been long time ago... But did you manage to compile the kernel?

Categories

Resources