yashsingh1/xdaforums huggingface dataset:
[Android] daggerxXxsin:
Hi, I just want to start off by saying what a great guide this is. For a begginer this is the most complete guide I've read. Great job!

Now, onto my question. I'm currently having a hard time fixing an error in building a kernel (AirKernel_GN_JB by r_data). I'm currently getting this error at the end of the build process:

OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
CC arch/arm/boot/compressed/misc.o
XZKERN arch/arm/boot/compressed/piggy.xzkern
CC arch/arm/boot/compressed/decompress.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
SHIPPED arch/arm/boot/compressed/ashldi3.S
AS arch/arm/boot/compressed/ashldi3.o
LD arch/arm/boot/compressed/vmlinux
/home/sinxgeronimo/android/toolchain/codesourcery/bin/arm-none-eabi-ld: cannot find arch/arm/boot/compressed/piggy.xzkern.o: No such file or directory
make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2
make: *** [zImage] Error 2

I didn't make any changes to the source, I just straight up compiled it using the author's own defconfig. At first I thought I might have set up the build environment wrong so I decided to compile a stock JB kernel from source and it encounters no errors. I have tried changing toolchains, still not getting anywhere. I googled for quite a while and I found tweet from this guy who was encountering the same error but with a different kernel source. He was advised to install a xz decompressor, so I did the same (installed xz-utils), restarted my rig, compiled and still getting the same error.

Hopefully someone can shed some light on what is going wrong with my attempts.
[Android] thicklizard:
It seems like the author used xz compression. So if you don't have the right files on your machine it won't build the object file. So you can either change compression to something like gzip, or Google xz compression and look for a download link here is the main site

http://tukaani.org/xz/
[Android] thewadegeek:
Nope you can manually edit the .config file. I believe that error is do to not having the correct dependency installed though, but I can't remember which one it is.

Check the permission on that file make sure the user that the script is running at can access the file.
[Android] Deadly:
@op.. we need ncurses configured to use menuconfig right?

Or am I wrong?

http://ftp.gnu.org/pub/gnu/ncurses/

hit thanks button! If above post helps u..

Sent from my GT-S6102
[Android] nimish77:
I am stuck at this command, can someone help me on how to create the zImage file?

cp arch/arm/boot/zImage maxrog_output/zImage

cp: cannot stat 'arch/arm/boot/zImage': No such file or directory
[Android] someone755:
zimage (the kernel) gets created when the compilation has finished without errors. (The compiler will tell you that "zImage is ready".)

Make sure you didn't get any errors (scroll up or run with - j1 if you have a fast enough CPU).
[Android] xDARKMATT3Rx:
Thank you!

Hi [MENTION=6829336]Hacker432[/MENTION] and [MENTION=4763308]robcore[/MENTION],

Just wanted to say thank you for your help! I was able to figure out my issue and compile successfully!

In drivers/video/msm/mdss/mdss_mdp_trace.h I needed to add "./../drivers/video/msm/mdss" to the end of the TRACE_INCLUDE_PATH on line 20:

Old #define TRACE_INCLUDE_PATH .

New #define TRACE_INCLUDE_PATH ../../drivers/video/msm/mdss

Thank you for your help!!
[Android] pritamdutt:
I am using SAMSUNG J200G with deodexed stock touchwiz lollipop. There is a kernel build with old sources with selinux permissive but with no volte support. I just want to add volte support to that kernel. any advice? also there are no sources for the current running kernel. so i guess i just have to stick to the old one.

NOTE: the current kernel has volte support.
[Android] robcore:
Oh yeah...good ol traces. Helpful and annoying all at once!

Great job figuring it out! Don't worry, it won't be long until compiler issues become second nature for you :)

---------- Post added at 09:14 AM ---------- Previous post was at 09:08 AM ----------

You have some options available, 3 off the top of my head.

Easiest: use osm0sis' ramdisk repack tool to set the kernel as permissive during boot. Of course setting it in code is preferable to setting it during boot, but without sources beggers can't be choosers!

Second easiest: I've actually gotten samsung to release 3 kernel source tarballs just by contacting them through their open source site. It takes time but they do it!

Hardest:

Find patches from similiar devices/cyanogenmod/etc and just patch in the functionality you want. I make it sound easier than it is though. I've spent a year and a half on my current project and cpu idle is broken again :/
[Android] xDARKMATT3Rx:
"Schedule workload on awake CPUs"

Hi [MENTION=4763308]robcore[/MENTION] and [MENTION=6829336]Hacker432[/MENTION],

I have a quick question. Can either of you point me to a commit that shows how to add the option to "schedule workload on awake cpus"?

Thank you in advance for your time and help!
[Android] robcore:
Gosh I'm not sure, over the last year or so I've upgraded my scheduling/ cpu management so much it's become hard to remember some of the specifics (which has become a definite problem in its own right). It *sounds* like something I've added at some point, but the scheduling stuff all kinda blurs together for me. If i come across it I'll let you know! What device are you building for?
[Android] TopherLee513:
ZTE Kernel with DOLBY DAP

This may be the first post I've ever done on here:

I'm trying to compile a kernel for my Z987 but I keep getting an error that DOLBY_DAP has unmet dependencies.

I registered at developer . dolby . com and downloaded the Dolby Audio API for Android.

The .zip contains a java file: "dolby_audio_processing.jar". I suspect that is not the file I need.

Anyone that has experience with DOLBY_DAP or knows an alternative, please let me know.

I've been working on this for like three days now. Nothing solid through google.

- Seacrest out.
[Android] brymaster5000:
That jar is probably for the system side of things. Meant for the framework folder or something. I would recommend looking up another phone's kernel source that you know has Dolby. The unmet dependencies is a gcc error that more or less tells you that the code is dependant on other code that's missing. Find the other phone's source on GitHub or equivalent and search that repo for dolby_dap. You should start to get an idea of files you'll need. Then go into that repo and search the commit history for the changes that you may need.
[Android] UncleHarambae:
Hey great tutorial mate, I've followed your guide and when I get to "make devon_defconfig" this error comes up.

kernel/irq/Kconfig:22:warning: leading whitespace ignored

fs/Kconfig:219: can't open file "fs/f2fs/Kconfig"

/home/vman/kernel-msm/scripts/kconfig/Makefile:108: recipe for target 'devon_defconfig' failed

make[1]: *** [devon_defconfig] Error 1

Makefile:512: recipe for target 'devon_defconfig' failed

make: *** [devon_defconfig] Error 2

So I researched and checked Motorola github for f2fs and found the "motorola-kernel" repository which had f2fs, but I didn't find any 6.0.1 Lux (lux is my device) version, I only saw "marshmallow-6.0.1-release-griffin", "marshmallow-6.0.0-release" and "marshmallow-6.0.0-release-victara" there was other lollipop branches but none of the branches had my device name on it which is "lux". Any ideas one what I should do? Also I am building for Marshmallow 6.0.1 not 6.0.0, Thanks.
[Android] somadsul:
does anyone can help me please
[Android] gabrielgagz:
Sorry i know your post is from 2015, but did you solve this problem?. I'm trying to compile the kernel for the Razer Forge TV and i'm stuck on this exactly error. I'm using the toolchain arm-eabi-4.8.
[Android] gabrielgagz:
Someone can help me with this error?

drivers/usb/core/hub.c:2257:3: warning: passing argument 1 of 'otg_send_event' makes pointer from integer without a cast [enabled by default]

I'm trying to build the Razer Forge TV kernel, with usb otg enabled...i'm stuck on that error.

I'm using toolchain arm-eabi-4.8..
[Android] Surge1223:
The first argument of otg_send_event is using a pointer that is assigned to something that's is or points to an integer instead of the value that that integer should point to
[Android] gabrielgagz:
Thanks for your help, but i cant see the error on the file. Can i upload the file and if you have some time, you take a look?

Thanks again
[Android] gabrielgagz:
I just can´t get rid of this error, try all with no luck:

Someone know if is safe compile without the -Wall CFLAG?
[Android] heliusjing:
can i get any guide from here???

make x3_defconfig

drivers/media/platform/msm/Kconfig:70: can't open file "../vendor/lenovo/camera/camera-driver/Kconfig"

/home/helius/android/kernel/x3c70_mm/kernel/scripts/kconfig/Makefile:105: recipe for target 'x3_defconfig' failed

make[1]: *** [x3_defconfig] Error 1

Makefile:510: recipe for target 'x3_defconfig' failed

make: *** [x3_defconfig] Error 2
[Android] kjinx01:
nice work
[Android] Hacker432:
Hi guys.

I successfully compiled a kernel for cm13.0 but after the vendor logo the screen goes black.

Can someone help me to understand why and eventually how can I fix it?

Here is the dmesg.

http://hastebin.com/ovasabider.vbs

seems like display keeps restarting.

[MENTION=5991747]neonkat[/MENTION]
[Android] neonkat:
sounds weird,never had such case.seems like it is not recognising your display panel.can you link me the source of the kernel?and did you make any changes in it?
[Android] Hacker432:
Source:

https://github.com/G620S-HUAWEI/android_kernel_cyanogen_msm8916/tree/y550dianway

This kernel is forked from:

https://github.com/CyanogenMod/android_kernel_huawei_msm8916/tree/cm-13.0

I simply added support for my device Y550 same way the maintainer did for other devices(as you can see in last commit)

Inviato dal mio Y550-L01 utilizzando Tapatalk
[Android] duowing:
Well maybe you guys can give me a hand. I've been fumbling my way through trying to build a kernel for the HTC10. My knowledge of java/c/c++/linux is pretty limited, but I've been making progress. I've gotten around other errors, but this one keeps stumping me

In file included from drivers/net/ethernet/msm/rndis_ipa_trace.h:81:0,
from drivers/net/ethernet/msm/rndis_ipa.c:32:
include/trace/define_trace.h:83:43: fatal error: ./rndis_ipa_trace.h: No such file or directory
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^
compilation terminated.
scripts/Makefile.build:257: recipe for target 'drivers/net/ethernet/msm/rndis_ipa.o' failed
make[4]: *** [drivers/net/ethernet/msm/rndis_ipa.o] Error 1
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet/msm' failed
make[3]: *** [drivers/net/ethernet/msm] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Error 2
scripts/Makefile.build:402: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....

Here's the link the the github I started with the changes I've made that have gotten me around the errors. Also the files that are giving me issues I've left untouched as I'm not sure what to do with them. Any help would be greatly appreciated!

https://github.com/duowing/HTC10/tree/modded

EDIT: Well I finally managed to make it through. I at least think I realized after playing around that define_trace.h was recalling the file that initially called it, but for some reason it couldn't find the path back to that initial file. I'm not really sure what is missing and why it couldn't find it since all the other kernel sources I look at has this file setup exactly the same way. I also don't really understand why these sources are released by the OEM and they don't just build? I finally got my Image-dtb.gz. I encountered a whole bunch of other errors along the way which were mainly just changing <> to " " or where I had to add a ../ because the #include was looking for a file that was one directory above.
[Android] apkbpkcpk:
great tutorial, thanks
[Android] gabrielgagz:
Hi guys i have successfully build my kernel, adding wifi driver anda support for ntfs and exfat. But, each time i add a custom IO scheduler or a custom governor, my device never start, just shutdown after the company logo ....how can i debug or see some logs if the system just shutdown? Thanks
[Android] bcrichster:
You may have the boot frequency set too low.. Set it to stock speeds for that and the user can manually adjust as needed
[Android] sagar846:
Hi everyone, Can someone please tell me how one can change the kernel's selinux to permissive?
[Android] MrHellRider:
Download selinux mode changer from playstore
[Android] sagar846:
It's my fault I didn't ask the question properly.

I'll rephrase it,

How to change selinux to permissive in the kernel source before compilation?
[Android] robcore:
Heck yes! First off, which manufacturer are you building for?

Edit: here is the basic removal https://github.com/robcore/machinex/commit/661043b8d3a485b75815dddcf9d57b3acecb25a4

Now, samsung (and perhaps other vendors) has a config option called "always enforcing" that needs to be handled as well...this may not apply to other vendors, but you may want to check to see if they have implemented something similiar https://github.com/robcore/machinex/commit/0ab17200861e485aaa43d996fb40a20fd1a6238b
[Android] sagar846:
Thanks for that. I'm building for Motorola Moto G 4 Plus.

I have a couple of more queries, can I contact you via pm? I don't want to clutter this thread.
[Android] robcore:
Sure man, but this isn't clutter, it's what the thread is for! I like keeping stuff like this in the thread so others can learn from our discussion you know? It's my way of giving back given how much I've learned thanks to threads and discussions like these.

For instance, the first commit I linked to was the wrong one! THIS is the commit you want for the universal disabling of enforcing mode: https://github.com/robcore/S4-AEL-Kernel-Lollipop/commit/2d6ae80267115db73811e502fd0c31aeeee6663b
[Android] gabrielgagz:
Do you have somee guide to do that? I'm comparing my default interactive governor with the one i want to use (zzmove) and i have no ide how to do that...
[Android] xXDroidMechanicXx:
Deleted post
[Android] MayanKKaushik:
when compiling kernel for mi pad 1 from source i am getting the following error

mayank@mayank-Compaq-15-Notebook-PC:~/android/kernel$ ARCH=arm CROSS_COMPILE=~/arm-eabi-4.4.3/bin/arm-eabi- make mocha

make: *** No rule to make target 'mocha'. Stop.

sorry fore being a noob
[Android] Fed2x:
Thanks for this thread. Very useful for people who never built a kernel.

But what I'm interested in is: How can i compile the kernel with the latest security patches?

Thanks in advance!
[Android] dalincn:
Thank u
[Android] nikkali25:
How to add automatic on display on kernel?
[Android] Bombastic11R:
Been trying to add governors to HTC desire 530 kernel and been getting this while compiling.

Any idea?

Used multiple sources and different governors but always something goes wrong while compiling C file!
[Android] _that:
1. Type function name from error message into search field

2. Click the first result

3. ????

4. PROFIT!!!!

If this approach approach doesn't work, try Google...
[Android] Bombastic11R:
thanks for the advice

already done all that , been looking everywhere for 2days straight now.

no hope...
[Android] _that:
I googled for a minute now, and it seems that cputime64_sub was present in 2.6.x kernels and very early 3.x but removed later (literally from the first hit on Google which leads to lxr). Maybe you're trying to apply a kernel patch to a very different kernel version than it was written for.
[Android] Bombastic11R:
Well thanks for that, I tried Intelliactive witch was written for 3.x and for MSM cpu but still had error while compiling.

Anyway thanks for helping!
[Android] lzzy12:
Reserved
[Android] taalojarvi:
I got error! HAALP!

Also MSM8916 Xiaomi Redmi 2 using Google Toolchain

In file included from drivers/usb/gadget/ci13xxx_msm.c:16:0:
drivers/usb/gadget/ci13xxx_udc.c: In function 'udc_probe':
drivers/usb/gadget/ci13xxx_udc.c:4085:1: warning: label 'del_udc' defined but not used [-Wunused-label]
error, forbidden warning: ci13xxx_udc.c:4085
scripts/Makefile.build:308: recipe for target 'drivers/usb/gadget/ci13xxx_msm.o' failed
make[3]: *** [drivers/usb/gadget/ci13xxx_msm.o] Error 1
scripts/Makefile.build:455: recipe for target 'drivers/usb/gadget' failed
make[2]: *** [drivers/usb/gadget] Error 2
scripts/Makefile.build:455: recipe for target 'drivers/usb' failed
make[1]: *** [drivers/usb] Error 2
make[1]: *** Waiting for unfinished jobs....
[Android] gopinaidu77:
U can ask here ..

Ask all questions in one post and u will get one answer in second post without any extention. This points all who replies now .if i cant answer someone will reply after my post. Hahaha . Make ur next post now
[Android] mrpascal:
make -j<cpu_core>

we have to put cpu_core of our mobile or our computer

well i am on virtualbox & i have assigned 2 processors to it

and my phone has quad core cpu

so what value i have to put in my "-j"

make -j4

OR

make -j2:confused:

I am really confused

can anyone please help me :crying: [MENTION=3830475]thewadegeek[/MENTION]
[Android] mostafaz:
The core of computer (compile machine)

If it has multi threat support so put 4 (2*2) if no just 2 (u said its in vbox with 2 core) if u assign more then it cant share with more cores so its useless. Ofcourse u can let compiler decide it and not use -j# switch (u are in vbox with limitted resourse).

Run this command in terminal to see available cores

grep -c ^processor /proc/cpuinfo
[Android] _that:
Use -j2. Getting this wrong is not critical, it will only take more time to build.
[Android] gopinaidu77:
:eek: , u trying to compile a rom on phone ? It takes weeks bro. And even the 4gb ram for nougat builds wont be enough so u have to enable maximum swap space . most important thing u need a large amount of external storage
[Android] mrpascal:
:laugh:Hahaha, who told you that i am compiling rom on phone

First of all I am compiling a kernel not rom and obviously on computer !!!!
[Android] gopinaidu77:
Oh. After reading that 4 cores point i thought that u are........
[Android] _OBEDDO:
Sorry I'm a noob someone can explain me in "mod 1" what should I do? Thanks in advance
[Android] neonkat:
that's a way to apply patches in your source.you can download patches from patchwork or from github or anywhere else and apply it through the given method.

it is not needed for compiling the kernel(the tiltle says *modification*).
[Android] _OBEDDO:
Thank you. But after that when patching its gives me errors, when I go to the kernel root on drivers, cpufreq, I can't find kconfig but the others.
[Android] MysticSurge:
Can I get some help I'm currently attempting to build a zImage for the Kindle Fire 2nd Gen (otter2) I even went ahead and used the cross compiler that amazon recommends but I'm still getting this one issue here is the error

arch/arm/mm/proc-v7.S: Assembler messages:
arch/arm/mm/proc-v7.s:391: Error: selected processor does not support ARM mode 'smc #0'
scripts/Makefile.build:341: recipe for target 'arch/arm/mm/proc-v7.o' failed
make[1]: *** [arch/arm/mm/proc-v7.o] Error 1
Makefile:959: recipe for target 'arch/arm/mm' failed
make: *** [arch/arm/mm] Error 2

For the Cross-Compiler I'm using a copy of CodeSourcery g++ lite (arm-none-linux-gnueabi)
[Android] mustang_ssc:
I own a msm8916 device as well (Huawei Mediapad T1 10) and the 90% of the issues when trying to compile the kernel source got from Huawei are related to this:

In file included from drivers/usb/gadget/ci13xxx_msm.c:16:0:
drivers/usb/gadget/ci13xxx_udc.c: In function 'udc_probe':
drivers/usb/gadget/ci13xxx_udc.c:4085:1: warning: label 'del_udc' defined but not used [-Wunused-label]
error, forbidden warning: ci13xxx_udc.c:4085

I "fix" (or avoid) this by deleting the function on the file that the warning shows, on this case 'udc_probe' from drivers/usb/gadget/ci13xxx_msm.c: or drivers/usb/gadget/ci13xxx_udc.c, then the build process do not get errors on that step, but on my case it does not really matter because i still get a huge amount of similar forbidden warnings that it would take me ages to "fix" them, and what it frustrate me is that i do not have enough development knowledge to know if what i am doing is correct or not.

I would be HUGELY appreciate if someone who knows about this issue could shed some lights about it, i have been trying to compile my kernel source more than 1 year ago without success.

Edit: forgot to mention that most of the times i also get the "implicit declaration" forbidden warnings.
[Android] mostafaz:
HI

The function or variable defined but not used : which compiler version u use? For example stock source can easily compile with 4.x version than 5.x or 6.x or 7.x. for higher versions u need to fix or omit the warnings.

In the warning or error with this style "[wxxx] or anything in a bracket use "wno-xxx" switch. -wno-unused-lable

Look at the makefile changes I did for gcc7 in this commit

https://github.com/mostafa-z/Lineag...mmit/acaa34ee337a389124a76fab5ef0dc13e5011f11

OR this

https://github.com/mostafa-z/Lineag...mmit/daf55d02758860b8b206efdcd869b1510d75b084

https://github.com/mostafa-z/Lineag...mmit/28f9a881c4aea1505445eb8c2f8bb8a7246a0244

https://github.com/mostafa-z/Lineag...mmit/988f51e60939fe3658d64d6ec1f953e665520041

The 1st link style is enough. For example add -wno-unused-lable to makefile in root directory of kernel source to not warn about it in compile time.

Implicit declaration means it has no definition about it in current file or a header file "*.h" in first of the file .

The target architecture is important too for choosing gcc. 32 or 64 bit cpu.
[Android] Nuttapat007:
To flash kernel it need to know where boot.img is

I've navigated in/dev/block/platform/sprd-sdhci.3/by-name folder that many tutorials suggest.

boot.img isn't here but there's kernel file. And i wondering where my boot.img is.:confused:

I use cyanogenmod 12.1

HELP ME PLEASE:D

These are all files inside /dev/block/platform/sprd-sdhci.3/by-name

lrwxrwxrwx 1 root root 21 Aug 9 17:53 CSC -> /dev/block/mmcblk0p19
lrwxrwxrwx 1 root root 20 Aug 9 17:53 FIXNV1 -> /dev/block/mmcblk0p1
lrwxrwxrwx 1 root root 20 Aug 9 17:53 FIXNV2 -> /dev/block/mmcblk0p2
lrwxrwxrwx 1 root root 20 Aug 9 17:53 FOTA_SIG -> /dev/block/mmcblk0p9
lrwxrwxrwx 1 root root 21 Aug 9 17:53 HIDDEN -> /dev/block/mmcblk0p21
lrwxrwxrwx 1 root root 21 Aug 9 17:53 KERNEL -> /dev/block/mmcblk0p17
lrwxrwxrwx 1 root root 20 Aug 9 17:53 MODEM -> /dev/block/mmcblk0p7
lrwxrwxrwx 1 root root 20 Aug 9 17:53 MODEM_BACKUP -> /dev/block/mmcblk0p8
lrwxrwxrwx 1 root root 21 Aug 9 17:53 OTA -> /dev/block/mmcblk0p10
lrwxrwxrwx 1 root root 21 Aug 9 17:53 Odin_reserved -> /dev/block/mmcblk0p16
lrwxrwxrwx 1 root root 21 Aug 9 17:53 PARAM -> /dev/block/mmcblk0p13
lrwxrwxrwx 1 root root 21 Aug 9 17:53 RECOVERY -> /dev/block/mmcblk0p18
lrwxrwxrwx 1 root root 21 Aug 9 17:53 RUNTIMENV1 -> /dev/block/mmcblk0p11
lrwxrwxrwx 1 root root 21 Aug 9 17:53 RUNTIMENV2 -> /dev/block/mmcblk0p12
lrwxrwxrwx 1 root root 20 Aug 9 17:53 SBL1 -> /dev/block/mmcblk0p3
lrwxrwxrwx 1 root root 20 Aug 9 17:53 SBL2 -> /dev/block/mmcblk0p4
lrwxrwxrwx 1 root root 20 Aug 9 17:53 WDSP -> /dev/block/mmcblk0p5
lrwxrwxrwx 1 root root 20 Aug 9 17:53 WDSP_BACKUP -> /dev/block/mmcblk0p6
lrwxrwxrwx 1 root root 21 Aug 9 17:53 efs -> /dev/block/mmcblk0p14
lrwxrwxrwx 1 root root 21 Aug 9 17:53 prodnv -> /dev/block/mmcblk0p15
lrwxrwxrwx 1 root root 21 Aug 9 17:53 system -> /dev/block/mmcblk0p20
lrwxrwxrwx 1 root root 21 Aug 9 17:53 userdata -> /dev/block/mmcblk0p22
[Android] mostafaz:
Use

# dd if=/path.to.boot.partition of=/sdcard/boot.img

It will backup your current boot

Reverse location to flash kernel.

U can see drivers parameters from kernel not its files.

Like control zram if it's exist
[Android] Nuttapat007:
Sorry for silly questions.

I wonder how to see driver parameters from kernel.
[Android] mostafaz:
Ie: /sys/kernel/mm/ksm/*

There is kernel same page merging sysfs