yashsingh1/xdaforums huggingface dataset:
[Android] desalesouche:
build a rom with your kernel source included,and build kernel from source

at the end of build you will have a rom for your device with boot.img.
[Android] brymaster5000:
Try leaving out the ram disk. Use the any kernel method. See what happens. How far does it boot? If it gets to the splash screen...you might be able to grab a last_kmsg to troubleshoot the kernel.

Sent from my Lunar Ecliptic One.
[Android] El-Nath:
Thanks, that solved it. So it's seems I messed up when repacking it back into the boot.img process :eek:
[Android] ajeeshcr20:
/home/achu/android/kernel/kernel/../mediatek/build/Makefile:13: *** TARGET_PRODUCT/PROJECT is not set. Stop.

plz help me :(
[Android] brymaster5000:
Google "TARGET_PRODUCT/PROJECT is not set"

You will probably find your answer. I don't know what you are trying to build or tool chain you are using because you didn't state it, but it appears at line 13 of your /build/makefile...you might need to add something...and according to Google it's possibly a =generic_x86.

Again..not exactly sure what you're building...but Google is your friend ;)

Hopefully that points you in the right direction.

Sent from my Lunar Ecliptic One.
[Android] aweosomeabhijeet:
Thanks everybody :D

I solved it on my own. :D

Great tutorial, Thanks :)

Solution :

The zconf.tab.c_shipped file was missing in the source, grabbed it from the same kernel version of Xperia 2011(though my device is moto) device and it worked, I have a fully working kernel.
[Android] ilovemeow:
thanks mate

but it fail unfortunally

i hv no block path for my machine...sad will find it out
[Android] KainXSS:
has anyone been able to build a working kernel for newer MSM huawei devices I am tryin but still cannot, the kernel will build but huawei has a perl script that selects device configs ontop of the normal defconfig and it keeps throwing a closed filehandle error resulting in a non booting kernel.

I've built kernels before but I think this one needs extra commands to build right(but I don't know them)
[Android] Salo-S:
Can I make my own kernel following this tutorial, using ElementaryOS 0.2 (Luna)? Its based on Ubuntu 12.04LTS....
[Android] karanrajpal14:
Yes you can!
[Android] rajit:
Hi I am trying to build a kernel for Xolo Q700 .. Its mtk6589 based. So could you please tell me what's this?

I tried to replace Mediate/kernel/driver/usb20/musb_otg_if.c with one if the other mrk6589 source.

But still the same
[Android] umberto1978:
Just take a look to each one of the included files mentioned by the musb_otg_if.c and compare the ones taken from mtk6589 with your (in your actual source tree).

Usually the function are recalled from header file included on the source C program, so if some line is missing (a line that contains for example a function declaration) you got an error from cross compiler for each declaration missing.

Or if you are skilled enough, you can try to fix yourself the C program by adding a declaration BEFORE the first use of the function(s).

Inviato dal mio GT-N7100 utilizzando Tapatalk
[Android] Kim.PH:
LOL :) would like to build one but don't have linux
[Android] GuneetAtwal:
which source are you using? if I remember q700 don't have any kernel source
[Android] rajit:
Xperia c
[Android] jjhiza:
A distro like Mint or Ubuntu are easy to set up and use out of the box, and of course, all Linux distributions are free of charge, so there's that. If you want to build for Android, I'd suggest using one of those two for now. :)
[Android] someone755:
Also if you don't want to ruin your HDD, try a virtual machine or a liveboot CD/DVD/USB.
[Android] batalla11:
looks great testing it
[Android] mmcneil:
Newb question

Hi everyone. I want to build a kernel using PwnCakes Quantum kernel sources and I have some questions:

1. The current Quantum kernel is built to run on the Samsung Galaxy S3 (dtlte). Does this mean that the kernel source itself can only be used on that platform? I'd like to build it to run on the Samsung Galaxy S4 (jflte)

2. Do I need permission from PwnCakes to use his sources? I don't plan to distribute this as my own kernel; I just want to use it on my device as it resolves a lot of issues that I have when using AOSP.. namely bluetooth.

Any help/guidance/comments would be greatly appreciated.

Thanks,

Mike
[Android] someone755:
1. One source = one device. You can't cross-use sources, you'll just end up with an S3 kernel. Take the S4 source and add changes to it from what PwnCake added (see his github pushes, mergest etc).

2. For personal use, no. You don't even need to push your source to Githubsimilar services. But the second you share that to anyone you need to upload the sources. Asking for permission isn't necessary, especially so if there's nothing of code in there that the dev made himself. But it's a sign of showing respect and gratitude. Just sliding the guy a PM about you using the sources should be enough.

And questions/comments will be nicely answered unless completely idiotic. c:
[Android] mmcneil:
Thank you so much for getting back to me. A few questions however;

1. I want the kernel to be for AOSP. Where do I get the S4 sources for that?

2. I've built kernels for Linux before, so I'm somewhat familiar with the folders that are in his github. How do I take what I want from github and add it to my sources?

I've been using Linux since 1998, so I know it pretty well. I just need some guidance on getting started. I really appreciate your help.

Thanks,

Mike
[Android] someone755:
Not sure about where you could get AOSP sources, but this one should work nicely: https://github.com/CyanogenMod/android_kernel_samsung_exynos5410

(IF your S4 uses the exynos 5410 board, that is. I don't keep track of all of Sammy's phones and versions. :/)

About GitHub, I know how to pull, clone and push. xP I usually go and take the changes and edits I want by hand. Copy the text on GitHub and paste it into a file (new/existing) and that should work. Though in any case watch out for things your phone does not have or seem weird compared to the other bits of code. (like overclocking the GPU/CPU won't be the same, you'll need to figure that out yourself -- there's an article on XDA-University on customizing kernels, you should check that)

Good luck
[Android] Tommy-Geenexus:
+1

[MENTION=1623684]mmcneil[/MENTION]

You need to git clone the cyanogenmod kernel for your sgs4

Gesendet von meinem Nexus 5 mit Tapatalk
[Android] someone755:
I figure a CM kernel would work for AOSP since Nexus devices can crossflash kernels (AOSP, CM, AOKP, PA, even Chameleon and miui!).
[Android] Tommy-Geenexus:
The cyanogenmod-kernel will work in non nexus devices in aosp and cm.

On nexus devices a CAF(cm)-kernel won't boot with aosp and the other way round.

Gesendet von meinem Nexus 5 mit Tapatalk
[Android] mmcneil:
Thanks someone755

Thanks Tommy. I'm starting to get it now. Very similar to compiling a custom linux kernel. I do need a little more clarification on how to cherry pick the features I want from the Quantum kernel. For example, whatever is used to make bluetooth work, I want that, as well as any additional governors, tcp congestion settings, etc. Would you mind giving me an example?

Thanks,

Mike
[Android] Tommy-Geenexus:
Here

http://xda-university.com/as-a-developer/adding-features-to-your-kernel

Myself i'm adding code manually and don't cherry pick because of a lot fails, but it's up to you ;)

Gesendet von meinem Nexus 5 mit Tapatalk
[Android] someone755:
[MENTION=5243932]Tommy-Geenexus[/MENTION] then how come franco.kernel works for both AOSP and CM? Or faux's kernel or any other one...
[Android] somboons:
I can not find zImage after make clean command

---------- Post added at 02:07 AM ---------- Previous post was at 01:35 AM ----------

Who can explain me for more info step "make menuconfig" ?
[Android] Tommy-Geenexus:
Faux works on cm? Never..

Gesendet von meinem C6603 mit Tapatalk
[Android] someone755:
[MENTION=4008653]somboons[/MENTION]: make clean clears everything you've made, including the zImage.

The make menuconfig command, if done properly, brings up a menu with checkboxes -- you check what you want to finish in your kernel and uncheck the things you don't want.

[MENTION=2272986]tomma[/MENTION]-Geenexus: Every kernel works for everything on my grouper (provided the kernel is for the Android version of the ROM you're using).

So the N5 has a different set of rules? Will look into that one day.
[Android] Tommy-Geenexus:
[MENTION=4275152]someone755[/MENTION] yep aosp kernels don't work on cm on my n5

Gesendet von meinem AOSP on HammerHead mit Tapatalk
[Android] somboons:
Can you guide me or standard check for the make menuconfig?

This is the first time I try to make kernel I am no expericen.

Make clean must no error ,right? I can see zImage
[Android] mmcneil:
I'm getting the following error when compiling:

android/kernel/android_kernel_samsung_jf/arch/arm/include/asm/io.h:30:26: fatal error: mach/msm_rtb.h: No such file or directory

compilation terminated

I'm using the cyanogenmod s4 kernel git source, as Tommy suggested. Any ideas?

Thanks,

Mike
[Android] someone755:
Did you add/remove any of the code thingy?

That's somewhat common -- adding some code which points to a file that's not there.

If you haven't changed the code, I don't know what it could be... :I

[MENTION=4008653]somboons[/MENTION] I don't get what's so hard using the menuconfig. Use up/down to move, enter to enter a sub-menu or to enable/disable something (you can also use space for the enable/disable part). Double-tap the Escape key to go back one menu.

Your third sentence, I do not understand.
[Android] Tommy-Geenexus:
Basically you shouldn't change anything in the menuconfig, but in your devices defconfig.

Gesendet von meinem Nexus 5 mit Tapatalk
[Android] kelvinvalencio:
Building first kernel,can i build it but not compile from source? :D
[Android] Tommy-Geenexus:
to build a kernel you need to compile it from source [emoji1]

Gesendet von meinem Nexus 5 mit Tapatalk
[Android] somboons:
zImage not create for me in arch/arm/boot

What is step I should concern?

---------- Post added at 08:35 PM ---------- Previous post was at 08:33 PM ----------

I use jb d802 kernel.
[Android] mmcneil:
No, I didn't remove any of the code. I wanted to make sure that I could successfully compile a stock kernel first. I'm going to clean everything and start over fresh. Question about using other sources, Tommy pointed me to a very helpful link, but I want to know if I can copy the entire drivers/bluetooth folder from another devs kernel. If so, do I have to modify/update any of the Makefiles or Kconfig/Kbuild files to get the drivers to compile? I'm having trouble understanding the whole "cherry picking" thing. Basically, what I'm attempting to do is copy the bluetooth drivers that I know are working, into my stock kernel source and bake them in.

Thanks,

Mike
[Android] mmcneil:
Still looking to get some help with this. What's weird is that no matter what source I use, I get the exact same error.

Thanks,

Mike
[Android] someone755:
Mike, you got all your packages installed and updated?

Find an up-to-date tut on building CM and download those packages, most of them you'll need for this.
[Android] TheSSJ:
Hi,

I'm sorry if this is not suiting the topic being discussed so far, but on the latest Lubuntu 13.10 Saucy Salamander (seriously, who invents these release names?) release I needed to install the following packages in order to have my kernel compiled:

sudo apt-get install lzop sharutils

It worked a charm, many thanks!

_______________________________________

Coming to Mike's problem:

Do you have the msm_rtb.h file located here:

/arch/arm/mach-msm/include/mach/

try to place the attached file there and let us know if the error "changed"!^^
[Android] someone755:
OT here but [MENTION=2388665]TheSSJ[/MENTION]:

The release names are of rare or endangered animals. Well one word, at least. The other one is a bit random, just to match the letter (eg. precise, saucy...).
[Android] desalesouche:
https://github.com/charlie1024/kernel-a770k/blob/master/arch/arm/mach-msm/include/mach/msm_rtb.h

hope it would help you
[Android] diskie:
help?

I am trying to compile a kernel for my device(kyleprods or GT-S7582 or Galaxy S duos 2) because I havent found any custom kernel out here. Im compiling from source. I tried compiling WITHOUT any tweaks or such, just plain compile after downloading the source, and it compiled successfully. I tried adding smartassv2 but I got these errors after running "make -j1" twice. Can anybody help/guide me? It is really my first time doing these things, because I'm very interested. BTW, I used your guide, smartassv2 from a github(forgot whos github im so sorry), arm-eabi toolchain and linaro toolchain. But still...

CHK include/linux/version.h

CHK include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

Creating rdb link for Hawaii

CALL scripts/checksyscalls.sh

CHK include/generated/compile.h

CHK kernel/config_data.h

CC drivers/cpufreq/cpufreq_smartass2.o

drivers/cpufreq/cpufreq_smartass2.c:175:10: error: ‘THIS_MODULE’ undeclared here (not in a function)

.owner = THIS_MODULE,

^

drivers/cpufreq/cpufreq_smartass2.c: In function ‘cpufreq_smartass_timer’:

drivers/cpufreq/cpufreq_smartass2.c:295:1: error: implicit declaration of function ‘cputime64_sub’ [-Werror=implicit-function-declaration]

delta_idle = cputime64_sub(now_idle, this_smartass->time_in_idle);

^

drivers/cpufreq/cpufreq_smartass2.c: At top level:

drivers/cpufreq/cpufreq_smartass2.c:869:16: error: expected declaration specifiers or ‘...’ before string constant

MODULE_AUTHOR ("Erasmux");

^

drivers/cpufreq/cpufreq_smartass2.c:870:21: error: expected declaration specifiers or ‘...’ before string constant

MODULE_DESCRIPTION ("'cpufreq_smartass2' - A smart cpufreq governor");

^

drivers/cpufreq/cpufreq_smartass2.c:871:17: error: expected declaration specifiers or ‘...’ before string constant

MODULE_LICENSE ("GPL");

^

cc1: some warnings being treated as errors

make[2]: *** [drivers/cpufreq/cpufreq_smartass2.o] Error 1

make[1]: *** [drivers/cpufreq] Error 2

make: *** [drivers] Error 2
[Android] SDShukla:
Good
[Android] pandasa123:
This is the fourth thread that you've commented "thanks" or "good". Use the thanks button instead! It says the same thing without clogging the thread
[Android] rc420head:
Thanks

----------------------------------------------

Candykat maintainer

Ville

M7 (gsm) (my current device)

Evita
[Android] SDShukla:
Done! :good:
[Android] jhonnyx:
Hello everyone, thread is really good, helped me but I have some doubts. I'm kind of a begginer into kernel modding/hacking and would like to know something:

If you compile a kernel, there are warnings, errors, etcetera.

When you've got warnings, most of the times, it'll seem that : "whew, it's a warning, not much of a prob as long as it compiles"

Actually I've managed to compile some kernels but nowadays I'm facing a data connectivity issue on one of the kernels i'm modding/hacking and there are no errors but while i compile, there are some warnings.

Is there a way to see those warnings past the compilation stage? I/E: are they logged into a file or should I use > to output that to a file?

Thanks in advance!
[Android] Gspin96:
I'm also a beginner, but I would suggest you to check the logcat and /proc/kmesg from your device
[Android] jhonnyx:
Thanks Gspin, the problem is that the error is from a device that's from Verizon (I'm on GNEX Maguro and problem lies on Verizon`s GNEX - Toro). So, the error is a device specific and the logs i could gather from other guys is that modem does not initialize. It's kind of more specific issue, so in that scenario I cannot gather dmesg / logs with sustantial data. But I'll keep on trying. Thanks!
[Android] bsmitty83:
What are the warning messages ? Usually they will point you to the code that is giving off the warning/error
[Android] jhonnyx:
Oh, a wild Smitty appeared!

Those are some of the warnings:

Also there are some USB/Video Related, but Most importantly I'd like to see if some of these warnings are the cause.

BTW: gladly I'll upload a log if someone's willing to take a look into it.

Thanks a ton
[Android] brymaster5000:
What tool chain are you using?

Those warnings point you to the bad code. Search this thread and Google for uninitialized functions, etc....You have some functions that have not been initialized. Sometimes they are in a separate code code.c vs code.h and are the same function but slightly different parameters. Matching them usually fixes it.

I suggest googling each warning. Stack overflow has a ton of C related questions.

Sent from my Lunar Ecliptic One.
[Android] jhonnyx:
Regarding the toolchain: I'm on arm-cortex_a9-linux-gnueabihf-linaro_4.9.1-2014.04 or arm-cortex-a9-linaro_4.7.4 for compatibility purposes.

Regarding warnings: I'm not good with programming language but I'm good at troubleshooting; most of what I did was to search for the function into another kernel's (same version) with github.

I'll begin googling, but if someone can point me on where to look regarding the data connection issues, that'll be awesome. (I know that I must search to achieve the goal, but maybe someone had this problem before and it's kind of easy to point out the problem).

Thanks so much guys!
[Android] bsmitty83:
A lot of those warnings I get as well , there are fixes for them floating around , usually I'll start by googling either the file that the error is in or the actual error itself .

For the data issues , I'd suggest using a logcat and look at the radio , you might be able to find a correlation between warnings in the log and the compiler errors . at least you should be able to narrow down the problem area .

I'll try to look into some of the warnings , I haven't seen a few of those before so I'm curious now [emoji6]
[Android] jhonnyx:
Smitty, by any chance do you have a Toro?
[Android] bsmitty83:
Yes I'm stuck on Verizon lol
[Android] jhonnyx:
I'll be sending you a PM then. Thanks!
[Android] Thecrazyskull:
Hello,

I get this weird thing/error:

can't find file to patch at input line 1825

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|diff -uNr Vanilla/drivers/cpufreq/Kconfig New/drivers/cpufreq/Kconfig

|--- Vanilla/drivers/cpufreq/Kconfig 2011-11-30 01:52:01.000000000 -0600

|+++ New/drivers/cpufreq/Kconfig 2012-07-06 17:45:58.000000000 -0500

--------------------------

File to patch:

Is there anyone who can help me??

Thanks in advance.
[Android] bsmitty83:
What was the command you used to apply the patch ?
[Android] Thecrazyskull:
first cd android/kernel then patch -p1 <kernelPatch
[Android] bsmitty83:
Not sure , usually when it gives that message , it can't find the file to patch , but I'm assuming that the kconfig is there , so maybe its looking in the wrong place . double-check the patchfile at that line and make sure its calling for the right file
[Android] Thecrazyskull:
I don't know what you mean.

I think that its asking for kconfig and i don't have that file in android/kernel/drivers.
[Android] bsmitty83:
Can you post the patch file ? I can probably help more .
[Android] Thecrazyskull:
With the patch file you mean kernelPatch?

If yes here it is.

(its in a txt extension otherwhise i can't upload it on xda)
[Android] bsmitty83:
ok i looked at your patch , its not a proper patch but a diff of 2 files , thats why its failing , in your quoted text its showing that its a comparison between the 2 Kconfig's one is in the /Vanilla dir , the other in /New

normally a patchfile will have this at the beginning of the additions and deletions

--- a//drivers/cpufreq/Kconfig

+++ b//drivers/cpufreq/Kconfig

instead of comparing 2 existing files , this will tell your machine you want to apply the changes to the named file .

i tried to modify your patch so that it will work , but no promises lol

just make sure to delete the .txt extension before you use
[Android] Thecrazyskull:
thank you very much i will try tomorrow.
[Android] Thecrazyskull:
It didn't work:crying::crying:
[Android] Mohamed Yaser:
Excuse me can that be done by cygwin?
[Android] Rubenyz:
No... Cygwin is just a Linux look-a-like terminal/bash environment. You can't do much more than possible in cmd...
[Android] Pankaj Rai:
awesome i have a ubantu live cd so i m trying it now
[Android] xda Santhosh:
Thanks a lot Boss >>>>>>>>>>>> Thanks again

:)
[Android] desalesouche:
hi again, i could port a 3.4 kernel from huawei u8800 to my device huawei honor(u8860).

kernel is booting and i got touchscreen working but not correct....

for code pin, if i press 2 , number 0 appear on screen...

if somebody can point me where to look in kernel about that point?

https://github.com/rmbq/android_kernel_huawei_msm7x30

thanks you.
[Android] azoller1:
i have built kernel before but now ive been switching linux version and i get this error

Can't find default configuration "arch/x86/configs/tf300t_cm11_defconfig"!

did i install something wrong? like 32-bit instead of 64-bit?

when i used to build kernels it would never look in that folder, not sure why its not looking in arch/arm instead of arch/x86 (which x86 is 32-bit right?)
[Android] brymaster5000:
Check your tool chain and make sure you input make blah_defconfig before make.
[Android] bsmitty83:
Export ARCH=arm , should take care of it .
[Android] azoller1:
but the error comes up when i type in

make tf300t_cm11_defconfig

edit: nevermind, export ARCH=arm did the trick, i didnt bother using this because i already had it in my ./profile file but i guess i didnt work, and should i also use export SUBARCH=arm?
[Android] bsmitty83:
No I never do , I just use export ARCH=arm , and export CROSS_COMPILE=~/ , for the toolchain
[Android] brymaster5000:
I started using subarch recently. Was getting script and path errors which this corrected. But I'm on Ubuntu 14 so perhaps that had something to do with it.
[Android] Gilbert_vanguard:
thanks

hey thanks for the tut! Will this work for intel as well?
[Android] ironshadow2:
guys, I want to edit the ramdisk to disable selinux

does anyone knows how to do this?
[Android] brymaster5000:
Open up the defconfig in the kernel and disable it. Arch/arm/config/blah_defconfig. Turn it from selinux_blah=y to #selinux_blah is not set
[Android] savoca:
Could also be lazy and add 'androidboot.selinux=permissive' to the cmdline.
[Android] ironshadow2:
u mean in *.Image file?

when I unpacked the kernel.elf

I got these files

boot.elf.Image and boot.elf.ramdisk.gz and boot.elf.rpm.bin and boot.elf.bootcmd

I know to unpack ramdisk but how do I unpack boot.elf.Image?

---------- Post added at 12:23 PM ---------- Previous post was at 12:06 PM ----------

I tried but this what I got from it

this is in kernel message

init: SELinux: Unknown value of ro.boot.selinux. Got: "permissive

[ 7.279749] init: SELinux: Unknown value of ro.boot.selinux. Got: "permissive

[ 7.279749] ". Assuming enforcing.
[Android] pec0ra:
You can't unpack the kernel image. The instruction he gave is to use at the moment you are compiling a kernel.
[Android] ironshadow2:
so, there is no way to disable selinux?
[Android] pec0ra:
I don't know but you can try this :

Go to www.google.com

Search for

android ramdisk disable selinux

Click on the second link (the xda one)

Find the post where there is the information you need

Follow these instructions ;)
[Android] ironshadow2:
I tried this before and it did not work :/

I'm using cm11 on xperia sp.
[Android] savoca:
Did you type

androidboot.selinux=permissive

I see

"permissive
[Android] ironshadow2:
yea, I did
[Android] :
Someone can help me compiling kernel from latest cm11 source?

Having issues compiling with linaro 4.7.3 toolchain..

Last few cm11 build kernel sources didnt have this issue :/ Can someone help?

Also zimage compiles after this big error. But when packed with ramdisk (initrd.img), the kernel doesnt boot, only kernel logo and recovery. after boot, kernel logo again into kernel logo and goes on and on..

Device: Xperia Neo V

Toolchain : Linaro 4.7.3

Source used: https://github.com/LegacyXperia/android_kernel_semc_msm7x30

OS: Kubuntu (64 bit)